Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
5064 มุมมอง

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
14786
2
ต.ค. 20
7451
2
ส.ค. 19
7631
4
ส.ค. 18
19803
4
มิ.ย. 18
5090