Repository
OCA/hr · module folder · Try on Runboat
Module version
1.0.0
Category
Generic Modules/Human Resources
Folder size
0.16 MB
License
AGPL-3
Application
No
Auto-installable
No
Website
https://www.savoirfairelinux.com
Last tracking update
2026-08-07 07:17:51
Authors
Savoir-faire Linux, Odoo Community Association (OCA)
Maintainers
Savoir-faire Linux, Odoo Community Association (OCA)
Committers
Pedro M. Baeza, Stéphane Bidoul (ACSONE), Iryna Vushnevska
Odoo dependencies
Python dependencies
None
System dependencies
None
Required by
None
Description

Code Analysis

Views touched (9)
XML IDNameModelTypeStatus
hr_contract_view_form hr.contract.view.form hr.contract form Inherits hr_contract.hr_contract_view_form
hr_employee_benefit_category_form hr.employee.benefit.category.form hr.employee.benefit.category form New
hr_employee_benefit_category_list hr.employee.benefit.category.tree hr.employee.benefit.category tree New
hr_employee_benefit_rate_form hr.employee.benefit.rate.form hr.employee.benefit.rate form New
hr_employee_benefit_rate_list hr.employee.benefit.rate.tree hr.employee.benefit.rate tree New
hr_salary_rule_form hr.salary.rule.view.form hr.salary.rule form Inherits hr_payroll.hr_salary_rule_form
view_hr_employee_benefit_category_filter hr.employee.benefit.category.select hr.employee.benefit.category search New
view_hr_employee_benefit_rate_filter hr.employee.benefit.rate.select hr.employee.benefit.rate search New
view_hr_payslip_form hr.payslip.form hr.payslip form Inherits hr_payroll.view_hr_payslip_form
HTTP endpoints (0)

No HTTP endpoints found for this module.

Models touched (8)

New fields (1)
  • benefit_line_ids One2many → hr.employee.benefit
    args: 'hr.employee.benefit', 'contract_id', 'Employee Benefits'
Public methods (0)

No public methods.

New fields (9)
  • amount_type Selection
    readonly=True related='rate_id.amount_type' string='Amount Type' args: get_amount_types
  • category_id Many2one → hr.employee.benefit.category
    index=True ondelete='cascade' required=True args: 'hr.employee.benefit.category', 'Benefit'
  • code Char
    related='category_id.code' string='Code'
  • contract_id Many2one → hr.contract
    index=True ondelete='cascade' args: 'hr.contract', 'Contract'
  • date_end Date
    args: 'End Date'
  • date_start Date
    default=fields.Date.context_today required=True args: 'Start Date'
  • employee_amount Float
    readonly=True related='rate_id.employee_amount' string='Employee Amount'
  • employer_amount Float
    readonly=True related='rate_id.employer_amount' string='Employer Amount'
  • rate_id Many2one → hr.employee.benefit.rate
    required=True args: 'hr.employee.benefit.rate', 'Rate'
Public methods (1)
  • compute_amounts(self, payslip)
    @api.one

New fields (7)
  • active Boolean
    default=True args: 'active'
  • code Char
    help='The code that can be used in the salary rules to identify the benefit' args: 'Code'
  • description Text
    help='Brief explanation of which benefits the category contains.' args: 'Description'
  • name Char
    required=True args: 'Benefit Name'
  • rate_ids One2many → hr.employee.benefit.rate
    string='Benefit Rates' args: 'hr.employee.benefit.rate', 'category_id'
  • reference Char
    help='Field used to enter an external identifier for a benefit category. Example, pension plans may have a registration number.' args: 'Reference'
  • salary_rule_ids Many2many → hr.salary.rule
    args: 'hr.salary.rule', 'salary_rule_employee_benefit_rel', 'benefit_id', 'salary_rule_id', 'Salary Rules'
Public methods (0)

No public methods.

New fields (6)
  • amount_type Selection
    default='each_pay' required=True string='Amount Type' args: get_amount_types
  • category_id Many2one → hr.employee.benefit.category
    required=True args: 'hr.employee.benefit.category', 'Benefit Category'
  • employee_amount Float
    compute='_get_amounts_now' readonly=True string='Employee Contribution'
  • employer_amount Float
    compute='_get_amounts_now' readonly=True string='Employer Contribution'
  • line_ids One2many → hr.employee.benefit.rate.line
    args: 'hr.employee.benefit.rate.line', 'parent_id', 'Rates'
  • name Char
    required=True args: 'Name'
Public methods (3)
  • compute_amounts(self, payslip)
    @api.multi
    Compute benefit lines
  • get_all_amount_types(self)
    @api.model
    Get the list of amount types for employee benefits This method is not called directly so that it can be inherited easily in other modules. When inheriting this method, the list of selections is updated in every related models.
  • get_amount(self, date, employer=False)
    @api.multi

New fields (7)
  • amount_type Selection
    readonly=True related='parent_id.amount_type' string='Amount Type' args: get_amount_types
  • category_id Many2one → hr.employee.benefit.category
    readonly=True related='parent_id.category_id' string='Category' args: 'hr.employee.benefit.category'
  • date_end Date
    args: 'End Date'
  • date_start Date
    default=fields.Date.context_today required=True args: 'Start Date'
  • employee_amount Float
    digits_compute=dp.get_precision('Payroll') required=True args: 'Employee Amount'
  • employer_amount Float
    digits_compute=dp.get_precision('Payroll') required=True args: 'Employer Amount'
  • parent_id Many2one → hr.employee.benefit.rate
    ondelete='cascade' required=True args: 'hr.employee.benefit.rate', 'Parent'
Public methods (0)

No public methods.

New fields (2)
  • benefit_line_ids One2many → hr.payslip.benefit.line
    readonly=True states={'draft': [('readonly', False)]} args: 'hr.payslip.benefit.line', 'payslip_id', 'Employee Benefits'
  • pays_per_year Integer
    compute='_get_pays_per_year' help='Field required to compute benefits based on an annual amount.' readonly=True store=True string='Number of pays per year'
Public methods (2)
  • button_compute_benefits(self)
    @api.multi
  • compute_benefits(self)
    @api.one
    Compute the employee benefits on the payslip. This method can be called from inside a salary rule. Exemple ------- payslip.compute_benefits() This is required when the benefits are based on the value of one or more salary rules. The module hr_employee_benefit_percent implements that functionnality.

New fields (6)
  • category_id Many2one → hr.employee.benefit.category
    required=True args: 'hr.employee.benefit.category', 'Benefit'
  • employee_amount Float
    digits_compute=dp.get_precision('Payroll') args: 'Employee Contribution'
  • employer_amount Float
    digits_compute=dp.get_precision('Payroll') args: 'Employer Contribution'
  • payslip_id Many2one → hr.payslip
    ondelete='cascade' required=True args: 'hr.payslip', 'Payslip'
  • reference Char
    args: 'Reference'
  • source Selection
    default='manual' readonly=True required=True string='Type' type='char' args: [('contract', 'From Contract'), ('manual', 'Added Manually')]
Public methods (0)

No public methods.

New fields (1)
  • employee_benefit_ids Many2many → hr.employee.benefit.category
    args: 'hr.employee.benefit.category', 'salary_rule_employee_benefit_rel', 'salary_rule_id', 'benefit_id', 'Salary Rules'
Public methods (1)
  • sum_benefits(self, payslip, **kwargs)
    @api.multi
    Method used to sum the employee benefits computed on the payslip Because there are many possible parameters and that the module needs to be inherited easily, arguments are passed through kwargs :param codes: The type of benefit over which to sum :type codes: list of string or single string :param employer: If True, sum over the employer contribution. If False, sum over the employee contribution Exemple ------- payslip.compute_benefits(payslip, employer=True) Will return the employer contribution for the pay period

Loading…

Loading…

Loading…