Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
10593 Weergaven
Beste antwoord

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
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
0
sep. 17
3897
2
jan. 16
35722
4
sep. 15
7052
1
aug. 20
4787
1
apr. 20
5321