From 9cd09c94ff0715ae9f9252a03c4d7a59097c940d Mon Sep 17 00:00:00 2001 From: angelmoya Date: Wed, 18 Aug 2021 09:13:35 +0200 Subject: [PATCH 01/26] [ADD] l10n_es_aeat_mod303_oss: Add support for oss on 303 --- l10n_es_aeat_mod303_oss/README.rst | 74 +++ l10n_es_aeat_mod303_oss/__init__.py | 1 + l10n_es_aeat_mod303_oss/__manifest__.py | 15 + .../data/tax_code_map_mod303_data.xml | 29 ++ l10n_es_aeat_mod303_oss/models/__init__.py | 1 + l10n_es_aeat_mod303_oss/models/mod303.py | 22 + .../readme/CONTRIBUTORS.rst | 1 + .../readme/DESCRIPTION.rst | 2 + .../static/description/icon.png | Bin 0 -> 6750 bytes .../static/description/icon_source.svg | 113 +++++ .../static/description/index.html | 420 ++++++++++++++++++ 11 files changed, 678 insertions(+) create mode 100644 l10n_es_aeat_mod303_oss/README.rst create mode 100644 l10n_es_aeat_mod303_oss/__init__.py create mode 100644 l10n_es_aeat_mod303_oss/__manifest__.py create mode 100644 l10n_es_aeat_mod303_oss/data/tax_code_map_mod303_data.xml create mode 100644 l10n_es_aeat_mod303_oss/models/__init__.py create mode 100644 l10n_es_aeat_mod303_oss/models/mod303.py create mode 100644 l10n_es_aeat_mod303_oss/readme/CONTRIBUTORS.rst create mode 100644 l10n_es_aeat_mod303_oss/readme/DESCRIPTION.rst create mode 100644 l10n_es_aeat_mod303_oss/static/description/icon.png create mode 100644 l10n_es_aeat_mod303_oss/static/description/icon_source.svg create mode 100644 l10n_es_aeat_mod303_oss/static/description/index.html diff --git a/l10n_es_aeat_mod303_oss/README.rst b/l10n_es_aeat_mod303_oss/README.rst new file mode 100644 index 00000000000..6919fcbd63d --- /dev/null +++ b/l10n_es_aeat_mod303_oss/README.rst @@ -0,0 +1,74 @@ +===================== +AEAT modelo 303 - OSS +===================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fl10n--spain-lightgray.png?logo=github + :target: https://github.com/OCA/l10n-spain/tree/12.0/l10n_es_aeat_mod303_oss + :alt: OCA/l10n-spain +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/l10n-spain-12-0/l10n-spain-12-0-l10n_es_aeat_mod303_oss + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/189/12.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +Módulo ampliación del modelo 303 (IVA - Autodeclaración) para +incluir los datos de la ventanilla única o One-Stop Shop (OSS). + +**Table of contents** + +.. contents:: + :local: + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* PESOL + +Contributors +~~~~~~~~~~~~ + +* Angel Moya + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +This module is part of the `OCA/l10n-spain `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/l10n_es_aeat_mod303_oss/__init__.py b/l10n_es_aeat_mod303_oss/__init__.py new file mode 100644 index 00000000000..0650744f6bc --- /dev/null +++ b/l10n_es_aeat_mod303_oss/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/l10n_es_aeat_mod303_oss/__manifest__.py b/l10n_es_aeat_mod303_oss/__manifest__.py new file mode 100644 index 00000000000..8cff813da3c --- /dev/null +++ b/l10n_es_aeat_mod303_oss/__manifest__.py @@ -0,0 +1,15 @@ +# Copyright 2021 PESOL - Angel Moya +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0 + +{ + "name": "AEAT modelo 303 - OSS", + "version": "11.0.1.0.0", + "category": "Accounting", + "author": "PESOL, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/l10n-spain", + "license": "AGPL-3", + "depends": ["l10n_es_aeat_mod303", "l10n_eu_oss"], + "data": ["data/tax_code_map_mod303_data.xml"], + "installable": True, + "autoinstall": True, +} diff --git a/l10n_es_aeat_mod303_oss/data/tax_code_map_mod303_data.xml b/l10n_es_aeat_mod303_oss/data/tax_code_map_mod303_data.xml new file mode 100644 index 00000000000..c53b6b2e431 --- /dev/null +++ b/l10n_es_aeat_mod303_oss/data/tax_code_map_mod303_data.xml @@ -0,0 +1,29 @@ + + + + + + 123 + Operaciones no sujetas por reglas de localización acogidas a la OSS + all + base + both + + + + + + 126 + Operaciones no sujetas por reglas de localización acogidas a la OSS + all + base + both + + + + diff --git a/l10n_es_aeat_mod303_oss/models/__init__.py b/l10n_es_aeat_mod303_oss/models/__init__.py new file mode 100644 index 00000000000..d2c87b1d2e5 --- /dev/null +++ b/l10n_es_aeat_mod303_oss/models/__init__.py @@ -0,0 +1 @@ +from . import mod303 diff --git a/l10n_es_aeat_mod303_oss/models/mod303.py b/l10n_es_aeat_mod303_oss/models/mod303.py new file mode 100644 index 00000000000..2437b0c9282 --- /dev/null +++ b/l10n_es_aeat_mod303_oss/models/mod303.py @@ -0,0 +1,22 @@ +# Copyright 2021 PESOL - Angel Moya +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0 + +from odoo import models + + +class L10nEsAeatMod303Report(models.Model): + _inherit = "l10n.es.aeat.mod303.report" + + def get_taxes_from_map(self, map_line): + oss_map_lines = [ + self.env.ref("l10n_es_aeat_mod303_oss.aeat_mod303_202107_map_line_123"), + self.env.ref("l10n_es_aeat_mod303_oss.aeat_mod303_202107_map_line_126"), + ] + if map_line in oss_map_lines: + return self.env["account.tax"].search( + [ + ("oss_country_id", "!=", False), + ("company_id", "=", self.company_id.id), + ] + ) + return super(L10nEsAeatMod303Report, self).get_taxes_from_map(map_line) diff --git a/l10n_es_aeat_mod303_oss/readme/CONTRIBUTORS.rst b/l10n_es_aeat_mod303_oss/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000000..fbd0093e909 --- /dev/null +++ b/l10n_es_aeat_mod303_oss/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* Angel Moya diff --git a/l10n_es_aeat_mod303_oss/readme/DESCRIPTION.rst b/l10n_es_aeat_mod303_oss/readme/DESCRIPTION.rst new file mode 100644 index 00000000000..0b655a3cc68 --- /dev/null +++ b/l10n_es_aeat_mod303_oss/readme/DESCRIPTION.rst @@ -0,0 +1,2 @@ +Módulo ampliación del modelo 303 (IVA - Autodeclaración) para +incluir los datos de la ventanilla única o One-Stop Shop (OSS). diff --git a/l10n_es_aeat_mod303_oss/static/description/icon.png b/l10n_es_aeat_mod303_oss/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..8295808f2232647166aa7f80c0d9fa02b2f5ac06 GIT binary patch literal 6750 zcmV-k8lmNhP)xC!sytoxt!6z`_wdx|z1C$#X1{e_3MdVVB0p{qge1GH&_Ecwe zRdrW)5B@%%`g~@pBQm2qsxl)ZBO(QfAaDMeU@iniLhYmv5{y1f9rQ)I1xY51gt*m@ zGt(bY(gJ}nUtq}0K)MA4Bs>buve#Ta08PaV1Y5ycNMee2^u5 zkm50}{UAHtVk8TRD;eNG$#cLuU)o9!8bavEeo$k;KZ9xHoO3XZPkd`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9tZ8$k%Ql7rJ2d<{n`An%m!Tv1U9nErn;QN> z*sN|e*I`@6DQMts)I8e^b;|0QL@#MV!1YAWdvGJ*XAMdB7Rv7#2RNYke^`qR3$KPN{2Em5OEBos|ze_A7 zd%`y0SM*-1$m>g#cPkR@ZD^e`=R_iXn34Lg1)iPTMNZm zM}}R%KTvj#n>~Yk3;%x91A8t$=7lvx4Yjk-|8Q1kL`xewr)|Ma8lD$oa_CVDwN3am zYA&_5`6KoQ-82hrInHG%CusVJbPGSA`MmN9p?v92pp>pN^zvfxn?NDTUN{$@qHv$K z=`3=dsfm8+QYFYtgWVdQM9UA_IYY+U(9gHf?Q+q_SWWwpzVVvCS2l83ujNFqy94Om z$+~L;aE1$+W1 zhfvdnlcKf*M_Kp-sC{tV295P920B93HCr~yfarrVnqr|C{jQTW&RSQFs8x)1Tie`U zr@2=b@Bbhd=mVNnU)eznu^x57g2rS4et-sCY$`5YR2q=MXiJlWcZAa=B{}Q4S#spBLp?jBT_ue3zHm&Q)t~PW# z(N8l$;58ebsT%r9d}*N#qqhwj5$&ZjQ4ueZn2p-kwp*hMRLq+7cdEo|sG+_^H0xo! zVc}m~*>HW-vPGBZwHLMXvH|ra+W{9###j733l*1Uq8`96P&Us#ls*O${SZD)grRE}9pdF0 zgB}L%mkyEFAylZ54jpiI&^TS%3WOGnL?0Rz>-rqMk*2fmV_iQ}H95e}KVf(6C)&EV z4UutkO(FK2(GnStJKpu4sZy&wD( z(FU^JwF7-r4xok$-L8t=wG%ZDyDbJjz}qW=$SD%o7Yzq>+~ zd8i@2ii=sN90TZw3c<}m&1>~5?(abjBg;{n0kiRbG*2(oTiOd{L{wV78!EnJKF)j2 zR&+-Fcs)@=c>|P7aS!ULUX7Z^{)Ico#vcm*58t2U2we?UJOBUy07*qoM6N<$f>+H8 A5C8xG literal 0 HcmV?d00001 diff --git a/l10n_es_aeat_mod303_oss/static/description/icon_source.svg b/l10n_es_aeat_mod303_oss/static/description/icon_source.svg new file mode 100644 index 00000000000..94549c572c1 --- /dev/null +++ b/l10n_es_aeat_mod303_oss/static/description/icon_source.svg @@ -0,0 +1,113 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + 303 + OSS + diff --git a/l10n_es_aeat_mod303_oss/static/description/index.html b/l10n_es_aeat_mod303_oss/static/description/index.html new file mode 100644 index 00000000000..a3bd01729f5 --- /dev/null +++ b/l10n_es_aeat_mod303_oss/static/description/index.html @@ -0,0 +1,420 @@ + + + + + + +AEAT modelo 303 - OSS + + + +
+

AEAT modelo 303 - OSS

+ + +

Beta License: AGPL-3 OCA/l10n-spain Translate me on Weblate Try me on Runbot

+

Módulo ampliación del modelo 303 (IVA - Autodeclaración) para +incluir los datos de la ventanilla única o One-Stop Shop (OSS).

+

Table of contents

+ +
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +feedback.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • PESOL
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

This module is part of the OCA/l10n-spain project on GitHub.

+

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

+
+
+
+ + From 5df45ee97b9d833e716bbbed5dce10a270dd2ee4 Mon Sep 17 00:00:00 2001 From: Rodrigo Date: Mon, 23 Aug 2021 14:48:00 +0200 Subject: [PATCH 02/26] [IMP] l10n_es_aeat_mod303_oss: Add field 124 and 127 --- .../data/tax_code_map_mod303_data.xml | 21 +++++++++++++ l10n_es_aeat_mod303_oss/models/mod303.py | 30 +++++++++++++++++++ .../readme/CONTRIBUTORS.rst | 1 + 3 files changed, 52 insertions(+) diff --git a/l10n_es_aeat_mod303_oss/data/tax_code_map_mod303_data.xml b/l10n_es_aeat_mod303_oss/data/tax_code_map_mod303_data.xml index c53b6b2e431..d67cae61045 100644 --- a/l10n_es_aeat_mod303_oss/data/tax_code_map_mod303_data.xml +++ b/l10n_es_aeat_mod303_oss/data/tax_code_map_mod303_data.xml @@ -1,5 +1,6 @@ @@ -14,6 +15,16 @@ + + + 124 + OSS. Operaciones sujetas y acogidas a la OSS + all + base + both + + + 126 @@ -26,4 +37,14 @@ + + + 127 + OSS. Operaciones sujetas y acogidas a la OSS + all + base + both + + + diff --git a/l10n_es_aeat_mod303_oss/models/mod303.py b/l10n_es_aeat_mod303_oss/models/mod303.py index 2437b0c9282..f5a34aa6555 100644 --- a/l10n_es_aeat_mod303_oss/models/mod303.py +++ b/l10n_es_aeat_mod303_oss/models/mod303.py @@ -1,4 +1,5 @@ # Copyright 2021 PESOL - Angel Moya +# Copyright 2021 FactorLibre - Rodrigo Bonilla # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0 from odoo import models @@ -20,3 +21,32 @@ def get_taxes_from_map(self, map_line): ] ) return super(L10nEsAeatMod303Report, self).get_taxes_from_map(map_line) + + def _get_tax_lines(self, codes, date_start, date_end, map_line): + """Don't populate results for fields 126-127 for reports different from + last of the year one or when not exonerated of presenting model 390. + """ + res = super(L10nEsAeatMod303Report, self)._get_tax_lines( + codes, date_start, date_end, map_line + ) + if 126 <= map_line.field_number <= 127: + if ( + self.exonerated_390 == "2" + or not self.has_operation_volume + or self.period_type not in ("4T", "12") + ): + return self.env["account.move.line"] + return res + + def _get_move_line_domain(self, codes, date_start, date_end, map_line): + """Changes dates to full year when the summary on last report of the + year for the corresponding fields. Only field number is checked as + the complete check for not bringing results is done on + `_get_tax_lines`. + """ + if 126 <= map_line.field_number <= 127: + date_start = date_start[:4] + "-01-01" + date_end = date_end[:4] + "-12-31" + return super(L10nEsAeatMod303Report, self)._get_move_line_domain( + codes, date_start, date_end, map_line, + ) diff --git a/l10n_es_aeat_mod303_oss/readme/CONTRIBUTORS.rst b/l10n_es_aeat_mod303_oss/readme/CONTRIBUTORS.rst index fbd0093e909..dd2415529ee 100644 --- a/l10n_es_aeat_mod303_oss/readme/CONTRIBUTORS.rst +++ b/l10n_es_aeat_mod303_oss/readme/CONTRIBUTORS.rst @@ -1 +1,2 @@ * Angel Moya +* Rodrigo Bonilla From 99c55f6af50ad709b29ae85aab26cd66cd43d990 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Sun, 31 Oct 2021 11:30:07 +0100 Subject: [PATCH 03/26] [MIG+IMP] l10n_es_aeat_mod303_oss: Migration to 13.0 + tests - Standard procedure. - Add tests for full coverage. - Fix compatibility with `l10n_es_aeat_vat_prorrate` due to a problem with ormcache and virtual records. --- l10n_es_aeat_mod303_oss/README.rst | 15 ++-- l10n_es_aeat_mod303_oss/__manifest__.py | 5 +- l10n_es_aeat_mod303_oss/models/mod303.py | 30 ++++---- .../readme/CONTRIBUTORS.rst | 3 + .../static/description/index.html | 14 ++-- l10n_es_aeat_mod303_oss/tests/__init__.py | 1 + .../tests/test_l10n_es_aeat_mod303_oss.py | 72 +++++++++++++++++++ 7 files changed, 112 insertions(+), 28 deletions(-) create mode 100644 l10n_es_aeat_mod303_oss/tests/__init__.py create mode 100644 l10n_es_aeat_mod303_oss/tests/test_l10n_es_aeat_mod303_oss.py diff --git a/l10n_es_aeat_mod303_oss/README.rst b/l10n_es_aeat_mod303_oss/README.rst index 6919fcbd63d..c774e4d8a36 100644 --- a/l10n_es_aeat_mod303_oss/README.rst +++ b/l10n_es_aeat_mod303_oss/README.rst @@ -14,13 +14,13 @@ AEAT modelo 303 - OSS :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fl10n--spain-lightgray.png?logo=github - :target: https://github.com/OCA/l10n-spain/tree/12.0/l10n_es_aeat_mod303_oss + :target: https://github.com/OCA/l10n-spain/tree/13.0/l10n_es_aeat_mod303_oss :alt: OCA/l10n-spain .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/l10n-spain-12-0/l10n-spain-12-0-l10n_es_aeat_mod303_oss + :target: https://translation.odoo-community.org/projects/l10n-spain-13-0/l10n-spain-13-0-l10n_es_aeat_mod303_oss :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/189/12.0 + :target: https://runbot.odoo-community.org/runbot/189/13.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -39,7 +39,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -50,11 +50,16 @@ Authors ~~~~~~~ * PESOL +* Tecnativa Contributors ~~~~~~~~~~~~ * Angel Moya +* Rodrigo Bonilla +* `Tecnativa `__: + + * Pedro M. Baeza Maintainers ~~~~~~~~~~~ @@ -69,6 +74,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -This module is part of the `OCA/l10n-spain `_ project on GitHub. +This module is part of the `OCA/l10n-spain `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/l10n_es_aeat_mod303_oss/__manifest__.py b/l10n_es_aeat_mod303_oss/__manifest__.py index 8cff813da3c..4bb3ddbfb36 100644 --- a/l10n_es_aeat_mod303_oss/__manifest__.py +++ b/l10n_es_aeat_mod303_oss/__manifest__.py @@ -1,11 +1,12 @@ # Copyright 2021 PESOL - Angel Moya +# Copyright 2021 Tecnativa - Pedro M. Baeza # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0 { "name": "AEAT modelo 303 - OSS", - "version": "11.0.1.0.0", + "version": "13.0.1.0.0", "category": "Accounting", - "author": "PESOL, Odoo Community Association (OCA)", + "author": "PESOL, Tecnativa, Odoo Community Association (OCA)", "website": "https://github.com/OCA/l10n-spain", "license": "AGPL-3", "depends": ["l10n_es_aeat_mod303", "l10n_eu_oss"], diff --git a/l10n_es_aeat_mod303_oss/models/mod303.py b/l10n_es_aeat_mod303_oss/models/mod303.py index f5a34aa6555..a105ba6f0df 100644 --- a/l10n_es_aeat_mod303_oss/models/mod303.py +++ b/l10n_es_aeat_mod303_oss/models/mod303.py @@ -1,5 +1,6 @@ # Copyright 2021 PESOL - Angel Moya # Copyright 2021 FactorLibre - Rodrigo Bonilla +# Copyright 2021 Tecnativa - Pedro M. Baeza # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0 from odoo import models @@ -20,16 +21,14 @@ def get_taxes_from_map(self, map_line): ("company_id", "=", self.company_id.id), ] ) - return super(L10nEsAeatMod303Report, self).get_taxes_from_map(map_line) + return super().get_taxes_from_map(map_line) - def _get_tax_lines(self, codes, date_start, date_end, map_line): + def _get_tax_lines(self, date_start, date_end, map_line): """Don't populate results for fields 126-127 for reports different from last of the year one or when not exonerated of presenting model 390. """ - res = super(L10nEsAeatMod303Report, self)._get_tax_lines( - codes, date_start, date_end, map_line - ) - if 126 <= map_line.field_number <= 127: + res = super()._get_tax_lines(date_start, date_end, map_line) + if map_line.field_number in (126, 127): if ( self.exonerated_390 == "2" or not self.has_operation_volume @@ -38,15 +37,12 @@ def _get_tax_lines(self, codes, date_start, date_end, map_line): return self.env["account.move.line"] return res - def _get_move_line_domain(self, codes, date_start, date_end, map_line): - """Changes dates to full year when the summary on last report of the - year for the corresponding fields. Only field number is checked as - the complete check for not bringing results is done on - `_get_tax_lines`. + def _get_move_line_domain(self, date_start, date_end, map_line): + """Change dates to full year when the summary on last report of the year for the + corresponding fields. Only field number is checked as the complete check for not + bringing results is done on `_get_tax_lines`. """ - if 126 <= map_line.field_number <= 127: - date_start = date_start[:4] + "-01-01" - date_end = date_end[:4] + "-12-31" - return super(L10nEsAeatMod303Report, self)._get_move_line_domain( - codes, date_start, date_end, map_line, - ) + if map_line.field_number in (126, 127): + date_start = date_start.replace(day=1, month=1) + date_end = date_end.replace(day=31, month=12) + return super()._get_move_line_domain(date_start, date_end, map_line) diff --git a/l10n_es_aeat_mod303_oss/readme/CONTRIBUTORS.rst b/l10n_es_aeat_mod303_oss/readme/CONTRIBUTORS.rst index dd2415529ee..464061e2f5e 100644 --- a/l10n_es_aeat_mod303_oss/readme/CONTRIBUTORS.rst +++ b/l10n_es_aeat_mod303_oss/readme/CONTRIBUTORS.rst @@ -1,2 +1,5 @@ * Angel Moya * Rodrigo Bonilla +* `Tecnativa `__: + + * Pedro M. Baeza diff --git a/l10n_es_aeat_mod303_oss/static/description/index.html b/l10n_es_aeat_mod303_oss/static/description/index.html index a3bd01729f5..04a6f1562c1 100644 --- a/l10n_es_aeat_mod303_oss/static/description/index.html +++ b/l10n_es_aeat_mod303_oss/static/description/index.html @@ -3,7 +3,7 @@ - + AEAT modelo 303 - OSS