This question has been flagged
1 Reply
9506 Views

I want to set a python code in 'Condition based on' field so that this particular rule will not be shown or printed with payslip when result is false. The condition I want to check is the existence of an inputs line with code as LOAN. something like

result = exist(inputs.LOAN)

That's a half pseudo code above. What's the exact python syntax in OpenERP to achieve this?

Thanks :)

Avatar
Discard

what is LOAN is it a boolean field ?

Author

No. I created a Salary Rule called LOAN and a Salary Structure containing this specific rule. An employee contract is with this Salary Structure and when generating payslip, I do not want to show this specific rule in PaySlip if an Input item with code LOAN doesn't exist.

Best Answer

iN THE PYTHON CONDITION EXPRESSION ADD THE FOLLOWING;

result = (inputs.LOAN.amount  and inputs.LOAN)  or False

Avatar
Discard

result = (inputs and inputs.LOAN and inputs.LOAN.amount) or False