Skip to Content
Menu
This question has been flagged
1 Reply
1897 Views

I am facing wrong python code defined for total deduction while doing the salary rules, can someone help me?

Avatar
Discard

It's necessary for you to give more details of what you want to do and what you've tried. Can you give examples?

Author
Example: the total deduction is calculated as Gross taxable income + Pension contribution(7%)

and this is the codinge that I tried

# Available variables:
#----------------------
# payslip:object containing the payslips
# employee: hr.employee object
# contract: hr.contract object
# rules: object containing the rules code (previously computed)
# categories: object containing the computed salary rule categories (sum of amount of all rules belonging to that category).
# worked_days: object containing the computed worked days.
# inputs: object containing the computed inputs.
# Note: returned value have to be set in the variable

'result' result = categories.GTI + categories.PC

and its not working

On Fri, May 28, 2021 at 9:07 AM Josep Anton Belchi Riera <josepanton.belchi@midgard.cat> wrote:

It's necessary for you to give more details of what you want to do and what you've tried. Can you give examples?

Enviado por Odoo S.A. usando Odoo.

Best Answer

Dear Hanna Hailu,

First you need to create Gross taxable income and Pension contribution(7%) salary rule and the the sequence number will be for example 1 and 2

After that you need to create a salary rule for the total deduction and the sequence will be 3 other wise this will not work. So the sequence numbering is important.

Avatar
Discard