diff --git a/hr_expense_advance_clearing_consolidation/README.rst b/hr_expense_advance_clearing_consolidation/README.rst index 9817a8eaa639..ffa498269fdd 100644 --- a/hr_expense_advance_clearing_consolidation/README.rst +++ b/hr_expense_advance_clearing_consolidation/README.rst @@ -7,7 +7,7 @@ Hr Expense Advance Clearing Consolidation !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:85e7b17b7868c1898b8bc12dca51d5ae2bf32f53b4fe549fa1d3f7f02daaf002 + !! source digest: sha256:850c8257cdb1de590ca61c1150398d7356073ef0db75d4319a2fc442cb542f24 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png diff --git a/hr_expense_advance_clearing_consolidation/__manifest__.py b/hr_expense_advance_clearing_consolidation/__manifest__.py index e64b09f149d2..63f46dae970b 100644 --- a/hr_expense_advance_clearing_consolidation/__manifest__.py +++ b/hr_expense_advance_clearing_consolidation/__manifest__.py @@ -5,7 +5,7 @@ "name": "Hr Expense Advance Clearing Consolidation", "summary": """ HR Expense Advance Clearing Consolidation""", - "version": "12.0.1.0.0", + "version": "14.0.1.0.0", "license": "AGPL-3", "author": "Escodoo,Odoo Community Association (OCA)", "website": "https://github.com/OCA/hr", diff --git a/hr_expense_advance_clearing_consolidation/models/hr_expense_sheet.py b/hr_expense_advance_clearing_consolidation/models/hr_expense_sheet.py index 8552ab164dab..6c452869f7e7 100644 --- a/hr_expense_advance_clearing_consolidation/models/hr_expense_sheet.py +++ b/hr_expense_advance_clearing_consolidation/models/hr_expense_sheet.py @@ -1,7 +1,7 @@ # Copyright 2022 - TODAY, Marcel Savegnago # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import _, api, fields, models +from odoo import _, fields, models from odoo.exceptions import UserError @@ -12,8 +12,7 @@ class HrExpenseSheet(models.Model): string="Is Consolidated Advance", readonly=True ) - @api.multi - def _consolidate_open_advances(self): + def _consolidate_open_advances(self): # noqa: C901 if not len(self) > 1: raise UserError( _( @@ -47,7 +46,6 @@ def _consolidate_open_advances(self): "report that is open." ) ) - writeoff_lines = self.env["account.move.line"] emp_advance = self.env.ref("hr_expense_advance_clearing." "product_emp_advance") @@ -128,14 +126,12 @@ def _consolidate_open_advances(self): return consolidated_advance - @api.multi def consolidate_open_advances(self): if self.env.user.has_group("account.group_account_manager"): self._consolidate_open_advances() else: raise UserError(_("You do not have permission to perform this action.")) - @api.multi def _log_consolidation_open_advance(self, advances, consolidated_advance): consolidated_advance.message_post( body="%s %s" @@ -146,7 +142,7 @@ def _log_consolidation_open_advance(self, advances, consolidated_advance): ) for advance in advances: advance.message_post( - body="%s" + body=_("%s") % ( _("This advance was consolidated in the advance: %s (ID %s)") % (consolidated_advance.name or "n/a", consolidated_advance.id) diff --git a/hr_expense_advance_clearing_consolidation/static/description/index.html b/hr_expense_advance_clearing_consolidation/static/description/index.html index 51a463b4cc6b..bb97a38edcc5 100644 --- a/hr_expense_advance_clearing_consolidation/static/description/index.html +++ b/hr_expense_advance_clearing_consolidation/static/description/index.html @@ -367,7 +367,7 @@

Hr Expense Advance Clearing Consolidation

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:85e7b17b7868c1898b8bc12dca51d5ae2bf32f53b4fe549fa1d3f7f02daaf002 +!! source digest: sha256:850c8257cdb1de590ca61c1150398d7356073ef0db75d4319a2fc442cb542f24 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

Beta License: AGPL-3 OCA/hr Translate me on Weblate Try me on Runboat

This module adds the possibility to consolidate open advances, creating a new advance with the sum of the residual value of all consolidated advances.