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

I am trying to calculate the value of margin for every sale order line.

I can see that purchase_price is part of database as a regular column in sale_order_line.

But when I read sale.py code I can see that it is not part of sale_order_line class.

I can't either use the value in on_change attributes, everytime I change the value of purchase_price in the form and try to submit it to backend server the previous value is used.

Anyway if I modify and store the value is properly recorded in database. Could someone help me to understand how this works?

Thanks,

아바타
취소

Odoo uses module mechanism. So if you don't install purchase, you don't have purchase_price in sale model. So if you want use this field, your module need to depend of purchase ! If you search the declaration, it is in sale_margin. Module sale_margin do what you are looking for ... I think... :)

관련 게시물 답글 화면 활동
2
7월 15
6321
2
6월 15
4135
1
7월 16
6694
2
10월 16
8928
2
8월 16
11497