Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Help with salary rule

By
Emad Jaddou
on 3/3/15, 12:41 PM 659 views

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.

 

1

zbik

--zbik--
5941
| 6 4 7
Lodz, Poland
--zbik--


zbik
On 3/3/15, 1:48 PM

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
 

 

 

 

0
Emad Jaddou
On 3/3/15, 2:09 PM

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

zbik
on 3/3/15, 2:23 PM

See, as demo, l10n_be_hr_payroll_data.xml in module l10n_be_hr_payroll

zbik
on 3/3/15, 2:50 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 3/3/15, 12:41 PM
Seen: 659 times
Last updated: 3/16/15, 8:10 AM