Odoo Help

0

0
3 Answers
1
Mr.V
29/03/19, 01:26

I think this code Will help you solve the Problem that you are facing while calculating with Unpaid or with out Unpaid For Payslip.

if not worked_days.Unpaid:
    result=contract.basic
else:
    result=(worked_days.WORK100.number_of_days-worked_days.Unpaid.number_of_days) * (contract.basic / worked_days.WORK100.number_of_days)

0
Prasath
29/03/19, 00:49

@subbarao Checked using your rule but same error "Wrong python code defined for salary rule Basic Salary (BASIC)."

0
Avatar

subbarao

--subbarao--

1269
| 5 2 8
Chennai, India
--subbarao--


subbarao
29/03/19, 00:17

Try this one

result = if (worked_days.Unpaid.number_of_days):  ( (worked_days.WORK100.number_of_days-worked_days.Unpaid.number_of_days) * (contract.basic / worked_days.WORK100.number_of_days)) 
else: (contract.basic)

or 


result = if (worked_days.Unpaid.number_of_days) > 0: ((worked_days.WORK100.number_of_days-worked_days.Unpaid.number_of_days) * (contract.basic / worked_days.WORK100.number_of_days)) 
else: (contract.basic)

Ask a Question
Writer
Keep Informed
1 follower(s)
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 eLearning platform and experience all Odoo Apps through learning videos, use cases and quizzes.

Test it now