Skip to content

Commit

Permalink
[MIG] l10n_pt_vat: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dreispt committed Sep 19, 2024
1 parent 44457c5 commit 5b1dccb
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion l10n_pt_vat/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Portugal - IVA",
"version": "16.0.1.1.0",
"version": "17.0.1.0.0",
"license": "AGPL-3",
"author": "Open Source Integrators, Sossia, Odoo Community Association (OCA)",
"summary": "Portuguese VAT requirements extensions",
Expand Down
5 changes: 3 additions & 2 deletions l10n_pt_vat/models/l10n_pt_vat_exempt_reason.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@ class VatExemptReason(models.Model):
note = fields.Text(string="Description")

def name_get(self):
return [(x.id, "[%s] %s" % (x.code, x.name)) for x in self]
return [(x.id, f"[{'x.code'}] {'x.name'}") for x in self]

@api.model
def _name_search(
self, name, args=None, operator="ilike", limit=100, name_get_uid=None
):
"""
Returns a list of tuples containing id, name, as internally it is called {def name_get}
Returns a list of tuples containing id, name,
as internally it is called <<def name_get>>
result format: {[(id, name), (id, name), ...]}
"""
args = args or []

Check warning on line 30 in l10n_pt_vat/models/l10n_pt_vat_exempt_reason.py

View check run for this annotation

Codecov / codecov/patch

l10n_pt_vat/models/l10n_pt_vat_exempt_reason.py#L30

Added line #L30 was not covered by tests
Expand Down
2 changes: 1 addition & 1 deletion l10n_pt_vat/views/account_journal_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<field name="code" position="after">
<field
name="l10npt_vat_exempt_reason"
attrs="{'invisible': [('country_code', '!=', 'PT')]}"
invisible="country_code != 'PT'"
/>
</field>
</data>
Expand Down
5 changes: 2 additions & 3 deletions l10n_pt_vat/views/account_move_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@
<field
name="l10npt_vat_exempt_reason"
widget="selection"
attrs="{'invisible': [('country_code', '!=', 'PT')]}"
invisible="country_code != 'PT'"
/>
<field name="move_type" invisible="1" />
<field
name="vat_adjustment_norm_id"
attrs="{'invisible': ['|',('country_code', '!=', 'PT'),('move_type', 'not in',
['out_refund', 'in_refund'])]}"
invisible="country_code != 'PT' or move_type not in ['out_refund', 'in_refund']"
domain="[('move_type', '=', move_type)]"
/>
</div>
Expand Down
2 changes: 0 additions & 2 deletions l10n_pt_vat/views/vat_adjustment_norm_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
<record id="vat_adjustment_norm_view_tree" model="ir.ui.view">
<field name="name">account.vat.adjustment_norm.tree</field>
<field name="model">account.vat.adjustment_norm</field>
<field name="field_parent">child_ids</field>
<field name="priority">100</field>
<field name="arch" type="xml">
<tree>
<field name="name" />
Expand Down

0 comments on commit 5b1dccb

Please sign in to comment.