Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
In HR Payroll module...I just want to avoid scheduling process for working days calculation..rather calculate it manually.
Ex. I have created 2 nos. field (float) "Calendar Days" (x_cd) and "Working Days" (x_wd) in "Worked Days" lines in "Employee Payslip". Now I want to calculate it in the Salary Rules ex. HRA result = contract.wage x 0.200 x "Working Days" / "Calendar Days" i.e. if calendar days = 31 and after deducting 1 unpaid leave i.e. working days = 30, then the HRA will be calculated on 30 days basis.
Please help me to input the python code in HRA result or what will be the Quantity field code if we calculate on basis percentage.
Please note that I am working on v6.1
datej = str(payslip.date_to)
datek = str(payslip.date_from)
dj = datej[-2:]
new = 0
if str(x) == dj or "0"+str(x) == dj:
dk = datek[-2:]
old = 0
if str(y) == dk or "0"+str(y) == dk:
no_of_days = new-old + 1
result = no_of_days
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 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
|Asked: 7/18/13, 3:52 AM|
|Seen: 6002 times|
|Last updated: 3/10/16, 7:36 AM|