İçereği Atla
Menü
Bu soru işaretlendi
1 Cevapla
4967 Görünümler

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
Vazgeç
En İyi Yanıt

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
Vazgeç
Üretici

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

Üretici

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

İlgili Gönderiler Cevaplar Görünümler Aktivite
1
Nis 19
14689
2
Eki 20
7237
2
Ağu 19
7461
4
Ağu 18
19681
4
Haz 18
4940