Odoo HR Payslip

Source: Internet
Author: User

Pay slip can be entered into multiple worked_days_line and input_line, used to manually adjust the salary changes, such as sales commission, debit and so on. Pay slip can contain multiple pay slip line used to store Hr.salary.rule computed results.

??

??

Hr.salary.rule defines the payroll rules

??

When calculating the wage rules, the context parameters stored in the Localdict dictionary are used

{' Categories ': categories_obj, ' rules ': rules_obj, ' payslip ': payslip_obj, ' worked_days ': worked_days_obj, ' inputs ': Input_obj, ' employee ': employee_id, ' contract ': contract}

That is, these 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.

??

Method Compute_rule () calculates the salary rules, returns amount, qty, rate, and the three are the salaries defined by the rule, the results of which are grouped together to form the total salary, and the combination of these rules is the salary structure.

??

There are three types of calculations

    • Fix
    • Percentage
    • Python Code

??

If it is fix, the formula saved by the field quantity is executed using Python eval to get the result qty

method Compute_rule () returns the result as Fixed_amount, qty, 100.0

For example:

Weekdays 10 per day

??

If it is percentage, the formula Amount_percentage_base saved by the field is executed using Python eval, resulting in the result percentage_base

method Compute_rule () returns the result as percentage_base, qty, percentage

For example:

12.5% Deduction of Wages

??

In the case of Python code calculations, the Python eval is used to execute the field Amount_python_compute, which is the Python code saved formula, resulting in result = XXX

The format of Python code must be result =

method Compute_rule () returns the result as result, result_qty or 1.0, result_rate or 100.0

??

??

For example:

Calculate a business commission using inputs data

??

And

Call the Payroll Rule Classification and add

??

Odoo HR Payslip

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.