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

conditional payroll tax deduction

By
Anchal
on 3/21/16, 9:37 AM 396 views

what I want : if an employee is a Male then his deduction tax will be 600

and  if an employee is a Female then his deduction tax will be 400

I tried in Payroll >> Salary Rules >> deduction tax

by using this code in 

Computation: 

if (hr.employee.gender== "male"):
 result = ((categories.BASIC + categories.ALW) -500)

else if (hr.employee.merital== "married"):
 result =((categories.BASIC + categories.ALW) -400)
I didn't get computation, I dont know how to fix it 

can anybody please help me.


1

Ahmed M.Elmubarak

--Ahmed M.Elmubarak--
2988
| 5 3 5
Sudan
--Ahmed M.Elmubarak--


Ahmed M.Elmubarak
On 3/21/16, 10:05 AM

Hi,

Try this

if (employee.gender == 'male'):
     result = ((categories.BASIC + categories.ALW) -500)
elif (employee.marital == 'married'):
     result = ((categories.BASIC + categories.ALW) -400)


The " else if " will checks if the employee not a male and if is married (not male and married) [I just wrote it as yours]

Hope it'll work

0
Anchal
On 3/21/16, 2:20 PM

sorry for reply here because of my carma.

Thank you for your reply.....
I tried by your code but... it shows me Error: 

Wrong python code defined for salary rule Federal Tax (FT).

Hi, I just copy&paste the code below and it works with me ... can you paste your code , maybe you missed something ...

Ahmed M.Elmubarak
on 3/22/16, 3:07 AM

it works ... thx a lot

Anchal
on 3/22/16, 8:46 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: 3/21/16, 9:37 AM
Seen: 396 times
Last updated: 3/22/16, 8:46 AM