30 lines
944 B
Plaintext
30 lines
944 B
Plaintext
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||
|
|
||
|
from odoo import models
|
||
|
|
||
|
|
||
|
class HrPayslip(models.Model):
|
||
|
_inherit = 'hr.payslip'
|
||
|
|
||
|
def _get_data_files_to_update(self):
|
||
|
# Note: file order should be maintained
|
||
|
return super()._get_data_files_to_update() + [(
|
||
|
'l10n_{{code}}_hr_payroll', [
|
||
|
'data/hr_salary_rule_category_data.xml',
|
||
|
'data/hr_payroll_structure_type_data.xml',
|
||
|
'data/hr_payroll_structure_data.xml',
|
||
|
'data/hr_rule_parameters_data.xml',
|
||
|
'data/hr_salary_rule_data.xml',
|
||
|
])]
|
||
|
|
||
|
def _get_base_local_dict(self):
|
||
|
res = super()._get_base_local_dict()
|
||
|
res.update({
|
||
|
'compute_some_property': compute_some_property,
|
||
|
})
|
||
|
return res
|
||
|
|
||
|
def compute_some_property(payslip, parameter):
|
||
|
gross = payslip.result_rules.GROSS
|
||
|
return gross * parameter
|