跳至內容
選單
此問題已被標幟
1 回覆
10598 瀏覽次數
最佳答案

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

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
0
9月 17
3897
2
1月 16
35723
4
9月 15
7054
1
8月 20
4787
1
4月 20
5322