Skip to content

Commit

Permalink
[MIG] l10n_es_atc_mod415: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian-RB committed Dec 26, 2024
1 parent 6d02583 commit 8f510e5
Show file tree
Hide file tree
Showing 9 changed files with 75 additions and 121 deletions.
8 changes: 5 additions & 3 deletions l10n_es_atc_mod415/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,20 @@
# Basado en el modelo 347 de la AEAT
{
"name": "ATC Modelo 415",
"version": "16.0.1.0.0",
"version": "17.0.1.0.0",
"author": "Binhex System Solutions," "Odoo Community Association (OCA)",
"website": "https://github.com/OCA/l10n-spain",
"category": "Accounting",
"license": "AGPL-3",
"depends": [
"l10n_es_igic",
"l10n_es_aeat_mod347",
"l10n_es_atc",
"l10n_es_aeat_mod347",
],
"data": [
"data/tax_code_map_mod415_data.xml",
"data/l10n.es.aeat.map.tax.line.tax.csv",
"data/l10n.es.aeat.map.tax.csv",
"data/l10n.es.aeat.map.tax.line.csv",
"security/ir.model.access.csv",
"security/mod_415_security.xml",
"views/account_move_view.xml",
Expand Down
2 changes: 2 additions & 0 deletions l10n_es_atc_mod415/data/l10n.es.aeat.map.tax.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
id,model
atc_mod415_map,415
3 changes: 3 additions & 0 deletions l10n_es_atc_mod415/data/l10n.es.aeat.map.tax.line.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
id,field_number,field_type,inverse,map_parent_id:id,move_type,name,sum_type,tax_xmlid_ids/id,to_regularize
atc_mod415_map_a,"01","both","False","atc_mod415_map","regular","A - Adquisiciones de bienes y servicios superiores al límite","both","igic_sop_0,igic_sop_3,igic_sop_7,igic_sop_9_5,igic_sop_15,igic_sop_20,igic_sop_0_inv,igic_sop_3_inv,igic_sop_7_inv,igic_sop_9_5_inv,igic_sop_15_inv,igic_sop_20_inv,igic_sop_i_0,igic_sop_i_3,igic_sop_i_7,igic_sop_i_9_5,igic_sop_i_15,igic_sop_i_20,igic_sop_i_0_inv,igic_sop_i_3_inv,igic_sop_i_7_inv,igic_sop_i_9_5_inv,igic_sop_i_15_inv,igic_sop_i_20_inv,igic_ISP0,igic_ISP3,igic_ISP7,igic_ISP95,igic_ISP15,igic_ISP20,igic_p_re0,igic_p_re03,igic_p_re07,igic_p_re095,igic_p_re15,igic_p_re20","False"
atc_mod415_map_b,"02","both","False","atc_mod415_map","regular","B - Entregas de bienes y servicios superiores al límite","both","igic_r_0,igic_r_3,igic_r_7,igic_r_9_5,igic_r_15,igic_r_20,igic_s_ISP0,igic_ex_0,igic_re_ex,igic_cmino","False"
47 changes: 47 additions & 0 deletions l10n_es_atc_mod415/data/l10n.es.aeat.map.tax.line.tax.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
id,name
igic_sop_0,account_tax_template_igic_sop_0
igic_sop_3,account_tax_template_igic_sop_3
igic_sop_7,account_tax_template_igic_sop_7
igic_sop_9_5,account_tax_template_igic_sop_9_5
igic_sop_15,account_tax_template_igic_sop_15
igic_sop_20,account_tax_template_igic_sop_20
igic_sop_0_inv,account_tax_template_igic_sop_0_inv
igic_sop_3_inv,account_tax_template_igic_sop_3_inv
igic_sop_7_inv,account_tax_template_igic_sop_7_inv
igic_sop_9_5_inv,account_tax_template_igic_sop_9_5_inv
igic_sop_15_inv,account_tax_template_igic_sop_15_inv
igic_sop_20_inv,account_tax_template_igic_sop_20_inv
igic_sop_i_0,account_tax_template_igic_sop_i_0
igic_sop_i_3,account_tax_template_igic_sop_i_3
igic_sop_i_7,account_tax_template_igic_sop_i_7
igic_sop_i_9_5,account_tax_template_igic_sop_i_9_5
igic_sop_i_15,account_tax_template_igic_sop_i_15
igic_sop_i_20,account_tax_template_igic_sop_i_20
igic_sop_i_0_inv,account_tax_template_igic_sop_i_0_inv
igic_sop_i_3_inv,account_tax_template_igic_sop_i_3_inv
igic_sop_i_7_inv,account_tax_template_igic_sop_i_7_inv
igic_sop_i_9_5_inv,account_tax_template_igic_sop_i_9_5_inv
igic_sop_i_15_inv,account_tax_template_igic_sop_i_15_inv
igic_sop_i_20_inv,account_tax_template_igic_sop_i_20_inv
igic_ISP0,account_tax_template_igic_ISP0
igic_ISP3,account_tax_template_igic_ISP3
igic_ISP7,account_tax_template_igic_ISP7
igic_ISP95,account_tax_template_igic_ISP95
igic_ISP15,account_tax_template_igic_ISP15
igic_ISP20,account_tax_template_igic_ISP20
igic_p_re0,account_tax_template_igic_p_re0
igic_p_re03,account_tax_template_igic_p_re03
igic_p_re07,account_tax_template_igic_p_re07
igic_p_re095,account_tax_template_igic_p_re095
igic_p_re15,account_tax_template_igic_p_re15
igic_p_re20,account_tax_template_igic_p_re20
igic_r_0,account_tax_template_igic_r_0
igic_r_3,account_tax_template_igic_r_3
igic_r_7,account_tax_template_igic_r_7
igic_r_9_5,account_tax_template_igic_r_9_5
igic_r_15,account_tax_template_igic_r_15
igic_r_20,account_tax_template_igic_r_20
igic_s_ISP0,account_tax_template_igic_s_ISP0
igic_ex_0,account_tax_template_igic_ex_0
igic_re_ex,account_tax_template_igic_re_ex
igic_cmino,account_tax_template_igic_cmino
21 changes: 10 additions & 11 deletions l10n_es_atc_mod415/data/mail_template_data.xml
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<record id="email_template_415" model="mail.template">
<field name="name">Comprobación datos modelo 415</field>
<field
<record id="email_template_415" model="mail.template">
<field name="name">Comprobación datos modelo 415</field>
<field
name="email_from"
>{{(user.email and '&quot;%s&quot; &lt;%s&gt;' % (user.name, user.email) or '')}}</field>
<field
<field
name="subject"
>Comprobación datos de modelo 415 año {{object.report_id.year}} de {{user.company_id.name}}</field>
<field
<field
name="partner_to"
>{{object.partner_id.address_get(['invoice'])['invoice']}}</field>
<field
<field
name="model_id"
ref="l10n_es_atc_mod415.model_l10n_es_atc_mod415_partner_record"
/>
<field name="auto_delete" eval="True" />
<field name="report_template" ref="415_partner" />
<field name="report_name">415_details</field>
<field name="lang">{{object.partner_id.lang}}</field>
<field
<field name="auto_delete" eval="True" />
<field name="report_template_ids" eval="[(4, ref('415_partner'))]" />
<field name="lang">{{object.partner_id.lang}}</field>
<field
name="body_html"
><![CDATA[
<p>Estimado/a <t t-out="object.partner_id.name" />
Expand Down
91 changes: 0 additions & 91 deletions l10n_es_atc_mod415/data/tax_code_map_mod415_data.xml

This file was deleted.

2 changes: 1 addition & 1 deletion l10n_es_atc_mod415/models/mod415.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def _create_partner_records(self, key, map_ref, partner_record=None):
partner_record_obj = self.env["l10n.es.atc.mod415.partner_record"]
partner_obj = self.env["res.partner"]
map_line = self.env.ref(map_ref)
taxes = self._get_taxes(map_line)
taxes = map_line.get_taxes_for_company(self.company_id)
domain = self._account_move_line_domain(taxes)
if partner_record:
domain += [("partner_id", "=", partner_record.partner_id.id)]
Expand Down
20 changes: 6 additions & 14 deletions l10n_es_atc_mod415/tests/test_l10n_es_atc_mod415.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import logging

from odoo.tests import tagged
from odoo.tests.common import Form

from odoo.addons.l10n_es_aeat.tests.test_l10n_es_aeat_mod_base import (
Expand All @@ -18,20 +19,21 @@
_logger = logging.getLogger("atc")


@tagged("post_install", "-at_install")
class TestL10nEsAtcMod415(TestL10nEsAeatModBase):
@classmethod
def _chart_of_accounts_create(cls):
_logger.debug("Creating chart of account")
cls.company = cls.env["res.company"].create(
{"name": "Canary test company", "currency_id": cls.env.ref("base.EUR").id}
)
cls.chart = cls.env.ref("l10n_es_igic.account_chart_template_pymes_canary")
cls.env["account.chart.template"].try_loading(
"es_pymes_canary", company=cls.company, install_demo=False
)
cls.env.ref("base.group_multi_company").write({"users": [(4, cls.env.uid)]})
cls.env.user.write(
{"company_ids": [(4, cls.company.id)], "company_id": cls.company.id}
)
chart = cls.env.ref("l10n_es_igic.account_chart_template_pymes_canary")
chart.try_loading()
cls.with_context(company_id=cls.company.id)
return True

Expand Down Expand Up @@ -171,7 +173,7 @@ def test_model_415(self):
)
for vals in partner_record_vals:
partner_record = self.model415.partner_record_ids.filtered(
lambda x: x.partner_id == vals[1]
lambda x, vals=vals: x.partner_id == vals[1]
)
self.assertEqual(partner_record.operation_key, vals[0])
self.assertAlmostEqual(partner_record.amount, vals[2])
Expand Down Expand Up @@ -201,13 +203,3 @@ def test_model_415(self):
)
self.assertEqual(partner_record.partner_vat, "B29805314")
self.assertEqual(partner_record.partner_country_code, "ES")
# # Export to BOE
# export_to_boe = self.env["l10n.es.aeat.report.export_to_boe"].create(
# {"name": "test_export_to_boe.txt"}
# )
# export_config_xml_ids = [
# "l10n_es_atc_mod415.aeat_mod415_main_export_config",
# ]
# for xml_id in export_config_xml_ids:
# export_config = self.env.ref(xml_id)
# self.assertTrue(export_to_boe._export_config(self.model415, export_config))
2 changes: 1 addition & 1 deletion l10n_es_atc_mod415/views/mod415_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
<attribute name="invisible">True</attribute>
</button>
<field name="export_config_id" position="attributes">
<attribute name="invisible">1</attribute>
<attribute name="invisible">True</attribute>
</field>
</field>
</record>
Expand Down

0 comments on commit 8f510e5

Please sign in to comment.