Skip to Content
Menu
Dette spørgsmål er blevet anmeldt
1 Svar
5010 Visninger

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...

Avatar
Kassér
Bedste svar

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

Avatar
Kassér
Forfatter

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

Forfatter

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

Related Posts Besvarelser Visninger Aktivitet
1
apr. 19
14753
2
okt. 20
7364
2
aug. 19
7521
4
aug. 18
19750
4
jun. 18
5017