Skip to content

Commit

Permalink
[16.0][MIG] l10n_es_aeat_mod349: Migration to 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
FernandoRomera committed Dec 28, 2022
1 parent be6cc16 commit 220d776
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion l10n_es_aeat_mod349/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

{
"name": "AEAT modelo 349",
"version": "15.0.1.3.0",
"version": "16.0.1.0.0",
"author": "Tecnativa, ForgeFlow, Odoo Community Association (OCA)",
"license": "AGPL-3",
"category": "Localisation/Accounting",
Expand Down
12 changes: 6 additions & 6 deletions l10n_es_aeat_mod349/models/mod349.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ def _create_349_details(self, move_lines):
self._create_349_record_detail(move_line)

def _create_349_record_detail(self, move_line):
types = move_line.move_id.mapped("line_ids.account_id.internal_type")
sign = 1 if "payable" in types else -1
types = move_line.move_id.mapped("line_ids.account_id.internal_group")
sign = 1 if "expense" in types else -1
return self.env["l10n.es.aeat.mod349.partner_record_detail"].create(
{
"report_id": self.id,
Expand All @@ -137,8 +137,8 @@ def _create_349_record_detail(self, move_line):
)

def _create_349_refund_detail(self, move_line):
types = move_line.move_id.mapped("line_ids.account_id.internal_type")
sign = 1 if "receivable" in types else -1
types = move_line.move_id.mapped("line_ids.account_id.internal_group")
sign = 1 if "income" in types else -1
return self.env["l10n.es.aeat.mod349.partner_refund_detail"].create(
{
"report_id": self.id,
Expand Down Expand Up @@ -382,7 +382,7 @@ def calculate(self):
self._create_349_invoice_records()
self._create_349_refund_records()
# Recompute all pending computed fields
self.recompute()
self.flush_recordset()
return True

def button_recover(self):
Expand Down Expand Up @@ -427,7 +427,7 @@ def button_confirm(self):
"""Checks if all the fields of the report are correctly filled"""
self._check_names()
self._check_report_lines()
return super(Mod349, self).button_confirm()
return super().button_confirm()


class Mod349PartnerRecord(models.Model):
Expand Down
2 changes: 1 addition & 1 deletion l10n_es_aeat_mod349/tests/test_l10n_es_aeat_mod349.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,5 +208,5 @@ def test_model_349(self):
self.assertTrue(export_to_boe._export_config(model349, export_config))
# Test report printing
self.env.ref("l10n_es_aeat_mod349.act_report_aeat_mod349_pdf")._render(
model349.ids
"l10n_es_aeat_mod349.report_l10n_es_mod349_pdf", model349.ids, {}
)
9 changes: 6 additions & 3 deletions l10n_es_aeat_mod349/views/account_move_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,22 @@
<record id="view_move_form" model="ir.ui.view">
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_move_form" />
<field name="groups_id" eval="[(4, ref('account.group_account_invoice'))]" />
<field name="arch" type="xml">
<field name="fiscal_position_id" position="after">
<field
name="eu_triangular_deal"
groups="l10n_es_aeat.group_account_aeat"
groups="l10n_es_aeat.group_account_aeat,account.group_account_invoice"
/>
</field>
<xpath
expr="//field[@name='invoice_line_ids']/tree/field[@name='tax_ids']"
position="after"
>
<field name="l10n_es_aeat_349_operation_key" invisible="1" />
<field
name="l10n_es_aeat_349_operation_key"
invisible="1"
groups="l10n_es_aeat.group_account_aeat,account.group_account_invoice"
/>
</xpath>
</field>
</record>
Expand Down

0 comments on commit 220d776

Please sign in to comment.