Odoo Help

0

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

By
mostafa
on 10/26/14, 6:13 AM 1,333 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

About This Community

This platform 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.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 10/26/14, 6:13 AM
Seen: 1333 times
Last updated: 3/16/15, 8:10 AM