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

How to use employee:hr.employee object in the salary rule

By
mostafa
on 10/26/14, 6:13 AM 982 views

Hi

i want to know what is wrong in this rule

if employee.place_of_birth == 'egypt' :
result = contract.wage * 0.10

i want to make rule processed if the employee ( place of birth ) egypt

what can i do to solve this mistake

2
sameer alhwety
On 10/26/14, 6:28 AM

Create new rule : 

in Condition Based on : Python Experssion 

Python Condition : SET_YOUR_CONDITION_HERE ''' result = employee.place_of_birth == 'egypt' or false '''

 

@sameer thanks for ur replay but i created rule like this : Condition based on result = employee.place_of_birth == 'egypt' or false and the rule is result=-contract.wage*0.07 but it give me Wrong python condition defined for salary rule employee.

mostafa
on 10/26/14, 6:45 AM

The condition and rule are totally correct , i use it before and work perfectly . you have to check the salary structure if there is any wrong .

sameer alhwety
on 10/26/14, 6:53 AM

@sameer Can u post ur rule to compare with my rule

mostafa
on 10/26/14, 7:05 AM

condition is =>> result = employee.marital == 'single' or false rule ==>> result=contract.wage*0.7

sameer alhwety
on 10/26/14, 7:09 AM

Thanks sameer it works fine

mostafa
on 10/26/14, 7:37 AM

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: 10/26/14, 6:13 AM
Seen: 982 times
Last updated: 3/16/15, 8:10 AM