diff --git a/hr_payroll_account_community/__manifest__.py b/hr_payroll_account_community/__manifest__.py index ffbac6266..625aeb34e 100644 --- a/hr_payroll_account_community/__manifest__.py +++ b/hr_payroll_account_community/__manifest__.py @@ -7,7 +7,7 @@ Generic Payroll system Integrated with Accounting,Expense Encoding,Payment Encoding,Company Contribution Management """, 'description': """Odoo13 Payroll Accounting,Odoo13 Payroll,Odoo 13,Payroll Accounting,Accounting""", - 'version': '13.0.1.0.0', + 'version': '13.0.1.0.1', 'author': 'Odoo SA,Cybrosys Techno Solutions', 'company': 'Cybrosys Techno Solutions', 'maintainer': 'Cybrosys Techno Solutions', diff --git a/hr_payroll_account_community/models/hr_payroll_account.py b/hr_payroll_account_community/models/hr_payroll_account.py index cb9b46045..1bce2a730 100644 --- a/hr_payroll_account_community/models/hr_payroll_account.py +++ b/hr_payroll_account_community/models/hr_payroll_account.py @@ -43,14 +43,12 @@ class HrPayslip(models.Model): super(HrPayslip, self).onchange_contract() self.journal_id = self.contract_id.journal_id.id or (not self.contract_id and self.default_get(['journal_id'])['journal_id']) - @api.multi def action_payslip_cancel(self): moves = self.mapped('move_id') moves.filtered(lambda x: x.state == 'posted').button_cancel() moves.unlink() return super(HrPayslip, self).action_payslip_cancel() - @api.multi def action_payslip_done(self): res = super(HrPayslip, self).action_payslip_done() diff --git a/hr_payroll_account_community/wizard/hr_payroll_payslips_by_employees.py b/hr_payroll_account_community/wizard/hr_payroll_payslips_by_employees.py index 5ba0d6be5..54c1b1422 100644 --- a/hr_payroll_account_community/wizard/hr_payroll_payslips_by_employees.py +++ b/hr_payroll_account_community/wizard/hr_payroll_payslips_by_employees.py @@ -5,7 +5,6 @@ from odoo import api, models class HrPayslipEmployees(models.TransientModel): _inherit = 'hr.payslip.employees' - @api.multi def compute_sheet(self): journal_id = False if self.env.context.get('active_id'): diff --git a/hr_payroll_community/__manifest__.py b/hr_payroll_community/__manifest__.py index 12e29b7d9..8b328e4a2 100644 --- a/hr_payroll_community/__manifest__.py +++ b/hr_payroll_community/__manifest__.py @@ -3,7 +3,7 @@ { 'name': 'Odoo13 Payroll', 'category': 'Generic Modules/Human Resources', - 'version': '13.0.1.0.0', + 'version': '13.0.1.0.1', 'author': 'Odoo SA,Cybrosys Techno Solutions', 'company': 'Cybrosys Techno Solutions', 'maintainer': 'Cybrosys Techno Solutions', diff --git a/hr_payroll_community/models/hr_contract.py b/hr_payroll_community/models/hr_contract.py index 47008e493..7cced5a8b 100644 --- a/hr_payroll_community/models/hr_contract.py +++ b/hr_payroll_community/models/hr_contract.py @@ -24,7 +24,6 @@ class HrContract(models.Model): help="Defines the frequency of the wage payment.") resource_calendar_id = fields.Many2one(required=True, help="Employee's working schedule.") - @api.multi def get_all_structures(self): """ @return: the structures linked to the given contracts, ordered by hierachy (parent=False first, @@ -36,11 +35,9 @@ class HrContract(models.Model): # YTI TODO return browse records return list(set(structures._get_parent_structure().ids)) - @api.multi def get_attribute(self, code, attribute): return self.env['hr.contract.advantage.template'].search([('code', '=', code)], limit=1)[attribute] - @api.multi def set_attribute_value(self, code, active): for contract in self: if active: diff --git a/hr_payroll_community/models/hr_employee.py b/hr_payroll_community/models/hr_employee.py index 1f792e730..9298ee1f0 100644 --- a/hr_payroll_community/models/hr_employee.py +++ b/hr_payroll_community/models/hr_employee.py @@ -10,7 +10,6 @@ class HrEmployee(models.Model): slip_ids = fields.One2many('hr.payslip', 'employee_id', string='Payslips', readonly=True) payslip_count = fields.Integer(compute='_compute_payslip_count', string='Payslip Count', groups="hr_payroll_community.group_hr_payroll_user") - @api.multi def _compute_payslip_count(self): for employee in self: employee.payslip_count = len(employee.slip_ids) diff --git a/hr_payroll_community/models/hr_payslip.py b/hr_payroll_community/models/hr_payslip.py index 21574a478..86b42c3c6 100644 --- a/hr_payroll_community/models/hr_payslip.py +++ b/hr_payroll_community/models/hr_payslip.py @@ -72,12 +72,10 @@ class HrPayslip(models.Model): copy=False, states={'draft': [('readonly', False)]}) payslip_count = fields.Integer(compute='_compute_payslip_count', string="Payslip Computation Details") - @api.multi def _compute_details_by_salary_rule_category(self): for payslip in self: payslip.details_by_salary_rule_category = payslip.mapped('line_ids').filtered(lambda line: line.category_id) - @api.multi def _compute_payslip_count(self): for payslip in self: payslip.payslip_count = len(payslip.line_ids) @@ -87,22 +85,18 @@ class HrPayslip(models.Model): if any(self.filtered(lambda payslip: payslip.date_from > payslip.date_to)): raise ValidationError(_("Payslip 'Date From' must be earlier 'Date To'.")) - @api.multi def action_payslip_draft(self): return self.write({'state': 'draft'}) - @api.multi def action_payslip_done(self): self.compute_sheet() return self.write({'state': 'done'}) - @api.multi def action_payslip_cancel(self): if self.filtered(lambda slip: slip.state == 'done'): raise UserError(_("Cannot cancel a payslip that is done.")) return self.write({'state': 'cancel'}) - @api.multi def refund_sheet(self): for payslip in self: copied_payslip = payslip.copy({'credit_note': True, 'name': _('Refund: ') + payslip.name}) @@ -123,11 +117,9 @@ class HrPayslip(models.Model): 'context': {} } - @api.multi def check_done(self): return True - @api.multi def unlink(self): if any(self.filtered(lambda payslip: payslip.state not in ('draft', 'cancel'))): raise UserError(_('You cannot delete a payslip which is not draft or cancelled!')) @@ -151,7 +143,6 @@ class HrPayslip(models.Model): clause_final = [('employee_id', '=', employee.id), ('state', '=', 'open'), '|', '|'] + clause_1 + clause_2 + clause_3 return self.env['hr.contract'].search(clause_final).ids - @api.multi def compute_sheet(self): for payslip in self: number = payslip.number or self.env['ir.sequence'].next_by_code('salary.slip') @@ -386,7 +377,6 @@ class HrPayslip(models.Model): # YTI TODO To rename. This method is not really an onchange, as it is not in any view # employee_id and contract_id could be browse records - @api.multi def onchange_employee_id(self, date_from, date_to, employee_id=False, contract_id=False): #defaults res = { @@ -585,11 +575,9 @@ class HrPayslipRun(models.Model): states={'draft': [('readonly', False)]}, help="If its checked, indicates that all payslips generated from here are refund payslips.") - @api.multi def draft_payslip_run(self): return self.write({'state': 'draft'}) - @api.multi def close_payslip_run(self): return self.write({'state': 'close'}) diff --git a/hr_payroll_community/models/hr_salary_rule.py b/hr_payroll_community/models/hr_salary_rule.py index 8b238c120..45abf09b5 100644 --- a/hr_payroll_community/models/hr_salary_rule.py +++ b/hr_payroll_community/models/hr_salary_rule.py @@ -34,14 +34,12 @@ class HrPayrollStructure(models.Model): if not self._check_recursion(): raise ValidationError(_('You cannot create a recursive salary structure.')) - @api.multi @api.returns('self', lambda value: value.id) def copy(self, default=None): self.ensure_one() default = dict(default or {}, code=_("%s (copy)") % (self.code)) return super(HrPayrollStructure, self).copy(default) - @api.multi def get_all_rules(self): """ @return: returns a list of tuple (id, sequence) of rules that are maybe to apply @@ -51,7 +49,6 @@ class HrPayrollStructure(models.Model): all_rules += struct.rule_ids._recursive_search_of_rules() return all_rules - @api.multi def _get_parent_structure(self): parent = self.mapped('parent_id') if parent: @@ -177,7 +174,6 @@ class HrSalaryRule(models.Model): if not self._check_recursion(parent='parent_rule_id'): raise ValidationError(_('Error! You cannot create recursive hierarchy of Salary Rules.')) - @api.multi def _recursive_search_of_rules(self): """ @return: returns a list of tuple (id, sequence) which are all the children of the passed rule_ids @@ -188,7 +184,6 @@ class HrSalaryRule(models.Model): return [(rule.id, rule.sequence) for rule in self] + children_rules #TODO should add some checks on the type of result (should be float) - @api.multi def _compute_rule(self, localdict): """ :param localdict: dictionary containing the environement in which to compute the rule @@ -215,7 +210,6 @@ class HrSalaryRule(models.Model): except: raise UserError(_('Wrong python code defined for salary rule %s (%s).') % (self.name, self.code)) - @api.multi def _satisfy_condition(self, localdict): """ @param contract_id: id of hr.contract to be tested diff --git a/hr_payroll_community/wizard/hr_payroll_contribution_register_report.py b/hr_payroll_community/wizard/hr_payroll_contribution_register_report.py index 8e69d7237..b1a57022c 100644 --- a/hr_payroll_community/wizard/hr_payroll_contribution_register_report.py +++ b/hr_payroll_community/wizard/hr_payroll_contribution_register_report.py @@ -15,7 +15,6 @@ class PayslipLinesContributionRegister(models.TransientModel): date_to = fields.Date(string='Date To', required=True, default=str(datetime.now() + relativedelta.relativedelta(months=+1, day=1, days=-1))[:10]) - @api.multi def print_report(self): active_ids = self.env.context.get('active_ids', []) datas = { diff --git a/hr_payroll_community/wizard/hr_payroll_payslips_by_employees.py b/hr_payroll_community/wizard/hr_payroll_payslips_by_employees.py index 4ee389ee0..14043bb3e 100644 --- a/hr_payroll_community/wizard/hr_payroll_payslips_by_employees.py +++ b/hr_payroll_community/wizard/hr_payroll_payslips_by_employees.py @@ -10,7 +10,6 @@ class HrPayslipEmployees(models.TransientModel): employee_ids = fields.Many2many('hr.employee', 'hr_employee_group_rel', 'payslip_id', 'employee_id', 'Employees') - @api.multi def compute_sheet(self): payslips = self.env['hr.payslip'] [data] = self.read()