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.

1

Error when extend on_change method in invoice_line

By
dark
on 3/26/15, 7:07 AM 524 views

I try to extend the method product_id_change from the model account.invoice.line :
 

class account_invoice_line(models.Model):

_inherit = 'account.invoice.line'

      @api.multi

      def product_id_change(self, product, uom_id, qty=0, name='', type_x='out_invoice',

                                          partner_id=False, fposition_id=False, price_unit=False, currency_id=False,

                                          company_id=None):

            res = super(account_invoice_line, self).product_id_change(self,product, uom_id, qty, name, type_x, partner_id,                                                                                                         fposition_id, price_unit, currency_id, company_id)

            return res.


But i'have this error when i call product_id_change with super : TypeError: product_id_change() takes at most 11 arguments (12 given) .


Have you an idea ?

0

zbik

--zbik--
5941
| 6 4 7
Lodz, Poland
--zbik--


zbik
On 3/26/15, 8:33 AM

Try this:

res = super(account_invoice_line, self).product_id_change(product, uom_id, qty, name, type_x,   partner_id, fposition_id, price_unit, currency_id, company_id)

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/26/15, 7:07 AM
Seen: 524 times
Last updated: 4/2/15, 8:27 PM