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

Hi,

I am trying to create a salary rule based on the nationality as we need to have to book air ticket allawance based on the home country of the employee.

I tried result = employee.nationality == 'Philippines' or false

but I am getting an error on that.

 

any help will be appreciated.

 

아바타
취소
베스트 답변

Try this:

result = employee.country_id.name == 'Philippines' or false

Update:

if  employee.country_id.name == 'Philippines':
   result = 0
elif  employee.country_id.name == 'Poland':
   result = 1000
else:
   result = 1
 

 

 

 

아바타
취소
작성자 베스트 답변

Hi Zbik,

Thanks for the quick response, but how can make that with a nested if? is that possible as I need to test difference conditions against the country of the empoyee.

I had to edit this since I can reply to the second reply. 

 

Thank Zbik, but I assume this code goes in the Conditions section. what would be used on the compution part?

아바타
취소

answer updated

See, as demo, l10n_be_hr_payroll_data.xml in module l10n_be_hr_payroll

관련 게시물 답글 화면 활동
2
3월 24
2048
0
3월 24
1550
2
2월 24
2111
0
5월 23
1981
0
5월 23
3945