Hi,
I try to extend the method product_id_change from the model account.invoice.line as follow :
from openerp.osv import osv, fields
from openerp import api
import openerp.addons.decimal_precision as dp
class account_invoice_line(osv.osv):
_inherit = 'account.invoice.line'
_columns = {
'price_unit_with_tax':fields.float(string='Prix Unitaire TTC', digits= dp.get_precision('Product Price'), readonly=True,),
}
@api.multi
def product_id_change(self, product, uom_id, qty=0, name='', type='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(product, uom_id, qty=qty, name=name, type=type,
partner_id=partner_id, fposition_id=fposition_id, price_unit=price_unit, currency_id=currency_id,company_id=company_id)
if res == 0:
return res
context = self._context
...
return res
But when I change the product on an invoice line, I get an error saying that I provide too much arguments :
TypeError: product_id_change() takes at most 11 arguments (15 given)
But the definition of my method product_id_change respect the same number of argument !
I can't get what's wrong in my code!
Thank you for your help
Cheers