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

Actually, when I add a product, the field Description is fill by the name product.

I want change the auto-fill with the name by the description field.

I try the compute field but it's work only with static value and when I add the product it's erase by the auto fill...

アバター
破棄
最善の回答

In this case you have to Override the Onchange product_id definition(Function)   or Best solution is inherit onchange definition

@api.onchange('product_id')

def _onchange_product_id(self):

   result = super(account_invoice_line, self)._onchange_product_id()

   self.name = self.product_id.description

    return result


here  super(account_invoice_line, self) , account_invoice_line is the class name

アバター
破棄
著作者

Thanks, but account_invoice_line doesn't exist, the name of this model must be an other name.

著作者

My bad, I don't understand I need put the same name of the model. :)

関連投稿 返信 ビュー 活動
1
4月 19
14689
2
10月 20
7236
2
8月 19
7460
4
8月 18
19680
4
6月 18
4940