跳至內容
選單
此問題已被標幟
2 回覆
1905 瀏覽次數

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'


頭像
捨棄
作者 最佳答案

Found this solution working:


if not inputs.ADVANCE_SALARY:
    result = 0
else:
    result = -inputs.ADVANCE_SALARY.amount
頭像
捨棄
最佳答案

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

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
2
3月 24
1691
0
3月 24
1407
0
5月 23
1778
2
3月 15
3930
0
5月 23
3707