Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 57465a6

Browse files
committedFeb 21, 2025·
[IMP] account_invoice_tax: hide amount_company_currency column
1 parent 3c65086 commit 57465a6

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed
 

‎account_invoice_tax/wizards/account_invoice_tax.py

+11
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ class AccountInvoiceTax(models.TransientModel):
1010
company_id = fields.Many2one(related="move_id.company_id")
1111
tax_line_ids = fields.One2many("account.invoice.tax_line", "invoice_tax_id")
1212

13+
is_currency_column_invisible = fields.Boolean(
14+
compute='_compute_is_currency_column_visible',
15+
store=False,
16+
)
17+
1318
@api.model
1419
def default_get(self, fields):
1520
res = super().default_get(fields)
@@ -86,6 +91,10 @@ def add_tax_and_new(self):
8691
"context": self._context,
8792
}
8893

94+
@api.depends('move_id')
95+
def _compute_is_currency_column_visible(self):
96+
self.is_currency_column_invisible = self.move_id.currency_id == self.move_id.company_id.currency_id
97+
8998

9099
class AccountInvoiceTaxLine(models.TransientModel):
91100
_name = "account.invoice.tax_line"
@@ -99,6 +108,7 @@ class AccountInvoiceTaxLine(models.TransientModel):
99108
readonly=False,
100109
store=True,
101110
)
111+
102112
new_tax = fields.Boolean(default=True)
103113

104114
def _get_amount_updated_values(self):
@@ -138,3 +148,4 @@ def _compute_amount_company_currency(self):
138148
if line.tax_id.id == tax_group["involved_tax_ids"][0]:
139149
line.amount_company_currency = tax_group["tax_amount"]
140150
break
151+

‎account_invoice_tax/wizards/account_invoice_tax_view.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<field colspan="2" nolabel="1" name="tax_line_ids">
1212
<list decoration-info="new_tax == True" editable="bottom">
1313
<field name="tax_id" domain="[('type_tax_use', '=', 'purchase'), ('company_id', '=', parent.company_id)]" options="{'no_create': True, 'no_edit': True}"/>
14-
<field name="amount_company_currency"/>
14+
<field name="amount_company_currency" column_invisible="parent.is_currency_column_invisible"/>
1515
<field name="amount"/>
1616
<field name="new_tax" column_invisible="True"/>
1717
</list>

0 commit comments

Comments
 (0)
Please sign in to comment.