Human Resource in Odoo 10 - Part 4: Payroll

Payroll, Salary, Salary Structure, Salary Rules

Hieu Le



As I checked, there is no difference in Payroll app between Odoo 8, 9 and 10. So I will take examples using Odoo 10 Enterprise. Let’s first learn about some basic concepts. Read more: Odoo Doc HR Payroll.


* Salary Rules (menu Payroll > Configuration > Salary Structures)

They are used to compute data like allowances, deductions, net, taxes, contribution registers, etc. For example, the NET rule to calculate the NET salary.

  • Name: a Salary Rule name.

  • Code : a Salary Rule code. It must be unique.

  • Category : a Salary Rule Category.

  • Sequence : it plays a major role in the calculation and appearance of payslip lines. For example, a sequence defined on a rule calculating the Gross should always be greater than the sequence given on Allowance rules, otherwise it will NOT be considered in the calculation of Gross value. It is like a waterfall: Basic (1) → Allowance (10) → Gross (100) → Deduction (150) → Net (200).

  • Active : if unticked, it will allow you to hide the Salary Rule in the system without removing it.

  • Appears on Payslip : If unticked, it will not appear on the Payslip but will still be considered in the computation.

  • Always True: the rule will always be considered in the Payslip computation:

Tab General:
  • Condition Based on: the condition to take a rule into account.

    • Always True: the rule will always be considered in the Payslip computation:

  • Range: the rule will be considered if it falls under a particular range. For example, the Wage on Employee Contract is between 3000 and 4000. There are some available variables that will be shown when I select Condition Based on Python Expression:

  • Python Expression:

# Available variables can be used in field Python Condition and Python Code. These are advanced use cases that require technical knowledge.


# 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 (tab Worked Days & Inputs on Payslip form)

# inputs: object containing the computed inputs (tab Worked Days & Inputs on Payslip form)

# Note: returned value have to be set in the variable 'result' (field Python Code) result = rules.NET > categories.NET * 0.10

  • Amount Type: the computation type for the rule amount. There are three types:

    • Fixed Amount: for example, a rule for Meal Voucher having fixed amount of 10 EUR per worked day can have its quantity defined as below, which will be multiplied with the amount:

  • Percentage: for example, if I want to give 5% of wages for Provident Fund then I defined the rule as below, and with a negative amount because rule Provident Fund is under category Deduction:

  • Python Code: for example, Net salary = Basic + Allowance - Deduction. In the formula, you see + Deduction because its amount is negative. And it sums amount of all rules belonging to that category:

Tab Child Rules: it is used to create hierarchy for reporting purpose:


Tab Accounting: it is used to select Accounts for Accounting Data generated later on. All the rules will have their individual accounts created as Debit accounts and the Salary expense account as Credit account.


Tab Inputs: it is used when you want to provide some Inputs. It is related to tab Worked Days & Inputs on Employee Payslip:


* Salary Rule Categories (menu Payroll > Configuration > Salary Rule Categories)

I define many Salary Rules, then I classify them with different categories:

Please note that for Deduction category, the amount of money input in Salary Rules must be negative. For Allowance category, it must be positive.


One category can belong to another one. That is why I have menu Salary Rule Categories Hierarchy:

* Salary Structure (menu Payroll > Configuration > Salary Structures)

I define a Salary Structure with Salary Rules I want. The Reference must be unique.

I also can inherit (extend) a Salary Structure by selecting Parent field.



I define simple rules to pay salary for Sales Manager position as below. This is just a very simple example in my head. I do not think it reflects cases in reality. Every nation has their rules for salary computation (Income Tax, Social Security Contribution, Health Insurance ...), you know it is always complicated. I will also skip the Payroll Accounting in this article because I need to gain more knowledge in Accounting, and discuss with other people before writing something down. Basically, you can see how Payroll app works in Odoo with my example.

  • Based on his contract, he will receive salary monthly.

  • Working Schedule: 40 hours / week from Mondays to Fridays.

  • Monthly wage on contract (before Tax): 4000 EUR / month

  • Allowances:

    • Meals: 10 EUR / meal / worked day

    • Mobile: fixed amount 30 EUR / month

    • Manager: fixed amount 100 EUR / month

    • Sales Commission: 1% of sales during the month

  • Deduction:

    • Team Building Fund: 2% of monthly wage

    • Personal Income Tax: 20% of monthly wage

    • Unpaid Leaves

  • Net Salary: basic wage + allowances - deductions - unpaid leaves


Step 1: go to menu Payroll > Configuration > Salary Structures, define a new Salary Structure ‘Sales Manager’ based on the ‘Base for new structures’:

  • Salary Structure ‘Base for new structures’:

Rule ‘Basic’:

Rule ‘Gross’:

Rule ‘Net’:

  • Salary Structure ‘Sales Manager’:


Rule ‘Meal Voucher’:


Rule ‘Get 1% of Sales’ (in EURO and ASIA market):


Rule ‘Mobile’:


Rule ‘Manager’:


Rule ‘Personal Income Tax’:


Rule ‘Team Building Fund’:


Rule ‘Unpaid Leaves’:


Step 2: go to menu Employees > Contracts, create a contract for employee David Samson, select duration, working schedule, scheduled pay, wage, salary structure, work permit (Visa Number, Visa Expiry Date, Work Permit Number) …


Step 3: by the end of every month, generate a Payslip for employee

In September 2016, David sold 40000 in Euro market and 30000 in Asia market. He took 2 days off (Unpaid Type).


In the end, his Payslip is:

I click COMPUTE SHEET and check the computation on tab Salary Computation before CONFIRM it.


I also can print out the Payslip report.

That is how Odoo HR Payroll works from my understanding. I think the system is very flexible and easy to configure more complicated salary computation rules for specific scenarios. My seriers about Odoo Human Resource ends here. One more time, I have to say I love ERP, I love Odoo for all benefits it brought to business organizations.  :)