Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
2 Ответы
1890 Представления

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
1681
0
мар. 24
1402
0
мая 23
1768
2
мар. 15
3924
0
мая 23
3683