تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
5030 أدوات العرض

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

المنشورات ذات الصلة الردود أدوات العرض النشاط
1
أبريل 19
14770
2
أكتوبر 20
7434
2
أغسطس 19
7562
4
أغسطس 18
19791
4
يونيو 18
5065