Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
1
Trả lời
10481
Lượt xem
Hi,
vals is a dictionary containing the values to create a new record or write to a record in the model.
I hope you are working in Odoo 8 new api.
In that case, if you want to override create():
eg:
class AccountJournal(models.Model):
_inherit = "account.journal"
@api.model
def create(self, vals):
rec_id = super(AccountJournal, self).create(vals)
...
... #do your stuff
return rec_id
and for write():
eg:
class AccountJournal(models.Model):
_inherit = "account.journal"
@api.multi
def write(self, vals):
res = super(AccountJournal, self).write(vals)
...
... #do your stuff
return res
Hope this helps
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
0
thg 9 17
|
3788 | ||
update fields on write() method
Đã xử lý
|
|
2
thg 1 16
|
35619 | |
How to access the vals dict.
Đã xử lý
|
|
4
thg 9 15
|
6976 | |
|
1
thg 8 20
|
4684 | ||
|
1
thg 4 20
|
5216 |