TIP: You can type at any time to perform a new search.
Salary Rule Variables
hr_salary_rule_variable · OCA/hr
Security findings
Migration considerations
- Imports from the old `openerp.osv` namespace: renamed to `odoo` since Odoo 10.0. migration-openerp-import · source
- Imports from the old `openerp.osv` namespace: renamed to `odoo` since Odoo 10.0. migration-openerp-import · source
- Imports from the old `openerp.tools.safe_eval` namespace: renamed to `odoo` since Odoo 10.0. migration-openerp-import · source
- Imports from the old `openerp.tools.translate` namespace: renamed to `odoo` since Odoo 10.0. migration-openerp-import · source
- Imports from the old `openerp.osv` namespace: renamed to `odoo` since Odoo 10.0. migration-openerp-import · source
hr_payslip— Class 'hr_payslip' still inherits from the old-style `orm.Model` API: rewrite it against `models.Model`/`models.TransientModel`/`models.AbstractModel` - the old `osv`/`orm` API was removed entirely in modern Odoo. migration-old-api-base · sourcehr_salary_rule— Class 'hr_salary_rule' still inherits from the old-style `orm.Model` API: rewrite it against `models.Model`/`models.TransientModel`/`models.AbstractModel` - the old `osv`/`orm` API was removed entirely in modern Odoo. migration-old-api-base · sourcehr_salary_rule— Class 'hr_salary_rule' declares `_columns` as a plain dict: old-style field/default declarations, replace with `fields.X(...)` class attributes and `default=`. migration-old-style-fields · sourcehr_salary_rule_variable— Class 'hr_salary_rule_variable' still inherits from the old-style `orm.Model` API: rewrite it against `models.Model`/`models.TransientModel`/`models.AbstractModel` - the old `osv`/`orm` API was removed entirely in modern Odoo. migration-old-api-base · sourcehr_salary_rule_variable— Class 'hr_salary_rule_variable' declares `_columns` as a plain dict: old-style field/default declarations, replace with `fields.X(...)` class attributes and `default=`. migration-old-style-fields · sourcehr_salary_rule_variable_form— For a target of Odoo 17.0+: view 'hr_salary_rule_variable_form' uses `attrs=`/`states=`, which are no longer supported. Convert modifiers to direct Python boolean expressions in `invisible`/`readonly`/`required`; preserve the original AND/OR logic. migration-view-attrs-states · sourcehr_salary_rule_variable_list— View 'hr_salary_rule_variable_list' is defined with a `<tree>` root tag: renamed to `<list>` in Odoo 18.0. migration-view-tree-tag · source
Migration review checklist, not a compatibility verdict. No target version is selected: apply version-specific advice only when migrating to that version or later.
- Repository
- OCA/hr · module folder · Try on Runboat
- Module version
- 1.0
- Category
- Generic Modules/Human Resources
- Folder size
- 0.03 MB
- License
- AGPL-3
- Application
- No
- Auto-installable
- No
- Website
- https://www.savoirfairelinux.com
- Last tracking update
- 2026-08-07 07:17:50
- 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
Salary Rule Variables ===================== Salary rule variables are amounts or python expressions that change over the years. This module allows to compute these variables and reference them from salary rules. The purpose of this module is to be able to adapt a complexe salary structures (e.g. the canadian income tax structure) from one year to another without going each time through the whole testing procedure. Numbers change but the whole logic stays the same. How to use it ------------- In the python script of a salary rule, you may call it via the payslip browsable object: variable = payslip.get_rule_variable(rule_id, payslip.date_from) rule_id always refer to the current rule. If you need more than one variable for a salary rule, use a python dict. Contributors ------------ * David Dufresne <david.dufresne@savoirfairelinux.com> * Pierre Lamarche <pierre.lamarche@savoirfairelinux.com>
Code Analysis
Views touched (3)
| XML ID | Name | Model | Type | Status |
|---|---|---|---|---|
hr_salary_rule_variable_form |
hr.salary.rule.variable.form | hr.salary.rule.variable | form | New |
hr_salary_rule_variable_list |
hr.salary.rule.variable.tree | hr.salary.rule.variable | tree | New |
view_hr_salary_rule_variable_filter |
hr.salary.rule.variable.select | hr.salary.rule.variable | search | New |
HTTP endpoints (0)
No HTTP endpoints found for this module.
Models touched (3)
New fields (0)
No new fields.
Public methods (1)-
get_rule_variable(self, cr, uid, ids, rule_id, date, localdict=False, context=None)Gets a salary rule variable related to a salary rule for a period of time This method is called from the salary rule: payslip.get_rule_variable(rule_id, payslip.date_from) By using the optional argument localdict, you can pass the value of salary rule already computed. Example: payslip.get_rule_variable(rule_id, payslip.date_from, GROSS) returns: fixed amount (a float) or a python object (most likely a dict)
New fields (0)
No new fields.
Public methods (1)-
compute_rule(self, cr, uid, rule_id, localdict, context=None)
New fields (0)
No new fields.
Public methods (0)No public methods.
Loading…
Loading…
Loading…