コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
3747 ビュー

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 ?

アバター
破棄
最善の回答

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)

アバター
破棄
関連投稿 返信 ビュー 活動
4
9月 15
5671
2
11月 18
14675
2
7月 16
4277
3
2月 16
4719
2
10月 15
10375