Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

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

By
Amre MAARIR
on 3/28/16, 9:20 AM 690 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.

1

Axel Mendoza

--Axel Mendoza--
10205
| 7 7 8
Camaguey, Cuba
--Axel Mendoza--

DevOps - Full stack - Software Architect - Developer - Technology Integrator

I could help you to develop anything and solve complex problems based on technologies, integrations and tricky stuffs mostly in Python with OpenERP/Odoo, Zato, Django and many others frameworks programming languages and technologies.

I offers consulting services to anyone with an unanswered questions or needs for customizations. Think about it, maybe it's better to have an expert to solve your issues and projects than having a full time employee trying to understand what to do an how

Reach me at aekroft@gmail.com

Axel Mendoza
On 3/28/16, 10:22 AM

You could solve it like:

move_line.write({'date_maturity': date_maturity},context=context)

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 3/28/16, 9:20 AM
Seen: 690 times
Last updated: 3/28/16, 10:50 AM