Skip to Content
Menu
This question has been flagged
1 Reply
2942 Views

I am trying to write a salary rule with a condition so that if the condition is not satisfied system skips that salary rule. but whenever I am putting the condition it gives "Odoo Warning - Validation Error Wrong python condition defined for salary rule". I am sure the format I am using is correct. See below. 

result = if(contract.state != 'Draft' and contract.start_date > payslip.date_from): or false
Avatar
Discard

Please use a meaningful title.

Best Answer

Hi,

You can try something like this,

result = contract.wage  if contract.state != 'draft' and 
contract.date_start > payslip.date_from else False


Adjust the code as per your logic.


Thanks

Avatar
Discard