콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
5108 화면

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
4월 19
14833
2
10월 20
7502
2
8월 19
7690
4
8월 18
19872
4
6월 18
5183