Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
5089 Переглядів

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

Related Posts Відповіді Переглядів Дія
1
квіт. 19
14822
2
жовт. 20
7490
2
серп. 19
7649
4
серп. 18
19850
4
черв. 18
5145