Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
1 Antworten
10617 Ansichten


Avatar
Verwerfen
Beste Antwort

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

Avatar
Verwerfen
Verknüpfte Beiträge Antworten Ansichten Aktivität
0
Sept. 17
3902
2
Jan. 16
35730
4
Sept. 15
7055
1
Aug. 20
4796
1
Apr. 20
5330