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

Hello all,

I have an employee. A product is linked with this employee :

The product cost is 12.5 $ per worked hour :

 

How could I get this 12.5 $ in this python rule for salary?

(here, I write PRODUCT.COST, but it is not good)

Debug :

This one work if calculate in pay slip : result = worked_days.WORK100.number_of_hours * 12.5

This one doesn't work if I calculate in payslip (error) : result = worked_days.WORK100.number_of_hours * employee.product_id.cost

아바타
취소

Change to: result = worked_days.WORK100.number_of_hours * employee.product_id.standard_price

작성자

It was exactly what I needed. Thanks a lot!

베스트 답변

Test the value:

employee.product_id.standard_price

# Available variables:
#----------------------
# payslip: object containing the payslips
# employee: hr.employee object
# contract: hr.contract object
# rules: object containing the rules code (previously computed)
# categories: object containing the computed salary rule categories (sum of amount of all rules belonging to that category).
# worked_days: object containing the computed worked days
# inputs: object containing the computed inputs

아바타
취소
작성자

doesn't work sorry and thanks

Sorry, wrong name of the field, corrected.