- In basic salary rule, I need to access total wage in employee contract:
- I used contract.wage but it gives error as name object is not defined.
- I need to access the total unpaid days in payslip object
Hello,
Yes, this can be achieved within Payroll Rule Python code.
For contract salary, contract.wage should generally be available if the contract object is present in the salary rule context. If it throws name 'contract' is not defined, try accessing it through the payslip object:
payslip.contract_id.wage
For unpaid leave days, you can usually retrieve them from worked days lines, for example:
worked_days.UNPAID.number_of_days
(Replace UNPAID with the actual code configured for your unpaid leave/work entry type.)
Please verify the work entry code in your payroll configuration because it may differ in your setup.
Hope this works for you! If you need any help implementing this or want a more optimized approach, feel free to reach out for further discussion.
Regards,
Zehntech Technologies Inc.
Hello
It is changed to hr.version in earlier Odoo version.
You can write small piece of code anywhere to print the current object's attribute lists.
Like this: version._fields.keys()
Create an account today to enjoy exclusive features and engage with our awesome community!
Registrar-se| Related Posts | Respostes | Vistes | Activitat | |
|---|---|---|---|---|
|
1
de maig 26
|
543 | |||
|
1
de maig 26
|
657 | |||
|
1
d’abr. 23
|
7700 | |||
|
0
de juny 21
|
3561 | |||
|
1
de març 17
|
10348 |
1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.