From 87821818ee60d1b8eda92b99fbf28f7accd2bfd9 Mon Sep 17 00:00:00 2001 From: moerradi Date: Tue, 7 Mar 2023 17:24:24 +0000 Subject: [PATCH] [REM] account: remove tax_audit field the tax_audit field was introduced in v13 and it served the purpose of providing users with improved visibility regarding the impact of move lines on report lines. The computation of the sign for each move line when resolving tax grid amounts has now been simplified using the formula (tax_tag_invert * sign of the tag * balance). Consequently, the tax_audit field has become redundant and is no longer required. closes odoo/odoo#114616 Task-id: 3196711 Related: odoo/upgrade#4442 Signed-off-by: Quentin De Paoli --- addons/account/models/account_move_line.py | 26 --------------------- addons/account/views/account_move_views.xml | 2 -- 2 files changed, 28 deletions(-) diff --git a/addons/account/models/account_move_line.py b/addons/account/models/account_move_line.py index c32ead0fc47..9741700d2c2 100644 --- a/addons/account/models/account_move_line.py +++ b/addons/account/models/account_move_line.py @@ -208,10 +208,6 @@ class AccountMoveLine(models.Model): tracking=True, help="Tags assigned to this line by the tax creating it, if any. It determines its impact on financial reports.", ) - tax_audit = fields.Char( - string="Tax Audit String", - compute="_compute_tax_audit", store=True, - help="Computed field, listing the tax grids impacted by this line, and the amount it applies to each of them.") # Technical field. True if the balance of this move line needs to be # inverted when computing its total for each tag (for sales invoices, for # example) tax_tag_invert = fields.Boolean( @@ -773,28 +769,6 @@ class AccountMoveLine(models.Model): if record.move_id.tax_cash_basis_origin_move_id and (record.move_id.reversed_entry_id or record.tax_base_amount < 0): record.tax_tag_invert = not record.tax_tag_invert - @api.depends('tax_tag_ids', 'debit', 'credit', 'journal_id', 'tax_tag_invert') - def _compute_tax_audit(self): - separator = ' ' - - for record in self: - currency = record.company_id.currency_id - audit_str = '' - for tag in record.tax_tag_ids: - tag_amount = (record.tax_tag_invert and -1 or 1) * (tag.tax_negate and -1 or 1) * record.balance - - if tag.applicability == 'taxes' and tag.name[0] in {'+', '-'}: - # Then, the tag comes from a report expression, and hence has a + or - sign (also in its name) - tag_name = tag.name[1:] - else: - # Then, it's a financial tag (sign is always +, and never shown in tag name) - tag_name = tag.name - - audit_str += separator if audit_str else '' - audit_str += tag_name + ': ' + formatLang(self.env, tag_amount, currency_obj=currency) - - record.tax_audit = audit_str - @api.depends('product_id') def _compute_product_uom_id(self): for line in self: diff --git a/addons/account/views/account_move_views.xml b/addons/account/views/account_move_views.xml index 201c654a776..5711d0f200a 100644 --- a/addons/account/views/account_move_views.xml +++ b/addons/account/views/account_move_views.xml @@ -39,7 +39,6 @@ -