Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
1999 มุมมอง

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

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
2
มี.ค. 24
1871
0
มี.ค. 24
1490
0
พ.ค. 23
1877
Help with salary rule แก้ไขแล้ว
2
มี.ค. 15
4019
0
พ.ค. 23
3834