Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
4569 Lượt xem

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

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhấ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

Ảnh đại diện
Huỷ bỏ
Tác giả

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

Tác giả

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

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 4 19
14238
2
thg 10 20
6748
2
thg 8 19
6940
4
thg 8 18
19272
4
thg 6 18
4492