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 calculation?

By
Adam McGill
on 11/5/13, 7:04 PM 1,448 views

I have a field in payroll where overtime can be entered into worked_days.number_of_hours. The entry is to field worked_days.OVERTIME.number_of_hours

I then have another field (Overtime Value) which uses python to value this overtime with the formula hourly_wage * worked_days.OVERTIME.number_of_hours

However, where a person does not work overtime there is no entry in worked_days.OVERTIME.number_of_days and the field for Overtime Value errors out.

How can I put a condition into the Overtime Value field that says to ignore this calculation if the user has not placed a value in worked_days.OVERTIME.number_of_hours?

Many thanks for your assistance.

0
omar bajunaid
On 6/15/14, 10:00 AM

in salary rule python condition input the following;

result = worked_days.OVERTIME and worked_days.OVERTIME.number_of_hours or False

also try

result = worked_days.OVERTIME and worked_days.OVERTIME.number_of_days or False

hope this helps 

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: 11/5/13, 7:04 PM
Seen: 1448 times
Last updated: 3/16/15, 8:10 AM