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

I currently have a field called target price, and I want to take the product cost, divide it by a number and put the result in the filed.

This is my current script:

Field name: x_studio_target_price_1
Dependencies: standard_price
Compute: for record in self:
record[("x_studio_target_price_1)] = record.standard_price / 1.15

Standard_price is the field name for the cost in odoo product.template object. 

Whenever I use this script it doesn't give me any errors but nothing is being computed either. Can someone help?

아바타
취소
작성자

@Chris TRINGHAM I don't have enough karma to comment to your post buy your solution worked! Thank you so much!

베스트 답변

I got it working with this syntax: 

for record in self:
record['x_studio_target_price_1'] = record.standard_price / 1.15
아바타
취소
베스트 답변

Hi!

Try to assign the 1.15 value to another field, for example, calling it "targetfactor"=1.15 

Then do:

record[("x_studio_target_price_1)] = record(standard_price)* record(targetfactor)


아바타
취소
관련 게시물 답글 화면 활동
7
11월 15
14450
0
9월 17
3982
3
9월 24
1578
0
12월 23
1470
0
11월 21
3071