Skip to content

Commit

Permalink
[MIG] l10n_es_aeat_mod115: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Tisho99 committed May 8, 2024
1 parent 3615611 commit 1a0cf26
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 58 deletions.
4 changes: 4 additions & 0 deletions l10n_es_aeat_mod115/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ Contributors

- Jorge Hernández <jhernandez@coninpe.com>

- `Sygel <https://www.sygel.es>`__:

- Alberto Martínez <alberto.martinez@sygel.es>

Maintainers
-----------

Expand Down
8 changes: 6 additions & 2 deletions l10n_es_aeat_mod115/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

{
"name": "AEAT modelo 115",
"version": "16.0.1.0.1",
"version": "17.0.1.0.0",
"development_status": "Mature",
"category": "Localisation/Accounting",
"author": "AvanzOSC, Tecnativa, Odoo Community Association (OCA)",
Expand All @@ -16,7 +16,11 @@
"security/ir.model.access.csv",
"security/l10n_es_aeat_mod115_security.xml",
"data/aeat_export_mod115_data.xml",
"data/tax_code_map_mod115_data.xml",
"data/l10n.es.aeat.map.tax.csv",
"data/l10n.es.aeat.map.tax.line.tax.csv",
# l10n.es.aeat.map.tax.line.tax.csv should be before
# l10n.es.aeat.map.tax.line.csv
"data/l10n.es.aeat.map.tax.line.csv",
"views/mod115_view.xml",
],
"installable": True,
Expand Down
2 changes: 2 additions & 0 deletions l10n_es_aeat_mod115/data/l10n.es.aeat.map.tax.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
id,model,date_from,date_to
aeat_mod115_map,115,,
3 changes: 3 additions & 0 deletions l10n_es_aeat_mod115/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,name,sum_type,account_xmlid_ids/id,tax_xmlid_ids/id
aeat_mod115_map_line_02,02,base,True,aeat_mod115_map,Base retenciones e ingresos a cuenta,both,,"p_irpf19a,p_irpf195a,p_irpf20a,p_irpf21a"
aeat_mod115_map_line_03,03,amount,False,aeat_mod115_map,Retenciones e ingresos a cuenta,both,,"p_irpf19a,p_irpf195a,p_irpf20a,p_irpf21a"
5 changes: 5 additions & 0 deletions l10n_es_aeat_mod115/data/l10n.es.aeat.map.tax.line.tax.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
id,name
p_irpf19a,account_tax_template_p_irpf19a
p_irpf195a,account_tax_template_p_irpf195a
p_irpf20a,account_tax_template_p_irpf20a
p_irpf21a,account_tax_template_p_irpf21a
36 changes: 0 additions & 36 deletions l10n_es_aeat_mod115/data/tax_code_map_mod115_data.xml

This file was deleted.

7 changes: 0 additions & 7 deletions l10n_es_aeat_mod115/models/mod115.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,22 @@ class L10nEsAeatMod115Report(models.Model):

casilla_01 = fields.Integer(
string="[01] # Recipients",
readonly=True,
compute="_compute_casilla_01",
help="Number of recipients",
)
casilla_03 = fields.Float(
string="[03] Amount of retentions",
readonly=True,
compute="_compute_casilla_03",
help="Amount of retentions",
)
casilla_04 = fields.Float(
string="[04] Fees to compensate",
readonly=True,
states={"calculated": [("readonly", False)]},
help="Fee to compensate for prior results with same subject, "
"fiscal year and period (in which his statement was to return "
"and compensation back option was chosen).",
)
casilla_05 = fields.Float(
string="[05] Result",
readonly=True,
compute="_compute_casilla_05",
help="Result: ([03] - [04])",
)
Expand All @@ -48,8 +43,6 @@ class L10nEsAeatMod115Report(models.Model):
],
string="Result type",
default="N",
readonly=True,
states={"draft": [("readonly", False)]},
required=True,
)
tipo_declaracion_positiva = fields.Selection(
Expand Down
2 changes: 2 additions & 0 deletions l10n_es_aeat_mod115/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@
- Raúl Fernández \<<raul.fernandez@qubiq.es>\>
- [Coninpe](https://www.coninpe.es):
- Jorge Hernández \<<jhernandez@coninpe.com>\>
- [Sygel](https://www.sygel.es):
- Alberto Martínez \<<alberto.martinez@sygel.es>\>
4 changes: 4 additions & 0 deletions l10n_es_aeat_mod115/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,10 @@ <h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
<li>Jorge Hernández &lt;<a class="reference external" href="mailto:jhernandez&#64;coninpe.com">jhernandez&#64;coninpe.com</a>&gt;</li>
</ul>
</li>
<li><a class="reference external" href="https://www.sygel.es">Sygel</a>:<ul>
<li>Alberto Martínez &lt;<a class="reference external" href="mailto:alberto.martinez&#64;sygel.es">alberto.martinez&#64;sygel.es</a>&gt;</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="maintainers">
Expand Down
2 changes: 1 addition & 1 deletion l10n_es_aeat_mod115/tests/test_l10n_es_aeat_mod115.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def test_model_115(self):
# Check tax lines
for box, result in self.taxes_result.items():
lines = self.model115.tax_line_ids.filtered(
lambda x: x.field_number == int(box)
lambda x, box=box: x.field_number == int(box)
)
self.assertEqual(round(sum(lines.mapped("amount")), 2), round(result, 2))
# Check result
Expand Down
20 changes: 8 additions & 12 deletions l10n_es_aeat_mod115/views/mod115_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,20 @@
<field
name="tipo_declaracion_positiva"
string="Result type"
attrs="{'invisible': [('casilla_05', '&lt;=', 0.0)]}"
invisible="casilla_05 &lt;= 0.0"
/>
<field
name="tipo_declaracion_negativa"
string="Result type"
attrs="{'invisible': [('casilla_05', '&gt;', 0.0)]}"
invisible="casilla_05 &gt; 0.0"
/>
<field name="tipo_declaracion" invisible="True" />
</field>
<group name="group_declaration" position="after">
<group
string="Result"
name="group_result"
attrs="{'invisible': [('state', '=', 'draft')]}"
invisible="state == 'draft'"
colspan="4"
>
<group string="Amounts retained">
Expand All @@ -55,30 +55,26 @@
name="casilla_04"
widget="monetary"
options="{'currency_field': 'currency_id'}"
attrs="{'readonly': ['|', ('state', '!=', 'calculated'), ('statement_type', '!=', 'C')]}"
readonly="state != 'calculated' or statement_type != 'C'"
/>
<field
name="casilla_05"
widget="monetary"
options="{'currency_field': 'currency_id'}"
/>
</group>
<separator
string="Tax lines"
attrs="{'invisible': [('state', '=', 'draft')]}"
/>
<separator string="Tax lines" invisible="state == 'draft'" />
<field
name="tax_line_ids"
nolabel="1"
readonly="1"
attrs="{'invisible': [('state', '=', 'draft')]}"
invisible="state == 'draft'"
/>
</group>
</group>
<field name="partner_bank_id" position="attributes">
<attribute
name="attrs"
>{'required': [('tipo_declaracion', 'in', ('U', 'N',))]}</attribute>
<attribute name="required">tipo_declaracion in ('U', 'N')
</attribute>
</field>
<form position="inside">
<div class="oe_chatter">
Expand Down

0 comments on commit 1a0cf26

Please sign in to comment.