Odoo Help


Can someone please tell me what's wrong with this code?

Ninad Dike
on 5/13/14, 3:36 AM 1,228 views

I'm trying to define salary rules for employees. I've created an employee, assigned him a user and have created a monthly contract for him. The problem is that when I try to define this python code for City Compensatory Allowance and then go to Employee Payslips, upon clicking on Compute, it says 'wrong Python code defined for City Compensatory Allowance'

Can anyone please help me?

result = -1 if (contract.wage <= 9440): result=200 elif (contract.wage >= 9441 and contract.wage <=13540 ): result=250 elif (contract.wage >= 13541 and contract.wage <= 16980 ): result=300 else: result=350


Jagdish Panchal

--Jagdish Panchal--

| 5 4 6
Gandhinagar, India
--Jagdish Panchal--

OpenERP Developer

Jagdish Panchal
On 5/13/14, 4:27 AM


Try this will help you

result = (200 if contract.wage <= 9440 else 350 if ((contract.wage >= 9441) and (contract.wage <=13540) ) 250 else 350 if ((contract.wage >= 13541) and (contract.wage <= 16980)) 300 else 350)

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.


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

0 follower(s)


Asked: 5/13/14, 3:36 AM
Seen: 1228 times
Last updated: 3/16/15, 8:10 AM