Odoo Help


HR Payroll salry calculation based on inputs field

Atul Kumar jain
on 8/12/15, 2:03 PM 1,278 views

Hello ,

I am calculating salry based on  this rule but can someone tell me whats wrong with this code

        result = ((float("{0:.2f}".format(contract.wage/(inputs.MD and inputs.MD.amount)))*(inputs.TD and inputs.TD.amount))+    (float("  {0:.2f}".format(contract.wage/(inputs.MD and inputs.MD.amount)/8)*(inputs.OT and inputs.OT.amount)*1.25)))

even this code is working without using float

    result = ((contract.wage/(inputs.MD and inputs.MD.amount))*(inputs.TD and inputs.TD.amount))+((contract.wage/(inputs.MD and #inputs.MD.amount)/8.0)*(inputs.OT and #inputs.OT.amount)*1.25)

but there is differences in output  , i want to use first one

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

1 follower(s)


Asked: 8/12/15, 2:03 PM
Seen: 1278 times
Last updated: 8/16/15, 12:31 AM