Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Бухгалтерия
- Склад
- PoS
- Project
- MRP
Этот вопрос был отмечен
1
Ответить
11396
Представления
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
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Регистрация| Related Posts | Ответы | Просмотры | Активность | |
|---|---|---|---|---|
|
|
0
сент. 17
|
4432 | ||
|
|
2
янв. 16
|
36478 | ||
|
How to access the vals dict.
Решено
|
|
4
сент. 15
|
7636 | |
|
|
1
авг. 20
|
5349 | ||
|
|
1
апр. 20
|
5894 |