Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
5037 Tampilan

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
Buang
Jawaban Terbai

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
Buang
Penulis

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

Penulis

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

Post Terkait Replies Tampilan Aktivitas
1
Apr 19
14772
2
Okt 20
7435
2
Agu 19
7568
4
Agu 18
19793
4
Jun 18
5075