Skip to content

Commit b304b4b

Browse files
[MIG] l10n_es_aeat_mod390: Migration to 19.0
1 parent d951691 commit b304b4b

5 files changed

Lines changed: 81 additions & 57 deletions

File tree

l10n_es_aeat_mod390/README.rst

Lines changed: 38 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ AEAT modelo 390
2121
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
2222
:alt: License: AGPL-3
2323
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fl10n--spain-lightgray.png?logo=github
24-
:target: https://github.com/OCA/l10n-spain/tree/18.0/l10n_es_aeat_mod390
24+
:target: https://github.com/OCA/l10n-spain/tree/19.0/l10n_es_aeat_mod390
2525
:alt: OCA/l10n-spain
2626
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
27-
:target: https://translation.odoo-community.org/projects/l10n-spain-18-0/l10n-spain-18-0-l10n_es_aeat_mod390
27+
:target: https://translation.odoo-community.org/projects/l10n-spain-19-0/l10n-spain-19-0-l10n_es_aeat_mod390
2828
:alt: Translate me on Weblate
2929
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
30-
:target: https://runboat.odoo-community.org/builds?repo=OCA/l10n-spain&target_branch=18.0
30+
:target: https://runboat.odoo-community.org/builds?repo=OCA/l10n-spain&target_branch=19.0
3131
:alt: Try me on Runboat
3232

3333
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -67,31 +67,31 @@ Para crear un modelo, por ejemplo de un trimestre del año:
6767
Known issues / Roadmap
6868
======================
6969

70-
- La declaración sólo se puede realizar para personas jurídicas.
71-
- No se calculan operaciones intragrupo.
72-
- No se contempla el régimen de criterio de caja.
73-
- No se contempla el régimen especial de bienes usados, objetos de arte,
74-
antigüedades y objetos de colección.
75-
- No se contempla el régimen especial de agencias de viaje.
76-
- No se contempla el recargo de equivalencia de impuesto al tabaco
77-
(casillas 41 y 42).
78-
- No se contempla el régimen especial de la agricultura, ganadería y
79-
pesca.
80-
- No se contempla la prorrata general de IVA.
81-
- No se contempla el régimen simplificado.
82-
- No se contempla el régimen de deducción diferenciado.
83-
- No se contempla la inversión de sujeto pasivo nacional.
84-
- No se tienen en cuenta tributaciones territoriales.
85-
- Obtener las casillas 95, 97 y 98 de las declaraciones del 303.
86-
- Falta añadir la casilla 663 de cuota pendientes de compensación.
70+
- La declaración sólo se puede realizar para personas jurídicas.
71+
- No se calculan operaciones intragrupo.
72+
- No se contempla el régimen de criterio de caja.
73+
- No se contempla el régimen especial de bienes usados, objetos de
74+
arte, antigüedades y objetos de colección.
75+
- No se contempla el régimen especial de agencias de viaje.
76+
- No se contempla el recargo de equivalencia de impuesto al tabaco
77+
(casillas 41 y 42).
78+
- No se contempla el régimen especial de la agricultura, ganadería y
79+
pesca.
80+
- No se contempla la prorrata general de IVA.
81+
- No se contempla el régimen simplificado.
82+
- No se contempla el régimen de deducción diferenciado.
83+
- No se contempla la inversión de sujeto pasivo nacional.
84+
- No se tienen en cuenta tributaciones territoriales.
85+
- Obtener las casillas 95, 97 y 98 de las declaraciones del 303.
86+
- Falta añadir la casilla 663 de cuota pendientes de compensación.
8787

8888
Bug Tracker
8989
===========
9090

9191
Bugs are tracked on `GitHub Issues <https://github.com/OCA/l10n-spain/issues>`_.
9292
In case of trouble, please check there if your issue has already been reported.
9393
If you spotted it first, help us to smash it by providing a detailed and welcomed
94-
`feedback <https://github.com/OCA/l10n-spain/issues/new?body=module:%20l10n_es_aeat_mod390%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
94+
`feedback <https://github.com/OCA/l10n-spain/issues/new?body=module:%20l10n_es_aeat_mod390%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
9595

9696
Do not contact contributors directly about support or help with technical issues.
9797

@@ -106,27 +106,31 @@ Authors
106106
Contributors
107107
------------
108108

109-
- `Tecnativa <https://www.tecnativa.com>`__:
109+
- `Tecnativa <https://www.tecnativa.com>`__:
110110

111-
- Pedro M. Baeza <pedro.baeza@tecnativa.com>
111+
- Pedro M. Baeza <pedro.baeza@tecnativa.com>
112112

113-
- Albert Cabedo
114-
- `Acysos <http://www.acysos.com>`__:
113+
- Albert Cabedo
114+
- `Acysos <http://www.acysos.com>`__:
115115

116-
- Ignacio Ibeas
116+
- Ignacio Ibeas
117117

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

120-
- Harald Panten <harald.panten@sygel.es>
121-
- Valentin Vinagre <valentin.vinagre@sygel.es>
120+
- Harald Panten <harald.panten@sygel.es>
121+
- Valentin Vinagre <valentin.vinagre@sygel.es>
122122

123-
- `Dixmit <https://www.dixmit.com>`__:
123+
- `Dixmit <https://www.dixmit.com>`__:
124124

125-
- Enric Tobella
125+
- Enric Tobella
126126

127-
- `Moduon <https://www.moduon.team>`__:
127+
- `Moduon <https://www.moduon.team>`__:
128128

129-
- Emilio Pascual
129+
- Emilio Pascual
130+
131+
- `Studio73 <https://studio73.es>`__:
132+
133+
- Pablo Cortés
130134

131135
Maintainers
132136
-----------
@@ -149,6 +153,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
149153

150154
|maintainer-pedrobaeza|
151155

152-
This module is part of the `OCA/l10n-spain <https://github.com/OCA/l10n-spain/tree/18.0/l10n_es_aeat_mod390>`_ project on GitHub.
156+
This module is part of the `OCA/l10n-spain <https://github.com/OCA/l10n-spain/tree/19.0/l10n_es_aeat_mod390>`_ project on GitHub.
153157

154158
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

l10n_es_aeat_mod390/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
{
55
"name": "AEAT modelo 390",
6-
"version": "18.0.1.0.4",
6+
"version": "19.0.1.0.0",
77
"category": "Localisation/Accounting",
88
"author": "Tecnativa, Odoo Community Association (OCA)",
99
"website": "https://github.com/OCA/l10n-spain",

l10n_es_aeat_mod390/models/mod390.py

Lines changed: 31 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Copyright 2017-2021 Tecnativa - Pedro M. Baeza
22
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl
33

4-
from odoo import _, api, exceptions, fields, models
4+
from odoo import api, exceptions, fields, models
5+
from odoo.fields import Domain
56
from odoo.tools import float_compare
67

78
ACTIVITY_CODE_SELECTION = [
@@ -739,7 +740,7 @@ def _compute_casilla_108(self):
739740
def _check_type(self):
740741
if "C" in self.mapped("statement_type"):
741742
raise exceptions.UserError(
742-
_("You cannot make complementary reports for this model.")
743+
self.env._("You cannot make complementary reports for this model.")
743744
)
744745

745746
def _calculate_casilla_85(self, reports_303_this_year):
@@ -776,21 +777,31 @@ def _calculate_casilla_662(self, reports_303):
776777
# Cuotas aplicadas este año
777778
applied_this_year = sum(
778779
reports_303.filtered_domain(
779-
[("period_type", "not in", ("1T", "01"))]
780+
Domain.AND(
781+
[
782+
Domain("period_type", "not in", ["1T", "01"]),
783+
Domain("result_type", "in", ["C"]),
784+
]
785+
)
780786
).mapped("cuota_compensar")
781787
)
782788
# Compensaciones de este año
783789
compensation_this_year = abs(
784790
sum(
785791
reports_303.filtered_domain(
786-
[("period_type", "not in", ("4T", "12")), ("result_type", "=", "C")]
792+
Domain.AND(
793+
[
794+
Domain("period_type", "not in", ["4T", "12"]),
795+
Domain("result_type", "in", ["C"]),
796+
]
797+
)
787798
).mapped("resultado_liquidacion")
788799
)
789800
)
790801
# Compensaciones de años anteriores
791802
compensation_previous_years = reports_303.filtered_domain(
792-
[("period_type", "in", ("1T", "01"))]
793-
)[:1].potential_cuota_compensar
803+
Domain("period_type", "in", ("1T", "01"))
804+
).potential_cuota_compensar
794805
# Si lo aplicado este año es menor que compensaciones de años anteriores
795806
# significa que no se ha aplicado todo de años anteriores, por lo que
796807
# no hay que tenerlo en cuenta para la 662.
@@ -815,12 +826,14 @@ def calculate(self):
815826
continue
816827
casilla_85, casilla_95, casilla_97, casilla_98, casilla_662 = 0, 0, 0, 0, 0
817828
reports_303_this_year = self.env["l10n.es.aeat.mod303.report"].search(
818-
[
819-
("year", "=", mod390.year),
820-
("state", "not in", ("draft", "cancelled")),
821-
("statement_type", "=", "N"),
822-
("company_id", "=", mod390.company_id.id),
823-
]
829+
Domain.AND(
830+
[
831+
Domain("year", "in", [mod390.year]),
832+
Domain("state", "not in", ["draft", "cancelled"]),
833+
Domain("statement_type", "in", ["N"]),
834+
Domain("company_id", "in", [mod390.company_id.id]),
835+
]
836+
)
824837
)
825838
if not reports_303_this_year:
826839
continue
@@ -846,6 +859,7 @@ def calculate(self):
846859
# Si salió a devolver, casilla 98 = casilla 71 del último periodo
847860
# del año si fue a devolver
848861
casilla_98 = abs(report_303_last_period.resultado_liquidacion)
862+
casilla_662 = 0.0
849863
mod390.update(
850864
{
851865
"casilla_85": casilla_85,
@@ -863,7 +877,7 @@ def button_confirm(self):
863877
summary = self.casilla_95 - self.casilla_97 - self.casilla_98 - self.casilla_662
864878
if float_compare(summary, self.casilla_86, precision_digits=2) != 0:
865879
raise exceptions.UserError(
866-
_(
880+
self.env._(
867881
"The result of the manual 303 summary (fields [95], [97], [98] and "
868882
"[662] in the page '9. Resultado liquidaciones') doesn't match "
869883
"the field [86]. Please check if you have filled such fields."
@@ -873,9 +887,9 @@ def button_confirm(self):
873887

874888
def _get_move_line_domain(self, date_start, date_end, map_line):
875889
"""Consider bankrupcy proceedings or uncollectible debt."""
876-
res = super()._get_move_line_domain(date_start, date_end, map_line)
890+
domain = super()._get_move_line_domain(date_start, date_end, map_line)
877891
if map_line.field_number in {31, 32, 45, 46}:
878-
res += [("move_id.is_bankrupcy_uncollectible_debt", "=", True)]
892+
domain &= Domain("move_id.is_bankrupcy_uncollectible_debt", "in", [True])
879893
elif map_line.field_number in {29, 30, 43, 44, 99}:
880-
res += [("move_id.is_bankrupcy_uncollectible_debt", "=", False)]
881-
return res
894+
domain &= Domain("move_id.is_bankrupcy_uncollectible_debt", "in", [False])
895+
return domain

l10n_es_aeat_mod390/readme/CONTRIBUTORS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@
1010
- Enric Tobella
1111
- [Moduon](https://www.moduon.team):
1212
- Emilio Pascual
13+
- [Studio73](https://studio73.es):
14+
- Pablo Cortés

l10n_es_aeat_mod390/static/description/index.html

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ <h1>AEAT modelo 390</h1>
374374
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
375375
!! source digest: sha256:a50659a990ce5bcab73139fd11dd0592c53d4fa0a1ce853bfd3ea0f37af71df6
376376
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
377-
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/l10n-spain/tree/18.0/l10n_es_aeat_mod390"><img alt="OCA/l10n-spain" src="https://img.shields.io/badge/github-OCA%2Fl10n--spain-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/l10n-spain-18-0/l10n-spain-18-0-l10n_es_aeat_mod390"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/l10n-spain&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
377+
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/l10n-spain/tree/19.0/l10n_es_aeat_mod390"><img alt="OCA/l10n-spain" src="https://img.shields.io/badge/github-OCA%2Fl10n--spain-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/l10n-spain-19-0/l10n-spain-19-0-l10n_es_aeat_mod390"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/l10n-spain&amp;target_branch=19.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
378378
<p>Modelo 390 de la AEAT. Declaración-resumen anual del Impuesto sobre el
379379
Valor Añadido.</p>
380380
<p><strong>Table of contents</strong></p>
@@ -421,8 +421,8 @@ <h2><a class="toc-backref" href="#toc-entry-3">Known issues / Roadmap</a></h2>
421421
<li>La declaración sólo se puede realizar para personas jurídicas.</li>
422422
<li>No se calculan operaciones intragrupo.</li>
423423
<li>No se contempla el régimen de criterio de caja.</li>
424-
<li>No se contempla el régimen especial de bienes usados, objetos de arte,
425-
antigüedades y objetos de colección.</li>
424+
<li>No se contempla el régimen especial de bienes usados, objetos de
425+
arte, antigüedades y objetos de colección.</li>
426426
<li>No se contempla el régimen especial de agencias de viaje.</li>
427427
<li>No se contempla el recargo de equivalencia de impuesto al tabaco
428428
(casillas 41 y 42).</li>
@@ -442,7 +442,7 @@ <h2><a class="toc-backref" href="#toc-entry-4">Bug Tracker</a></h2>
442442
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/l10n-spain/issues">GitHub Issues</a>.
443443
In case of trouble, please check there if your issue has already been reported.
444444
If you spotted it first, help us to smash it by providing a detailed and welcomed
445-
<a class="reference external" href="https://github.com/OCA/l10n-spain/issues/new?body=module:%20l10n_es_aeat_mod390%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
445+
<a class="reference external" href="https://github.com/OCA/l10n-spain/issues/new?body=module:%20l10n_es_aeat_mod390%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
446446
<p>Do not contact contributors directly about support or help with technical issues.</p>
447447
</div>
448448
<div class="section" id="credits">
@@ -478,6 +478,10 @@ <h3><a class="toc-backref" href="#toc-entry-7">Contributors</a></h3>
478478
<li>Emilio Pascual</li>
479479
</ul>
480480
</li>
481+
<li><a class="reference external" href="https://studio73.es">Studio73</a>:<ul>
482+
<li>Pablo Cortés</li>
483+
</ul>
484+
</li>
481485
</ul>
482486
</div>
483487
<div class="section" id="maintainers">
@@ -491,7 +495,7 @@ <h3><a class="toc-backref" href="#toc-entry-8">Maintainers</a></h3>
491495
promote its widespread use.</p>
492496
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
493497
<p><a class="reference external image-reference" href="https://github.com/pedrobaeza"><img alt="pedrobaeza" src="https://github.com/pedrobaeza.png?size=40px" /></a></p>
494-
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/l10n-spain/tree/18.0/l10n_es_aeat_mod390">OCA/l10n-spain</a> project on GitHub.</p>
498+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/l10n-spain/tree/19.0/l10n_es_aeat_mod390">OCA/l10n-spain</a> project on GitHub.</p>
495499
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
496500
</div>
497501
</div>

0 commit comments

Comments
 (0)