Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Contabilità
- Magazzino
- PoS
- Project
- MRP
La domanda è stata contrassegnata
1
Rispondi
10537
Visualizzazioni
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
Ti stai godendo la conversazione? Non leggere soltanto, partecipa anche tu!
Crea un account oggi per scoprire funzionalità esclusive ed entrare a far parte della nostra fantastica community!
RegistratiPost correlati | Risposte | Visualizzazioni | Attività | |
---|---|---|---|---|
|
0
set 17
|
3848 | ||
update fields on write() method
Risolto
|
|
2
gen 16
|
35673 | |
How to access the vals dict.
Risolto
|
|
4
set 15
|
7015 | |
|
1
ago 20
|
4724 | ||
|
1
apr 20
|
5257 |