Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
2 Antworten
1952 Ansichten

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
Verwerfen
Autor Beste Antwort

Found this solution working:


if not inputs.ADVANCE_SALARY:
    result = 0
else:
    result = -inputs.ADVANCE_SALARY.amount
Avatar
Verwerfen
Beste Antwort

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
Verwerfen
Verknüpfte Beiträge Antworten Ansichten Aktivität
2
März 24
1781
0
März 24
1432
0
Mai 23
1814
2
März 15
3973
0
Mai 23
3766