[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 <qdp@odoo.com>
This commit is contained in:
moerradi
2023-03-21 18:56:01 +01:00
parent 94bbffe46b
commit 87821818ee
2 changed files with 0 additions and 28 deletions
@@ -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:
@@ -39,7 +39,6 @@
<field name="tax_line_id" readonly="1" attrs="{'invisible': [('tax_line_id','=',False)]}"/>
<field name="tax_ids" widget="many2many_tags" readonly="1" attrs="{'invisible': [('tax_ids','=',[])]}"/>
<field name="tax_tag_invert" readonly="1" groups="base.group_no_one"/>
<field name="tax_audit"/>
</group>
<group string="Matching" attrs="{'invisible':[('matched_debit_ids', '=', []),('matched_credit_ids', '=', [])]}">
<label for="full_reconcile_id"/>
@@ -275,7 +274,6 @@
<field name="matching_number" position="replace">
<field name="tax_line_id" string="Tax"/>
<field name="tax_base_amount" sum="Total Base Amount"/>
<field name="tax_audit"/>
</field>
<field name="analytic_distribution" position="attributes">
<attribute name="optional">hide</attribute>