Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
2 Antwoorden
1213 Weergaven

how to refer the result a rule in the result of another rule e.g.


result = contract.wage + rules.SPECIAL_ALLOWANCE

I can see the result of the rule SPECIAL_ALLOWANCE in the salary computation but cannot pick it / add it in the result of another rule

----------------------------------------

Whats the correct sntax for refering another rule having code SPECIAL_ALLOWANCE


'rules.SPECIAL_ALLOWANCE'


Avatar
Annuleer
Auteur Beste antwoord

Found this solution working:


if not inputs.ADVANCE_SALARY:
    result = 0
else:
    result = -inputs.ADVANCE_SALARY.amount
Avatar
Annuleer
Beste antwoord

Hi,
This behavior is a little counter-intuitive. To get the computed value of a rule you have to reference it directly by code:
result = contract.wage + SPECIAL_ALLOWANCE

For more details, refer to the blog:


https://www.cybrosys.com/blog/how-to-configure-salary-structures-and-salary-rules-in-odoo-16-payroll

Hope it helps

Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
2
mrt. 24
842
0
mrt. 24
662
0
mei 23
1167
2
mrt. 15
3326
0
mei 23
2801