Skip to Content
Menu
This question has been flagged
1 Reply
8819 Views

Hello,

I need to change the "date_maturity" of "account.move.line" as soon as i update the "date_due" of "account.voucher". So i overrided the wirte() function of "account.voucher" like this :

def write(self, cr, uid, ids, vals, context=None):

    for voucher in self.browse(cr, uid, ids, context=context):

        for move_line in voucher.move_ids:

            date_maturity = voucher.date_due

            move_line.write(cr, uid, [move_line.id], {'date_maturity': date_maturity},context=context)

    return super(account_voucher,self).write(cr, uid, ids, vals, context=context)

The override works like a charm, but when i get to execute the "move_line.write...." line, I get this error message :

Error : write() got multiple values for keyword argument 'context'


Thanks a lot for your help guys.

Avatar
Discard
Best Answer

You could solve it like:

move_line.write({'date_maturity': date_maturity},context=context)
Avatar
Discard
Related Posts Replies Views Activity
9
Dec 23
16333
0
Apr 16
3811
2
Jun 16
16820
1
Dec 24
154
0
Nov 24
63