Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
10481 Lượt xem
Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 9 17
3788
2
thg 1 16
35619
4
thg 9 15
6976
1
thg 8 20
4684
1
thg 4 20
5216