Skip to content

Commit

Permalink
Add tax_tag_ids field to AccountTaxGroup model and views
Browse files Browse the repository at this point in the history
Introduced the tax_tag_ids field in the AccountTaxGroup model to link tags with tax groups. Updated account_tax_views.xml to display this new field in both the tree and form views, enhancing the visibility and management of tax tags within the system.
  • Loading branch information
rosenvladimirov committed Sep 3, 2024
1 parent 6c25d16 commit 8ef1c8f
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
13 changes: 13 additions & 0 deletions l10n_bg_tax_admin/models/account_tax.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,19 @@
_logger = logging.getLogger(__name__)


class AccountTaxGroup(models.Model):
_inherit = 'account.tax.group'

tax_tag_ids = fields.Many2many(
string="Tags",
comodel_name='account.account.tag',
ondelete='restrict',
context={'active_test': False},
tracking=True,
help="Tags assigned to this line by the tax creating it, if any. It determines its impact on financial reports.",
)


class AccountTax(models.Model):
_inherit = "account.tax"

Expand Down
20 changes: 20 additions & 0 deletions l10n_bg_tax_admin/views/account_tax_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,25 @@
</xpath>
</field>
</record>
<record id="view_tax_group_tree" model="ir.ui.view">
<field name="name">account.tax.group.tree</field>
<field name="model">account.tax.group</field>
<field name="inherit_id" ref="account.view_tax_group_tree"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='property_advance_tax_payment_account_id']" position="after">
<field name="tax_tag_ids" widget="many2many_tags"/>
</xpath>
</field>
</record>
<record id="view_tax_group_form" model="ir.ui.view">
<field name="name">account.tax.group.form</field>
<field name="model">account.tax.group</field>
<field name="inherit_id" ref="account.view_tax_group_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='property_advance_tax_payment_account_id']" position="after">
<field name="tax_tag_ids" widget="many2many_tags"/>
</xpath>
</field>
</record>
</data>
</odoo>

0 comments on commit 8ef1c8f

Please sign in to comment.