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

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

By
Ninad Dike
on 5/13/14, 3:36 AM 825 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

0

Jagdish Panchal

--Jagdish Panchal--
2674
| 5 3 6
Gandhinagar, India
--Jagdish Panchal--

OpenERP Developer

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

Hi

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)

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

0 follower(s)

Stats

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