From 288d9d4929d8ebb9cca40789b2395fe0a5ed2ca1 Mon Sep 17 00:00:00 2001 From: Eric Antones Date: Thu, 24 Nov 2022 17:44:25 +0100 Subject: [PATCH 1/9] [ADD] l10n_es_aeat_sii_oca_extension: New module --- l10n_es_aeat_sii_oca_extension/README.rst | 31 +++++++ l10n_es_aeat_sii_oca_extension/__init__.py | 1 + .../__manifest__.py | 19 ++++ .../models/__init__.py | 1 + .../models/account_move.py | 85 ++++++++++++++++++ .../static/description/icon.png | Bin 0 -> 6342 bytes 6 files changed, 137 insertions(+) create mode 100644 l10n_es_aeat_sii_oca_extension/README.rst create mode 100644 l10n_es_aeat_sii_oca_extension/__init__.py create mode 100644 l10n_es_aeat_sii_oca_extension/__manifest__.py create mode 100644 l10n_es_aeat_sii_oca_extension/models/__init__.py create mode 100644 l10n_es_aeat_sii_oca_extension/models/account_move.py create mode 100644 l10n_es_aeat_sii_oca_extension/static/description/icon.png diff --git a/l10n_es_aeat_sii_oca_extension/README.rst b/l10n_es_aeat_sii_oca_extension/README.rst new file mode 100644 index 000000000..ca8dadca6 --- /dev/null +++ b/l10n_es_aeat_sii_oca_extension/README.rst @@ -0,0 +1,31 @@ +.. image:: https://img.shields.io/badge/license-AGPL--3-blue.png + :target: https://www.gnu.org/licenses/agpl + :alt: License: AGPL-3 + +======================================================= +Suministro Inmediato de Información en el IVA Extension +======================================================= + +This module extends the OCA SII module with new functionalities +and fixes that are not accepted or delayed recurrently by +the OCA l10n_spain localization community. + + * Added support for **BaseImponibleACoste** key when + **ClaveRegimenEspecialOTranscedencia = "06"** + * Added support for **CuotaDeducible** key for a partially deductible taxes + +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. + +Credits +======= + +Contributors +------------ + +* Eric Antones diff --git a/l10n_es_aeat_sii_oca_extension/__init__.py b/l10n_es_aeat_sii_oca_extension/__init__.py new file mode 100644 index 000000000..0650744f6 --- /dev/null +++ b/l10n_es_aeat_sii_oca_extension/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/l10n_es_aeat_sii_oca_extension/__manifest__.py b/l10n_es_aeat_sii_oca_extension/__manifest__.py new file mode 100644 index 000000000..214d7864a --- /dev/null +++ b/l10n_es_aeat_sii_oca_extension/__manifest__.py @@ -0,0 +1,19 @@ +# Copyright NuoBiT Solutions, S.L. () +# Eric Antones +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) + +{ + "name": "Suministro Inmediato de Información en el IVA Extension", + "summary": "This module extends the OCA SII module with new functionalities " + "and fixes that are not accepted or delayed recurrently by " + "the OCA l10n_spain localization community", + "author": "NuoBiT Solutions, S.L.", + "category": "Accounting & Finance", + "version": "14.0.1.0.0", + "license": "AGPL-3", + "website": "https://github.com/nuobit/odoo-addons", + "depends": [ + "l10n_es_aeat_sii_oca", + ], + "installable": True, +} diff --git a/l10n_es_aeat_sii_oca_extension/models/__init__.py b/l10n_es_aeat_sii_oca_extension/models/__init__.py new file mode 100644 index 000000000..9c0a42138 --- /dev/null +++ b/l10n_es_aeat_sii_oca_extension/models/__init__.py @@ -0,0 +1 @@ +from . import account_move diff --git a/l10n_es_aeat_sii_oca_extension/models/account_move.py b/l10n_es_aeat_sii_oca_extension/models/account_move.py new file mode 100644 index 000000000..929e9cb26 --- /dev/null +++ b/l10n_es_aeat_sii_oca_extension/models/account_move.py @@ -0,0 +1,85 @@ +# Copyright NuoBiT Solutions, S.L. () +# Eric Antones +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) + +from odoo import models + +from odoo.addons.l10n_es_aeat_sii_oca.models.account_move import round_by_keys + + +def sum_key(elem, key): + value = 0 + if isinstance(elem, (list, tuple)): + for v in elem: + value += sum_key(v, key) + elif isinstance(elem, dict): + for k, v in elem.items(): + value += v if k == key else sum_key(v, key) + return value + + +class AccountMove(models.Model): + _inherit = "account.move" + + def _get_aeat_tax_base_info(self, res, tax, line, sign): + super()._get_aeat_tax_base_info(res, tax, line, sign) + for tax in res.keys(): + res[tax].setdefault("deductible_amount", 0) + + def _get_aeat_tax_quote_info(self, res, tax, line, sign): + super()._get_aeat_tax_quote_info(res, tax, line, sign) + res[tax].setdefault("deductible_amount", 0) + if line.tax_repartition_line_id.account_id: + res[tax]["deductible_amount"] += line.balance * sign + + def _get_sii_in_taxes_deductible(self): + self.ensure_one() + taxes_sfrs = self._get_sii_taxes_map(["SFRS"]) + taxes_sfrisp = self._get_sii_taxes_map(["SFRISP"]) + tax_deductible_amount = 0.0 + tax_lines = self._get_aeat_tax_info() + for tax_line in tax_lines.values(): + tax = tax_line["tax"] + if tax in taxes_sfrisp + taxes_sfrs: + tax_deductible_amount += tax_line["deductible_amount"] + return tax_deductible_amount + + def _get_sii_invoice_dict_in(self, cancel=False): + inv_dict = super()._get_sii_invoice_dict_in(cancel=cancel) + if not cancel: + inv_dict["FacturaRecibida"][ + "CuotaDeducible" + ] = self._get_sii_in_taxes_deductible() + if "06" in ( + self.sii_registration_key.code, + self.sii_registration_key_additional1.code, + self.sii_registration_key_additional2.code, + ): + inv_dict["FacturaRecibida"]["BaseImponibleACoste"] = sum_key( + inv_dict["FacturaRecibida"]["DesgloseFactura"], + "BaseImponible", + ) + return inv_dict + + def _get_sii_invoice_dict_out(self, cancel=False): + inv_dict = super()._get_sii_invoice_dict_out(cancel=cancel) + if not cancel: + if "06" in ( + self.sii_registration_key.code, + self.sii_registration_key_additional1.code, + self.sii_registration_key_additional2.code, + ): + inv_dict["FacturaExpedida"]["BaseImponibleACoste"] = sum_key( + inv_dict["FacturaExpedida"]["TipoDesglose"], "BaseImponible" + ) + return inv_dict + + def _get_sii_invoice_dict(self): + inv_dict = super()._get_sii_invoice_dict() + round_by_keys( + inv_dict, + [ + "BaseImponibleACoste", + ], + ) + return inv_dict diff --git a/l10n_es_aeat_sii_oca_extension/static/description/icon.png b/l10n_es_aeat_sii_oca_extension/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..1cd641e792c30455187ca30940bc0f329ce8bbb0 GIT binary patch literal 6342 zcmd^^hf`C}*TzHWpfm-MZa|7OjYtjE(4`3pP0Eid3J8V{0s)mKJ<q zp^9|rp$mb~2}po9-@oIXJG(oxcjoS%d!O@s&d!Z9HP*e##KQyt0IurmK_64bp8pyH z9i^|ds>-JfbWVo4P{8GX*QeIfbjl2)kDfIG0ALvZuTgp2ZfK=U();NfY11z-vM>r= zo6RyI007+P`cO@apy}VqnaiVCLL`CEUGVGYE&5WpdhhbZv%|*-Y|2t(4~Cq|y`-Nmm-W zxaTf4+R69rVU1b%qjm?yu*PFgHFYd#J82-D8cpXqO&omwG2*Hd6ZIUiK@+ zNCo8Lg{1^vn^0ZQgz*~*ZR3wsULxnnSBN%7p()3EYs>sX9In)T{*nJ2q*qxXPNhFk z=z=+?4VOOdAF!ZYAVisYzF29g?udLQJtx@=HoAK_Kjx;4SO7>H_v*McB7(}RHMa> z+PNao{Hw&Mjo0P}CBR&l(k@iIeRI@PRH6R9^lR3e?TL?ZHra#GHvKmkeVBHG8nv4{ zz$nHGR7`D$ae@TrcXCSA=$~Yvp@J|bKul>6s-`yT7>JaM5?KcltZ)(ilt^74fqLA{ z1k!bKw(GMV*AOgI*glG_($h!cZgArkEAa1SkSG`0yF8JLWTq^J->2CRaqKH1ZSQt7 z29|+OBS3Rj91K1XL~_9&zn1p z)2Ez)&{9Of1X#b+mpgJ`{gurrlYqKrwrWXTOH{M%kEUhcgSp1J2FK4FF`JS|NfaAA6)?-&1}B`@lI2~kKWK) zhQ|}GQ$j(rNS}9?Yu9}MzWxz*HMwR=u8$RYY6sr2pu3x5Yx*P!Z&c|X zFZcC{+kqJV=XTZH=cMb6)MtgWo%C~XU8TEXDKx9;0hEV*74Z6i8vuzXp zw<8QvI~;n;3@<^G0C#HHf2{N6E~2DO3jw!?w}z?_vV6Q>?kJ>IF-kEc*TtP}k7cVd zvtdPgQ^jWhMXAL$Lqn!_A_IL+!hbY37)n@Sqc)6JwD4)3LP`up1cy^EXzh>B{$ce0 zgX~Iat{I@DM|zU|>9DuD?g}h7zCqV;o1*~3Hr=DYjDq;SG?3HS)(x+l@HAa-@>5wH zhw`oqg>hP$e41h5)>$#qFWq?LGX`dC8ph`RyR&_z&og>psSHzZ=_8<-M4yk+3HK-+ zxqe%Ntx88}49jJazM_Vov;)83cSeeLv@taHOL>zP>~bqdmEyfHl9M%`@ivb|7{I;N zzyHw9P7EH0$ww52RejJv>zvSr8v*iuX@X;(Z~NuUv$D0I_>OkcZWSulBUJjHUN=n| zSI$q@$)`(E;^(|}q|2utYl8}>IcXkPX#{6Z%JnhUBly1B@B}sECm2Y88-QrQZd2n2 zKL=1_&Z87xM=GaycA-Ac*R<^bJk>-^k%lt;DjswC+AM`71*2iG?;!3Bc)I>55v)^C zkt+Uzn&dhv|58XAY6{%ybSiVMl-sATTy=SUADQWD+(@-AVqg@Y+_fBV$LJnIEfujI4B5%4a@8S4M*50Lh7NqKSW>K=U5dW@)Hd{^oR4v% zCM2(rAq7Qe-)R0ko{l@iCHGsxhkCNWby zf&gByp!>=?r1ecWMqz5e-BmOED6n!_1V4<)R!!QNwM!AyGty8>p>ebEzdp*_(kAYA z5*F^g_K}%Rm;V}4Q46qJpU+&3bU10WYg{j`T>lv9{B)J}RHC}yzy9x)wm4ju23yQ& zUNm(i_(ChqD8d7AVUFMw zXmia0A{l#}Sfq!GmHjatiTk$f|OvS0iG>W{p<8cZu^6HX`rMuX?l8<+?WVAW6 z3!MLV*VOFpd&STaeN2qdwU* zk1ni(wdh{`{hLj-hCz&59jVIp~SmgtSQDf!FrPYKIF6_c_NJr zn<-BdXVU}OSE{-No~b(6tG)250`-S%YB9Si@&}{d@FUGqjcNE@SlSdG`}H-#!~M1& z;{E-SKUBb6)KwP1XB|S8MB=F>9k$#1$|^*t%%5zq#(35~S#+TgC^oj&COt~T>axhU0t zQff{8Jt+NH^_pqPzec@Iv#L^r?qs$jdiCY&xOU2pve78Pc{a8y+D;2N0aEJe5d#uL}ZkkYQ&XA;NK5v>r@NUaj=<_V$*Ll@&CF!{LWI zh@|EE!!M(B5qeQ40YHy86TVkX6Te=v4ytV_-JnKl93#Z9clghd^lywoBtgj)4%mxKR<#pH0*hxyHFQNJ zGW`7CtD9C6)ehKni=#!gKj#ZO7L$d_i4nJZhR!z$B(rX9j$$L8X1>~^2By%Dp*IJj z8QiI6*w*|IoF{UpFaD{!PWdOxja{DQq9?BK%2(Xuh#Tv2s_ELIvb@YAd{Af)Lph(9 z>DTXZ`|*!Jnw)?`BzPrdYx(?S2&<(1>1>-f=c}gi8^)=KW973rikh?!-B$fOy@x-Rd+?x= zM(0SbmCz!gY#)CqB9J_^v4K$urOnoj|E||~D>%ndVMwe)ef3BuZH0l!Z&M@fyN}{1 zD;n{juZF|*{lehy$NlM{B`Q0Z18O|&=wX!Nt*rLKfak}ww{ zJ$9BJA3Tq4n~%w3V$0UA(+PgZ#j-35$=_xzuk(w5o2f(WOCu%+h>cg3B*aqaQdfeQ zj@VutKTWtH8{S+}vR3Z`KIQl-h!4tFi1vG-Kuh^Lb0N=LN0+1ZP!WL39=Age)HS_E z8khUbE>xA^59Nmj`B0@u0IR<04wqF@ssF4AP6ZVhslN61xT#8o@ymhOWJ5zkUQN07 zyDEYVZ4#Z$(%wnd04Y_^B_4gjFoKPWgD&OUsj^ezcuXa}E4yjc@xi#az zyRy6>?#h2*VNdNO_jYQ1{@qaYoN7moT}cnd8cmK*&R@SeSYZgIBaJklh!n-3#3dyO z!@*@06=Y8#wl9|Bj3=C0Fi!SfzVz7$Stc4_Q`K2P?2|gT!JIBhc*P&-IkB?Mb5I&% z%BN*TF#vYzIW>)|=X`Chr};G5EZXg?_yvlDC|f%AP!ty{i{{pXQnHm<^|{P$D; z9ZAW#l9Cd2($R5@*5}FeUd#l;N11WwITb1nJSm8r@`#sXHPsuq!3S2&h>U)y=3MjV;j3oWLY>5EOvuruXC*WH2G){378-0tpcMF}1(^PSWUe>XEJN%5 zl|m59cX=GC{^$_E-4Wm1=5|!;Ek&{<4lIOt5M&GMq=+JQdyt?WI#6C!)i!s4;k9T0 z{;`B*>VQ%iU)>Zbhgb4|vd=Wy4>107#gyeqi^+-^2E~0Ja&rFpRb<)oirMj4-KuLg zSo1*y98TZlD<3^A&^bRESh~S*Lzqn0l;JfX-fdjA`M#a!@?b?zWdEr3mIiqS{m2J% z3nWGoQG6+FQ~&gQF-DLGWF}WfwHL(4$EUt(5Jcx#l79K-x~qdu!_gs;XaP0`8m(8a z2J#B{UvEhLT=w9*(6bFWp{9CI=Z&Hh)e}}1hnK6fPlSYqu4H|>g|Erg5fVWl5w&~Kdf{3+V{dCaNhFDg<~sELf1dC($hw|SmSkZ zKD6>nsj6Q+aHEZDHC9{UJxPZ9y{6)F5hg5bm*}ihsxQxj~`xNo%QnaTEJn)f#{CK-H5HYAM7kK zL!XvElM^Y!yC=uSu54Gj zTEgKhtTCOqx1EcIl=VA7`!xLiUj%p*eH??_??@gOJJxVX)#(G`=31lw3whFi2Y7Mq z1bXLvi+~U5E4R{v15H@yQI@=d!V9LD&P!p?0u7L&Rg=D<<*+ zouj?2?aYI{Ac%Gx!r&EkXmmvR`!Xl?06WsGs_Ts8ojW?id!X$>C}@~q>BMfGeGohw zkR}NImw2grp7>W(5s*(iPYn$1*t@i%(W7u#6m}l)%TmD-221>N?VBna!@FO-7!xjM z{`_^-yt<@e?fK$Sqzc7O%3&~A>HB|stQr64jx(U3y+}d}vp(r7c=iB8>t~T7HmYg1qJe4SLo$e62=EZUuFS7UqbSP}M^@%aI7g!ztzj{)_R0x*X6OMLAky)_Sv&%2DNGv zxH}pEr{gEYf&ZF&RJoII9*=yd^~fxKtFc@1f_3}Vqqi8_U?;lC`7etN$3$u0dW+-%7P zQ~iX&gr(5xd1M>3yrzZav9ZLIhbS&|=U$t!9iq*i5vy)(RsBw0TU#?~zdTKUXjyIl z%7Q)Vp}YoU$acz-9y_`%Oig!%TPyC=ie3*Qut3@4V`+A4d<*f%jOx>*bX%#Ao+@wM z;NW0DZKvmp%_oxvFw2#S9r8Sc?wXh}`3gVG`rBKr&jpxwTRQ7WtKY06QQVhs$u$!e zs;Y%~2xwpH*9vxfQ~q#gAwn+P+=YE(L>|P(Fl&H27@?);kUI4FW%LjHZKYGk#f~@3 zXW;a;3+{&c`g+uCR+``$V9)N#RBCk_#RQ(K-PxlQ7Ym;XdCqGn$j%JmAwgtkWKn1} z8^>3&)Q05VbBm+t`9B_${w9F7WfM{Jvawk;HDc*{Sa_Sla|zqX!vbKV%>gB|z6BCc z8_bdnPnzloGP1I)!^5hnC6CLZUU`;nO2NF2)FaAkYhQL$Z58+`p75dj7RKse#Z!uacCm z0@|m~U!QZOdb|V~`ktFK4;lg_ZOCjFXeV4`jGj&bh7Q6BEyN8~yGd*JyzwFbIRaAf z#KG$rvQxWFvqwn`i6jBQ?6o+k+oOC)Gj9ChlgabiScr};b5|opxUYjCZOwmhjTj6W zFzJt_htTuopW4IRiQ}r0L}`w=pE{HN<@(9Hl11P5cHmN6A1F^sg2OWXcw<+q2x>I5 zq9Bu>PBob6#^vrr<|IC)m+zJpFRRcCVsqbspNybriu&!R=H^@RcG#aBGz9RH}ZI=>4 zi(m?IA?Vr$Q7?wN6ZW7H`S?3}K8=$7J5MjWKri=_igw1%J?0~*6e_Ii*1&23dGcF} z&=vaMgF!^veGQ1f$3k?WK5Jaw%==+Bb!tI6zQ68&-dQ3Orl+Tqh#Nt?dBEV_w^wkjY+qJ+X*NCMs%J-Lc4%}pKryM#O)O&9 un*HHVB-AlUN`suyDkKONktc!@Ievk;6wT20MOSqhE{1gM*SZGeqiYU literal 0 HcmV?d00001 From c65d5436318c2a340e4bcb22c736fa9ef68002af Mon Sep 17 00:00:00 2001 From: Eric Antones Date: Thu, 24 Nov 2022 22:05:41 +0100 Subject: [PATCH 2/9] [IMP] l10n_es_aeat_sii_oca_extension: Added hook to allow adding new Agencies --- l10n_es_aeat_sii_oca_extension/README.rst | 2 + .../__manifest__.py | 6 +-- .../models/__init__.py | 1 + .../models/aeat_tax_agency.py | 40 +++++++++++++++++++ 4 files changed, 46 insertions(+), 3 deletions(-) create mode 100644 l10n_es_aeat_sii_oca_extension/models/aeat_tax_agency.py diff --git a/l10n_es_aeat_sii_oca_extension/README.rst b/l10n_es_aeat_sii_oca_extension/README.rst index ca8dadca6..2a596eb05 100644 --- a/l10n_es_aeat_sii_oca_extension/README.rst +++ b/l10n_es_aeat_sii_oca_extension/README.rst @@ -13,6 +13,7 @@ the OCA l10n_spain localization community. * Added support for **BaseImponibleACoste** key when **ClaveRegimenEspecialOTranscedencia = "06"** * Added support for **CuotaDeducible** key for a partially deductible taxes + * Added hooks to allow extending the Agencies Bug Tracker =========== @@ -29,3 +30,4 @@ Contributors ------------ * Eric Antones +* Kilian Niubo diff --git a/l10n_es_aeat_sii_oca_extension/__manifest__.py b/l10n_es_aeat_sii_oca_extension/__manifest__.py index 214d7864a..30d99d28f 100644 --- a/l10n_es_aeat_sii_oca_extension/__manifest__.py +++ b/l10n_es_aeat_sii_oca_extension/__manifest__.py @@ -1,5 +1,5 @@ -# Copyright NuoBiT Solutions, S.L. () -# Eric Antones +# Copyright NuoBiT - Eric Antones +# Copyright NuoBiT - Kilian Niubo # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) { @@ -9,7 +9,7 @@ "the OCA l10n_spain localization community", "author": "NuoBiT Solutions, S.L.", "category": "Accounting & Finance", - "version": "14.0.1.0.0", + "version": "14.0.1.0.1", "license": "AGPL-3", "website": "https://github.com/nuobit/odoo-addons", "depends": [ diff --git a/l10n_es_aeat_sii_oca_extension/models/__init__.py b/l10n_es_aeat_sii_oca_extension/models/__init__.py index 9c0a42138..5f984201c 100644 --- a/l10n_es_aeat_sii_oca_extension/models/__init__.py +++ b/l10n_es_aeat_sii_oca_extension/models/__init__.py @@ -1 +1,2 @@ from . import account_move +from . import aeat_tax_agency diff --git a/l10n_es_aeat_sii_oca_extension/models/aeat_tax_agency.py b/l10n_es_aeat_sii_oca_extension/models/aeat_tax_agency.py new file mode 100644 index 000000000..42c94bcf4 --- /dev/null +++ b/l10n_es_aeat_sii_oca_extension/models/aeat_tax_agency.py @@ -0,0 +1,40 @@ +# Copyright NuoBiT - Kilian Niubo +# Copyright NuoBiT - Eric Antones +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import models + +from odoo.addons.l10n_es_aeat_sii_oca.models.aeat_tax_agency import ( + SII_PORT_NAME_MAPPING, + SII_WDSL_MAPPING, +) + + +class AeatTaxAgency(models.Model): + _inherit = "aeat.tax.agency" + + def _prepare_sii_wdsl_mapping(self): + return SII_WDSL_MAPPING + + def _prepare_sii_port_name_mapping(self): + return SII_PORT_NAME_MAPPING + + def _connect_params_sii(self, mapping_key, company): + self.ensure_one() + if SII_WDSL_MAPPING.get(mapping_key) and SII_PORT_NAME_MAPPING.get(mapping_key): + return super()._connect_params_sii(mapping_key, company) + sii_wdsl_mapping = self._prepare_sii_wdsl_mapping() + sii_port_name_mapping = self._prepare_sii_port_name_mapping() + + wsdl_field = sii_wdsl_mapping[mapping_key] + wsdl_test_field = wsdl_field + "_test_address" + port_name = sii_port_name_mapping[mapping_key] + address = getattr(self, wsdl_test_field) if company.sii_test else False + if not address and company.sii_test: + # If not test address is provides we try to get it using the port name. + port_name += "Pruebas" + return { + "wsdl": getattr(self, wsdl_field), + "address": address, + "port_name": port_name, + } From fdfefeee196dded7a31f5ccc18e19e1021eaaa59 Mon Sep 17 00:00:00 2001 From: Eric Antones Date: Tue, 18 Apr 2023 22:25:56 +0200 Subject: [PATCH 3/9] [FIX] l10n_es_aeat_sii_oca_extension: adapt to changes on parent module l10n_es_aeat_sii_oca --- .../__manifest__.py | 2 +- .../models/account_move.py | 28 +++++++++++-------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/l10n_es_aeat_sii_oca_extension/__manifest__.py b/l10n_es_aeat_sii_oca_extension/__manifest__.py index 30d99d28f..aed963fba 100644 --- a/l10n_es_aeat_sii_oca_extension/__manifest__.py +++ b/l10n_es_aeat_sii_oca_extension/__manifest__.py @@ -9,7 +9,7 @@ "the OCA l10n_spain localization community", "author": "NuoBiT Solutions, S.L.", "category": "Accounting & Finance", - "version": "14.0.1.0.1", + "version": "14.0.1.0.2", "license": "AGPL-3", "website": "https://github.com/nuobit/odoo-addons", "depends": [ diff --git a/l10n_es_aeat_sii_oca_extension/models/account_move.py b/l10n_es_aeat_sii_oca_extension/models/account_move.py index 929e9cb26..a79a0a1d8 100644 --- a/l10n_es_aeat_sii_oca_extension/models/account_move.py +++ b/l10n_es_aeat_sii_oca_extension/models/account_move.py @@ -21,17 +21,6 @@ def sum_key(elem, key): class AccountMove(models.Model): _inherit = "account.move" - def _get_aeat_tax_base_info(self, res, tax, line, sign): - super()._get_aeat_tax_base_info(res, tax, line, sign) - for tax in res.keys(): - res[tax].setdefault("deductible_amount", 0) - - def _get_aeat_tax_quote_info(self, res, tax, line, sign): - super()._get_aeat_tax_quote_info(res, tax, line, sign) - res[tax].setdefault("deductible_amount", 0) - if line.tax_repartition_line_id.account_id: - res[tax]["deductible_amount"] += line.balance * sign - def _get_sii_in_taxes_deductible(self): self.ensure_one() taxes_sfrs = self._get_sii_taxes_map(["SFRS"]) @@ -41,7 +30,7 @@ def _get_sii_in_taxes_deductible(self): for tax_line in tax_lines.values(): tax = tax_line["tax"] if tax in taxes_sfrisp + taxes_sfrs: - tax_deductible_amount += tax_line["deductible_amount"] + tax_deductible_amount += tax_line["actual_deductible_amount"] return tax_deductible_amount def _get_sii_invoice_dict_in(self, cancel=False): @@ -83,3 +72,18 @@ def _get_sii_invoice_dict(self): ], ) return inv_dict + + +class AccountMoveLine(models.Model): + _inherit = "account.move.line" + + def _process_aeat_tax_base_info(self, res, tax, sign): + super()._process_aeat_tax_base_info(res, tax, sign) + for tax in res.keys(): + res[tax].setdefault("actual_deductible_amount", 0) + + def _process_aeat_tax_fee_info(self, res, tax, sign): + super()._process_aeat_tax_fee_info(res, tax, sign) + res[tax].setdefault("atual_deductible_amount", 0) + if self.tax_repartition_line_id.account_id: + res[tax]["actual_deductible_amount"] += self.balance * sign From 6450a9fe9fec6876daaa53a0276dd9b7847a06f3 Mon Sep 17 00:00:00 2001 From: Eric Antones Date: Tue, 18 Apr 2023 23:19:16 +0200 Subject: [PATCH 4/9] [FIX] l10n_es_aeat_sii_oca_extension: fix typo on actual deductible amount --- l10n_es_aeat_sii_oca_extension/__manifest__.py | 2 +- l10n_es_aeat_sii_oca_extension/models/account_move.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/l10n_es_aeat_sii_oca_extension/__manifest__.py b/l10n_es_aeat_sii_oca_extension/__manifest__.py index aed963fba..a798ebee4 100644 --- a/l10n_es_aeat_sii_oca_extension/__manifest__.py +++ b/l10n_es_aeat_sii_oca_extension/__manifest__.py @@ -9,7 +9,7 @@ "the OCA l10n_spain localization community", "author": "NuoBiT Solutions, S.L.", "category": "Accounting & Finance", - "version": "14.0.1.0.2", + "version": "14.0.1.0.3", "license": "AGPL-3", "website": "https://github.com/nuobit/odoo-addons", "depends": [ diff --git a/l10n_es_aeat_sii_oca_extension/models/account_move.py b/l10n_es_aeat_sii_oca_extension/models/account_move.py index a79a0a1d8..57be1a1ab 100644 --- a/l10n_es_aeat_sii_oca_extension/models/account_move.py +++ b/l10n_es_aeat_sii_oca_extension/models/account_move.py @@ -84,6 +84,6 @@ def _process_aeat_tax_base_info(self, res, tax, sign): def _process_aeat_tax_fee_info(self, res, tax, sign): super()._process_aeat_tax_fee_info(res, tax, sign) - res[tax].setdefault("atual_deductible_amount", 0) + res[tax].setdefault("actual_deductible_amount", 0) if self.tax_repartition_line_id.account_id: res[tax]["actual_deductible_amount"] += self.balance * sign From ca0673d6ea959162f84abdabf9c5d53b5c389369 Mon Sep 17 00:00:00 2001 From: Eric Antones Date: Wed, 6 Nov 2024 17:26:31 +0100 Subject: [PATCH 5/9] [IMP] l10n_es_aet_sii_oca_extension: added new exempt tax in mapping --- l10n_es_aeat_sii_oca_extension/README.rst | 60 ++- .../__manifest__.py | 5 +- .../data/aeat_sii_map_data.xml | 13 + .../readme/CONTRIBUTORS.rst | 4 + .../readme/DESCRIPTION.rst | 8 + .../static/description/index.html | 431 ++++++++++++++++++ 6 files changed, 509 insertions(+), 12 deletions(-) create mode 100644 l10n_es_aeat_sii_oca_extension/data/aeat_sii_map_data.xml create mode 100644 l10n_es_aeat_sii_oca_extension/readme/CONTRIBUTORS.rst create mode 100644 l10n_es_aeat_sii_oca_extension/readme/DESCRIPTION.rst create mode 100644 l10n_es_aeat_sii_oca_extension/static/description/index.html diff --git a/l10n_es_aeat_sii_oca_extension/README.rst b/l10n_es_aeat_sii_oca_extension/README.rst index 2a596eb05..7d8746b71 100644 --- a/l10n_es_aeat_sii_oca_extension/README.rst +++ b/l10n_es_aeat_sii_oca_extension/README.rst @@ -1,11 +1,27 @@ -.. image:: https://img.shields.io/badge/license-AGPL--3-blue.png - :target: https://www.gnu.org/licenses/agpl - :alt: License: AGPL-3 - ======================================================= Suministro Inmediato de Información en el IVA Extension ======================================================= +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:2cca496fee278e998d82cdf022942a917f81e1dd13af84d7fc16e5b173d55bb3 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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-NuoBiT%2Fodoo--addons-lightgray.png?logo=github + :target: https://github.com/NuoBiT/odoo-addons/tree/14.0/l10n_es_aeat_sii_oca_extension + :alt: NuoBiT/odoo-addons + +|badge1| |badge2| |badge3| + This module extends the OCA SII module with new functionalities and fixes that are not accepted or delayed recurrently by the OCA l10n_spain localization community. @@ -15,19 +31,41 @@ the OCA l10n_spain localization community. * Added support for **CuotaDeducible** key for a partially deductible taxes * Added hooks to allow extending the Agencies +**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. +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 to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. Credits ======= +Authors +~~~~~~~ + +* NuoBiT Solutions +* S.L. + Contributors ------------- +~~~~~~~~~~~~ + +* `NuoBiT `_: + + * Eric Antones + * Kilian Niubo + +Maintainers +~~~~~~~~~~~ + +This module is part of the `NuoBiT/odoo-addons `_ project on GitHub. -* Eric Antones -* Kilian Niubo +You are welcome to contribute. diff --git a/l10n_es_aeat_sii_oca_extension/__manifest__.py b/l10n_es_aeat_sii_oca_extension/__manifest__.py index a798ebee4..14f925e1e 100644 --- a/l10n_es_aeat_sii_oca_extension/__manifest__.py +++ b/l10n_es_aeat_sii_oca_extension/__manifest__.py @@ -13,7 +13,10 @@ "license": "AGPL-3", "website": "https://github.com/nuobit/odoo-addons", "depends": [ + "l10n_es_extension", "l10n_es_aeat_sii_oca", ], - "installable": True, + "data": [ + "data/aeat_sii_map_data.xml", + ], } diff --git a/l10n_es_aeat_sii_oca_extension/data/aeat_sii_map_data.xml b/l10n_es_aeat_sii_oca_extension/data/aeat_sii_map_data.xml new file mode 100644 index 000000000..95c94aa77 --- /dev/null +++ b/l10n_es_aeat_sii_oca_extension/data/aeat_sii_map_data.xml @@ -0,0 +1,13 @@ + + + + + + diff --git a/l10n_es_aeat_sii_oca_extension/readme/CONTRIBUTORS.rst b/l10n_es_aeat_sii_oca_extension/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..b1d54d9a1 --- /dev/null +++ b/l10n_es_aeat_sii_oca_extension/readme/CONTRIBUTORS.rst @@ -0,0 +1,4 @@ +* `NuoBiT `_: + + * Eric Antones + * Kilian Niubo diff --git a/l10n_es_aeat_sii_oca_extension/readme/DESCRIPTION.rst b/l10n_es_aeat_sii_oca_extension/readme/DESCRIPTION.rst new file mode 100644 index 000000000..f307301ac --- /dev/null +++ b/l10n_es_aeat_sii_oca_extension/readme/DESCRIPTION.rst @@ -0,0 +1,8 @@ +This module extends the OCA SII module with new functionalities +and fixes that are not accepted or delayed recurrently by +the OCA l10n_spain localization community. + + * Added support for **BaseImponibleACoste** key when + **ClaveRegimenEspecialOTranscedencia = "06"** + * Added support for **CuotaDeducible** key for a partially deductible taxes + * Added hooks to allow extending the Agencies diff --git a/l10n_es_aeat_sii_oca_extension/static/description/index.html b/l10n_es_aeat_sii_oca_extension/static/description/index.html new file mode 100644 index 000000000..eccab57eb --- /dev/null +++ b/l10n_es_aeat_sii_oca_extension/static/description/index.html @@ -0,0 +1,431 @@ + + + + + + +Suministro Inmediato de Información en el IVA Extension + + + +
+

Suministro Inmediato de Información en el IVA Extension

+ + +

Beta License: AGPL-3 NuoBiT/odoo-addons

+

This module extends the OCA SII module with new functionalities +and fixes that are not accepted or delayed recurrently by +the OCA l10n_spain localization community.

+
+
    +
  • Added support for BaseImponibleACoste key when +ClaveRegimenEspecialOTranscedencia = “06”
  • +
  • Added support for CuotaDeducible key for a partially deductible taxes
  • +
  • Added hooks to allow extending the Agencies
  • +
+
+

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 to smash it by providing a detailed and welcomed +feedback.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • NuoBiT Solutions
  • +
  • S.L.
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is part of the NuoBiT/odoo-addons project on GitHub.

+

You are welcome to contribute.

+
+
+
+ + From e5635dbdb98407a54f6324a630c8f2aaf625654f Mon Sep 17 00:00:00 2001 From: Eric Antones Date: Fri, 20 Jun 2025 21:32:55 +0200 Subject: [PATCH 6/9] Revert "[IMP] l10n_es_aet_sii_oca_extension: added new exempt tax in mapping" This reverts commit c7df065d481e773b7678b8a9b815f0a91822adc0. --- l10n_es_aeat_sii_oca_extension/README.rst | 60 +-- .../__manifest__.py | 5 +- .../data/aeat_sii_map_data.xml | 13 - .../readme/CONTRIBUTORS.rst | 4 - .../readme/DESCRIPTION.rst | 8 - .../static/description/index.html | 431 ------------------ 6 files changed, 12 insertions(+), 509 deletions(-) delete mode 100644 l10n_es_aeat_sii_oca_extension/data/aeat_sii_map_data.xml delete mode 100644 l10n_es_aeat_sii_oca_extension/readme/CONTRIBUTORS.rst delete mode 100644 l10n_es_aeat_sii_oca_extension/readme/DESCRIPTION.rst delete mode 100644 l10n_es_aeat_sii_oca_extension/static/description/index.html diff --git a/l10n_es_aeat_sii_oca_extension/README.rst b/l10n_es_aeat_sii_oca_extension/README.rst index 7d8746b71..2a596eb05 100644 --- a/l10n_es_aeat_sii_oca_extension/README.rst +++ b/l10n_es_aeat_sii_oca_extension/README.rst @@ -1,27 +1,11 @@ +.. image:: https://img.shields.io/badge/license-AGPL--3-blue.png + :target: https://www.gnu.org/licenses/agpl + :alt: License: AGPL-3 + ======================================================= Suministro Inmediato de Información en el IVA Extension ======================================================= -.. - !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! This file is generated by oca-gen-addon-readme !! - !! changes will be overwritten. !! - !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:2cca496fee278e998d82cdf022942a917f81e1dd13af84d7fc16e5b173d55bb3 - !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -.. |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-NuoBiT%2Fodoo--addons-lightgray.png?logo=github - :target: https://github.com/NuoBiT/odoo-addons/tree/14.0/l10n_es_aeat_sii_oca_extension - :alt: NuoBiT/odoo-addons - -|badge1| |badge2| |badge3| - This module extends the OCA SII module with new functionalities and fixes that are not accepted or delayed recurrently by the OCA l10n_spain localization community. @@ -31,41 +15,19 @@ the OCA l10n_spain localization community. * Added support for **CuotaDeducible** key for a partially deductible taxes * Added hooks to allow extending the Agencies -**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 to smash it by providing a detailed and welcomed -`feedback `_. - -Do not contact contributors directly about support or help with technical issues. +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. Credits ======= -Authors -~~~~~~~ - -* NuoBiT Solutions -* S.L. - Contributors -~~~~~~~~~~~~ - -* `NuoBiT `_: - - * Eric Antones - * Kilian Niubo - -Maintainers -~~~~~~~~~~~ - -This module is part of the `NuoBiT/odoo-addons `_ project on GitHub. +------------ -You are welcome to contribute. +* Eric Antones +* Kilian Niubo diff --git a/l10n_es_aeat_sii_oca_extension/__manifest__.py b/l10n_es_aeat_sii_oca_extension/__manifest__.py index 14f925e1e..a798ebee4 100644 --- a/l10n_es_aeat_sii_oca_extension/__manifest__.py +++ b/l10n_es_aeat_sii_oca_extension/__manifest__.py @@ -13,10 +13,7 @@ "license": "AGPL-3", "website": "https://github.com/nuobit/odoo-addons", "depends": [ - "l10n_es_extension", "l10n_es_aeat_sii_oca", ], - "data": [ - "data/aeat_sii_map_data.xml", - ], + "installable": True, } diff --git a/l10n_es_aeat_sii_oca_extension/data/aeat_sii_map_data.xml b/l10n_es_aeat_sii_oca_extension/data/aeat_sii_map_data.xml deleted file mode 100644 index 95c94aa77..000000000 --- a/l10n_es_aeat_sii_oca_extension/data/aeat_sii_map_data.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - diff --git a/l10n_es_aeat_sii_oca_extension/readme/CONTRIBUTORS.rst b/l10n_es_aeat_sii_oca_extension/readme/CONTRIBUTORS.rst deleted file mode 100644 index b1d54d9a1..000000000 --- a/l10n_es_aeat_sii_oca_extension/readme/CONTRIBUTORS.rst +++ /dev/null @@ -1,4 +0,0 @@ -* `NuoBiT `_: - - * Eric Antones - * Kilian Niubo diff --git a/l10n_es_aeat_sii_oca_extension/readme/DESCRIPTION.rst b/l10n_es_aeat_sii_oca_extension/readme/DESCRIPTION.rst deleted file mode 100644 index f307301ac..000000000 --- a/l10n_es_aeat_sii_oca_extension/readme/DESCRIPTION.rst +++ /dev/null @@ -1,8 +0,0 @@ -This module extends the OCA SII module with new functionalities -and fixes that are not accepted or delayed recurrently by -the OCA l10n_spain localization community. - - * Added support for **BaseImponibleACoste** key when - **ClaveRegimenEspecialOTranscedencia = "06"** - * Added support for **CuotaDeducible** key for a partially deductible taxes - * Added hooks to allow extending the Agencies diff --git a/l10n_es_aeat_sii_oca_extension/static/description/index.html b/l10n_es_aeat_sii_oca_extension/static/description/index.html deleted file mode 100644 index eccab57eb..000000000 --- a/l10n_es_aeat_sii_oca_extension/static/description/index.html +++ /dev/null @@ -1,431 +0,0 @@ - - - - - - -Suministro Inmediato de Información en el IVA Extension - - - -
-

Suministro Inmediato de Información en el IVA Extension

- - -

Beta License: AGPL-3 NuoBiT/odoo-addons

-

This module extends the OCA SII module with new functionalities -and fixes that are not accepted or delayed recurrently by -the OCA l10n_spain localization community.

-
-
    -
  • Added support for BaseImponibleACoste key when -ClaveRegimenEspecialOTranscedencia = “06”
  • -
  • Added support for CuotaDeducible key for a partially deductible taxes
  • -
  • Added hooks to allow extending the Agencies
  • -
-
-

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 to smash it by providing a detailed and welcomed -feedback.

-

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

-
-
-

Credits

-
-

Authors

-
    -
  • NuoBiT Solutions
  • -
  • S.L.
  • -
-
-
-

Contributors

- -
-
-

Maintainers

-

This module is part of the NuoBiT/odoo-addons project on GitHub.

-

You are welcome to contribute.

-
-
-
- - From 9c6333ad226d6131c3a45decf8224ef6d32c7cc8 Mon Sep 17 00:00:00 2001 From: Eric Antones Date: Mon, 9 Feb 2026 23:25:31 +0100 Subject: [PATCH 7/9] [FIX] l10n_es_aeat_sii_oca_extension: wrong tax grouping by tax type when 06 key (advanced holding) --- l10n_es_aeat_sii_oca_extension/README.rst | 150 +++++- .../models/account_move.py | 110 +++- .../readme/CONTRIBUTORS.rst | 3 + .../readme/DESCRIPTION.rst | 89 ++++ .../static/description/index.html | 496 ++++++++++++++++++ 5 files changed, 831 insertions(+), 17 deletions(-) create mode 100644 l10n_es_aeat_sii_oca_extension/readme/CONTRIBUTORS.rst create mode 100644 l10n_es_aeat_sii_oca_extension/readme/DESCRIPTION.rst create mode 100644 l10n_es_aeat_sii_oca_extension/static/description/index.html diff --git a/l10n_es_aeat_sii_oca_extension/README.rst b/l10n_es_aeat_sii_oca_extension/README.rst index 2a596eb05..06f21675e 100644 --- a/l10n_es_aeat_sii_oca_extension/README.rst +++ b/l10n_es_aeat_sii_oca_extension/README.rst @@ -1,33 +1,151 @@ -.. image:: https://img.shields.io/badge/license-AGPL--3-blue.png - :target: https://www.gnu.org/licenses/agpl - :alt: License: AGPL-3 - ======================================================= Suministro Inmediato de Información en el IVA Extension ======================================================= -This module extends the OCA SII module with new functionalities -and fixes that are not accepted or delayed recurrently by -the OCA l10n_spain localization community. +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:9eca57c8e44bf6514362004fcb23f016cda0be94835c9130dbe2fa010b81ddef + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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-NuoBiT%2Fodoo--addons-lightgray.png?logo=github + :target: https://github.com/NuoBiT/odoo-addons/tree/14.0/l10n_es_aeat_sii_oca_extension + :alt: NuoBiT/odoo-addons + +|badge1| |badge2| |badge3| + +This module extends the OCA SII (Suministro Inmediato de Información en el IVA) module with +additional functionalities and fixes that are not accepted or delayed by the OCA l10n_spain +localization community. + +**All Features Provided:** + +**1. CuotaDeducible Support (Partially Deductible Taxes)** + +For Received Invoices (Vendor Bills): + +* Automatically calculates the actual deductible amount of VAT based on tax configuration +* Only includes the portion that is truly deductible (based on tax repartition lines with account) +* Adds the CuotaDeducible field to SII submissions for received invoices +* Works for taxes mapped as SFRS (IVA Soportado) and SFRISP (IVA Inversión del Sujeto Pasivo) + +How it works: + +* Extends ``account.move.line`` to track actual deductible amounts during tax processing +* Automatically sums deductible portions based on tax repartition configuration +* No configuration needed - works automatically if tax has partial deductibility configured + +**2. Clave "06" Support (Grupo de Entidades - Modalidad Avanzada)** + +Problem Solved: + +Companies using **ClaveRegimenEspecialOTrascendencia = "06"** (VAT group in advanced mode) +receive **SII Error 1234** when submitting invoices with both services and goods. + +What the module does automatically: + +* For Outgoing Invoices (Customer Invoices): + + * Merges services (PrestacionServicios) and goods (Entrega) into a single tax breakdown + * Consolidates multiple tax lines with the same rate (TipoImpositivo) into one line + * Transforms from DesgloseTipoOperacion to DesgloseFactura structure + * Calculates and adds BaseImponibleACoste field automatically + * Rounds BaseImponibleACoste to proper decimal precision + +* For Incoming Invoices (Vendor Bills): + + * Calculates and adds BaseImponibleACoste field automatically + * Ensures proper structure for AEAT validation + +Result: SII submissions pass AEAT validation without Error 1234 + +**3. Extensible Tax Agency Hooks** + +For Advanced Customizations: - * Added support for **BaseImponibleACoste** key when - **ClaveRegimenEspecialOTranscedencia = "06"** - * Added support for **CuotaDeducible** key for a partially deductible taxes - * Added hooks to allow extending the Agencies +* Provides hooks in ``aeat.tax.agency`` model to extend SII web service configurations +* Methods ``_prepare_sii_wdsl_mapping()`` and ``_prepare_sii_port_name_mapping()`` can be overridden +* Allows custom modules to add new WSDL endpoints or modify connection parameters +* Useful for specialized tax agency configurations or testing environments + +**When to Use This Module:** + +Install this module if you need: + +* Partially deductible VAT reporting (CuotaDeducible field in received invoices) +* VAT group in advanced mode (modalidad avanzada) with clave "06" +* Fix for SII Error 1234 when submitting invoices with services + goods +* Custom tax agency configurations (extensibility hooks) + +**How It Works:** + +The module works automatically after installation: + +* No configuration required for standard features +* Only activates clave "06" transformations when registration key = "06" is detected +* Doesn't affect other invoices - backwards compatible +* CuotaDeducible is calculated for all received invoices based on tax configuration +* All transformations happen transparently during SII submission + +**Technical Details:** + +Models Extended: + +* ``account.move`` - Adds SII invoice processing for clave "06" and CuotaDeducible +* ``account.move.line`` - Tracks actual deductible amounts during tax processing +* ``aeat.tax.agency`` - Provides extensibility hooks for custom configurations + +Key Methods: + +* ``_get_sii_in_taxes_deductible()`` - Calculates deductible VAT amount +* ``_get_sii_out_taxes()`` - Transforms tax breakdown for clave "06" outgoing invoices +* ``_get_sii_invoice_dict_in()`` - Adds CuotaDeducible and BaseImponibleACoste to received invoices +* ``_get_sii_invoice_dict_out()`` - Adds BaseImponibleACoste to sent invoices +* ``_process_aeat_tax_base_info()`` / ``_process_aeat_tax_fee_info()`` - Track deductible amounts + + +**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. +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 to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. Credits ======= +Authors +~~~~~~~ + +* NuoBiT Solutions +* S.L. + Contributors ------------- +~~~~~~~~~~~~ * Eric Antones * Kilian Niubo + + +Maintainers +~~~~~~~~~~~ + +This module is part of the `NuoBiT/odoo-addons `_ project on GitHub. + +You are welcome to contribute. diff --git a/l10n_es_aeat_sii_oca_extension/models/account_move.py b/l10n_es_aeat_sii_oca_extension/models/account_move.py index 57be1a1ab..d4c1e950a 100644 --- a/l10n_es_aeat_sii_oca_extension/models/account_move.py +++ b/l10n_es_aeat_sii_oca_extension/models/account_move.py @@ -2,7 +2,8 @@ # Eric Antones # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) -from odoo import models +from odoo import _, models +from odoo.exceptions import UserError, ValidationError from odoo.addons.l10n_es_aeat_sii_oca.models.account_move import round_by_keys @@ -18,6 +19,96 @@ def sum_key(elem, key): return value +def merge_nested_dicts(target_dict, source_dict, key_funcs=None, path=None, level=0): + def get_path_value(data, path): + for key in path: + data = data[key] + return data + + def set_path_value(data, path, value): + for key in path[:-1]: + data = data[key] + data[path[-1]] = value + + def path_exists(data, path): + for key in path: + if key not in data: + return False + data = data[key] + return True + + if key_funcs is None: + key_funcs = {} + if path is None: + path = [] + if isinstance(source_dict, (str, int, float, bool)): + if get_path_value(target_dict, path) != source_dict: + raise ValidationError( + _("SII data merge error: No match at path %s: %s != %s") + % (path, get_path_value(target_dict, path), source_dict) + ) + elif isinstance(source_dict, dict): + for key, value in source_dict.items(): + new_path = path + [key] + if path_exists(target_dict, new_path): + if key in key_funcs: + func = key_funcs[key] + existing_value = get_path_value(target_dict, new_path) + merged_value = func(existing_value, source_dict[key]) + set_path_value(target_dict, new_path, merged_value) + else: + merge_nested_dicts( + target_dict, + value, + key_funcs=key_funcs, + path=new_path, + level=level + 1, + ) + else: + set_path_value(target_dict, new_path, value) + else: + raise UserError( + _("SII data merge error: Unsupported type: %s: %s") + % (type(source_dict), source_dict) + ) + + +def merge_detalle_iva(tax_details_list1, tax_details_list2): + """Merge tax details (DetalleIVA) by grouping and summing by TipoImpositivo.""" + merged_by_rate = {} + rate_key = "TipoImpositivo" + + for tax_detail in tax_details_list1 + tax_details_list2: + if rate_key not in tax_detail: + raise ValidationError( + _("SII tax detail merge error: Missing '%s' key in %s") + % (rate_key, tax_detail) + ) + tax_detail = dict(tax_detail) + tax_rate = tax_detail.pop(rate_key) + + if tax_rate not in merged_by_rate: + merged_by_rate[tax_rate] = tax_detail + else: + for key, value in tax_detail.items(): + if key not in merged_by_rate[tax_rate]: + raise ValidationError( + _("SII tax detail merge error: Missing '%s' key in %s") + % (key, merged_by_rate[tax_rate]) + ) + merged_by_rate[tax_rate][key] += value + + result_list = [] + for tax_rate, tax_data in merged_by_rate.items(): + result_list.append( + { + rate_key: tax_rate, + **tax_data, + } + ) + return result_list + + class AccountMove(models.Model): _inherit = "account.move" @@ -50,6 +141,23 @@ def _get_sii_invoice_dict_in(self, cancel=False): ) return inv_dict + def _get_sii_out_taxes(self): + tipo_desglose, not_in_amount_total = super()._get_sii_out_taxes() + if "06" in ( + self.sii_registration_key.code, + self.sii_registration_key_additional1.code, + self.sii_registration_key_additional2.code, + ): + if "DesgloseTipoOperacion" in tipo_desglose: + operation_types = list(tipo_desglose["DesgloseTipoOperacion"].values()) + merged_data = operation_types[0] + for operation_type in operation_types[1:]: + merge_nested_dicts( + merged_data, operation_type, {"DetalleIVA": merge_detalle_iva} + ) + tipo_desglose = {"DesgloseFactura": merged_data} + return tipo_desglose, not_in_amount_total + def _get_sii_invoice_dict_out(self, cancel=False): inv_dict = super()._get_sii_invoice_dict_out(cancel=cancel) if not cancel: diff --git a/l10n_es_aeat_sii_oca_extension/readme/CONTRIBUTORS.rst b/l10n_es_aeat_sii_oca_extension/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..a75ce7d61 --- /dev/null +++ b/l10n_es_aeat_sii_oca_extension/readme/CONTRIBUTORS.rst @@ -0,0 +1,3 @@ +* Eric Antones +* Kilian Niubo + diff --git a/l10n_es_aeat_sii_oca_extension/readme/DESCRIPTION.rst b/l10n_es_aeat_sii_oca_extension/readme/DESCRIPTION.rst new file mode 100644 index 000000000..4f659b2a9 --- /dev/null +++ b/l10n_es_aeat_sii_oca_extension/readme/DESCRIPTION.rst @@ -0,0 +1,89 @@ +This module extends the OCA SII (Suministro Inmediato de Información en el IVA) module with +additional functionalities and fixes that are not accepted or delayed by the OCA l10n_spain +localization community. + +**All Features Provided:** + +**1. CuotaDeducible Support (Partially Deductible Taxes)** + +For Received Invoices (Vendor Bills): + +* Automatically calculates the actual deductible amount of VAT based on tax configuration +* Only includes the portion that is truly deductible (based on tax repartition lines with account) +* Adds the CuotaDeducible field to SII submissions for received invoices +* Works for taxes mapped as SFRS (IVA Soportado) and SFRISP (IVA Inversión del Sujeto Pasivo) + +How it works: + +* Extends ``account.move.line`` to track actual deductible amounts during tax processing +* Automatically sums deductible portions based on tax repartition configuration +* No configuration needed - works automatically if tax has partial deductibility configured + +**2. Clave "06" Support (Grupo de Entidades - Modalidad Avanzada)** + +Problem Solved: + +Companies using **ClaveRegimenEspecialOTrascendencia = "06"** (VAT group in advanced mode) +receive **SII Error 1234** when submitting invoices with both services and goods. + +What the module does automatically: + +* For Outgoing Invoices (Customer Invoices): + + * Merges services (PrestacionServicios) and goods (Entrega) into a single tax breakdown + * Consolidates multiple tax lines with the same rate (TipoImpositivo) into one line + * Transforms from DesgloseTipoOperacion to DesgloseFactura structure + * Calculates and adds BaseImponibleACoste field automatically + * Rounds BaseImponibleACoste to proper decimal precision + +* For Incoming Invoices (Vendor Bills): + + * Calculates and adds BaseImponibleACoste field automatically + * Ensures proper structure for AEAT validation + +Result: SII submissions pass AEAT validation without Error 1234 + +**3. Extensible Tax Agency Hooks** + +For Advanced Customizations: + +* Provides hooks in ``aeat.tax.agency`` model to extend SII web service configurations +* Methods ``_prepare_sii_wdsl_mapping()`` and ``_prepare_sii_port_name_mapping()`` can be overridden +* Allows custom modules to add new WSDL endpoints or modify connection parameters +* Useful for specialized tax agency configurations or testing environments + +**When to Use This Module:** + +Install this module if you need: + +* Partially deductible VAT reporting (CuotaDeducible field in received invoices) +* VAT group in advanced mode (modalidad avanzada) with clave "06" +* Fix for SII Error 1234 when submitting invoices with services + goods +* Custom tax agency configurations (extensibility hooks) + +**How It Works:** + +The module works automatically after installation: + +* No configuration required for standard features +* Only activates clave "06" transformations when registration key = "06" is detected +* Doesn't affect other invoices - backwards compatible +* CuotaDeducible is calculated for all received invoices based on tax configuration +* All transformations happen transparently during SII submission + +**Technical Details:** + +Models Extended: + +* ``account.move`` - Adds SII invoice processing for clave "06" and CuotaDeducible +* ``account.move.line`` - Tracks actual deductible amounts during tax processing +* ``aeat.tax.agency`` - Provides extensibility hooks for custom configurations + +Key Methods: + +* ``_get_sii_in_taxes_deductible()`` - Calculates deductible VAT amount +* ``_get_sii_out_taxes()`` - Transforms tax breakdown for clave "06" outgoing invoices +* ``_get_sii_invoice_dict_in()`` - Adds CuotaDeducible and BaseImponibleACoste to received invoices +* ``_get_sii_invoice_dict_out()`` - Adds BaseImponibleACoste to sent invoices +* ``_process_aeat_tax_base_info()`` / ``_process_aeat_tax_fee_info()`` - Track deductible amounts + diff --git a/l10n_es_aeat_sii_oca_extension/static/description/index.html b/l10n_es_aeat_sii_oca_extension/static/description/index.html new file mode 100644 index 000000000..ffb220981 --- /dev/null +++ b/l10n_es_aeat_sii_oca_extension/static/description/index.html @@ -0,0 +1,496 @@ + + + + + +Suministro Inmediato de Información en el IVA Extension + + + +
+

Suministro Inmediato de Información en el IVA Extension

+ + +

Beta License: AGPL-3 NuoBiT/odoo-addons

+

This module extends the OCA SII (Suministro Inmediato de Información en el IVA) module with +additional functionalities and fixes that are not accepted or delayed by the OCA l10n_spain +localization community.

+

All Features Provided:

+

1. CuotaDeducible Support (Partially Deductible Taxes)

+

For Received Invoices (Vendor Bills):

+
    +
  • Automatically calculates the actual deductible amount of VAT based on tax configuration
  • +
  • Only includes the portion that is truly deductible (based on tax repartition lines with account)
  • +
  • Adds the CuotaDeducible field to SII submissions for received invoices
  • +
  • Works for taxes mapped as SFRS (IVA Soportado) and SFRISP (IVA Inversión del Sujeto Pasivo)
  • +
+

How it works:

+
    +
  • Extends account.move.line to track actual deductible amounts during tax processing
  • +
  • Automatically sums deductible portions based on tax repartition configuration
  • +
  • No configuration needed - works automatically if tax has partial deductibility configured
  • +
+

2. Clave “06” Support (Grupo de Entidades - Modalidad Avanzada)

+

Problem Solved:

+

Companies using ClaveRegimenEspecialOTrascendencia = “06” (VAT group in advanced mode) +receive SII Error 1234 when submitting invoices with both services and goods.

+

What the module does automatically:

+
    +
  • For Outgoing Invoices (Customer Invoices):
      +
    • Merges services (PrestacionServicios) and goods (Entrega) into a single tax breakdown
    • +
    • Consolidates multiple tax lines with the same rate (TipoImpositivo) into one line
    • +
    • Transforms from DesgloseTipoOperacion to DesgloseFactura structure
    • +
    • Calculates and adds BaseImponibleACoste field automatically
    • +
    • Rounds BaseImponibleACoste to proper decimal precision
    • +
    +
  • +
  • For Incoming Invoices (Vendor Bills):
      +
    • Calculates and adds BaseImponibleACoste field automatically
    • +
    • Ensures proper structure for AEAT validation
    • +
    +
  • +
+

Result: SII submissions pass AEAT validation without Error 1234

+

3. Extensible Tax Agency Hooks

+

For Advanced Customizations:

+
    +
  • Provides hooks in aeat.tax.agency model to extend SII web service configurations
  • +
  • Methods _prepare_sii_wdsl_mapping() and _prepare_sii_port_name_mapping() can be overridden
  • +
  • Allows custom modules to add new WSDL endpoints or modify connection parameters
  • +
  • Useful for specialized tax agency configurations or testing environments
  • +
+

When to Use This Module:

+

Install this module if you need:

+
    +
  • Partially deductible VAT reporting (CuotaDeducible field in received invoices)
  • +
  • VAT group in advanced mode (modalidad avanzada) with clave “06”
  • +
  • Fix for SII Error 1234 when submitting invoices with services + goods
  • +
  • Custom tax agency configurations (extensibility hooks)
  • +
+

How It Works:

+

The module works automatically after installation:

+
    +
  • No configuration required for standard features
  • +
  • Only activates clave “06” transformations when registration key = “06” is detected
  • +
  • Doesn’t affect other invoices - backwards compatible
  • +
  • CuotaDeducible is calculated for all received invoices based on tax configuration
  • +
  • All transformations happen transparently during SII submission
  • +
+

Technical Details:

+

Models Extended:

+
    +
  • account.move - Adds SII invoice processing for clave “06” and CuotaDeducible
  • +
  • account.move.line - Tracks actual deductible amounts during tax processing
  • +
  • aeat.tax.agency - Provides extensibility hooks for custom configurations
  • +
+

Key Methods:

+
    +
  • _get_sii_in_taxes_deductible() - Calculates deductible VAT amount
  • +
  • _get_sii_out_taxes() - Transforms tax breakdown for clave “06” outgoing invoices
  • +
  • _get_sii_invoice_dict_in() - Adds CuotaDeducible and BaseImponibleACoste to received invoices
  • +
  • _get_sii_invoice_dict_out() - Adds BaseImponibleACoste to sent invoices
  • +
  • _process_aeat_tax_base_info() / _process_aeat_tax_fee_info() - Track deductible amounts
  • +
+

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 to smash it by providing a detailed and welcomed +feedback.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • NuoBiT Solutions
  • +
  • S.L.
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is part of the NuoBiT/odoo-addons project on GitHub.

+

You are welcome to contribute.

+
+
+
+ + From 5893de41a3dee49198307f9febcec1cb130b3c47 Mon Sep 17 00:00:00 2001 From: ??? Date: Wed, 10 Dec 2025 13:04:14 +0100 Subject: [PATCH 8/9] [IMP] l10n_es_aeat_sii_oca_extension: pre-commit auto fixes --- l10n_es_aeat_sii_oca_extension/__manifest__.py | 2 +- l10n_es_aeat_sii_oca_extension/models/account_move.py | 6 +++--- l10n_es_aeat_sii_oca_extension/pyproject.toml | 3 +++ 3 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 l10n_es_aeat_sii_oca_extension/pyproject.toml diff --git a/l10n_es_aeat_sii_oca_extension/__manifest__.py b/l10n_es_aeat_sii_oca_extension/__manifest__.py index a798ebee4..13feb5c9c 100644 --- a/l10n_es_aeat_sii_oca_extension/__manifest__.py +++ b/l10n_es_aeat_sii_oca_extension/__manifest__.py @@ -11,7 +11,7 @@ "category": "Accounting & Finance", "version": "14.0.1.0.3", "license": "AGPL-3", - "website": "https://github.com/nuobit/odoo-addons", + "website": "https://github.com/NuoBiT/odoo-addons", "depends": [ "l10n_es_aeat_sii_oca", ], diff --git a/l10n_es_aeat_sii_oca_extension/models/account_move.py b/l10n_es_aeat_sii_oca_extension/models/account_move.py index d4c1e950a..da62429db 100644 --- a/l10n_es_aeat_sii_oca_extension/models/account_move.py +++ b/l10n_es_aeat_sii_oca_extension/models/account_move.py @@ -127,9 +127,9 @@ def _get_sii_in_taxes_deductible(self): def _get_sii_invoice_dict_in(self, cancel=False): inv_dict = super()._get_sii_invoice_dict_in(cancel=cancel) if not cancel: - inv_dict["FacturaRecibida"][ - "CuotaDeducible" - ] = self._get_sii_in_taxes_deductible() + inv_dict["FacturaRecibida"]["CuotaDeducible"] = ( + self._get_sii_in_taxes_deductible() + ) if "06" in ( self.sii_registration_key.code, self.sii_registration_key_additional1.code, diff --git a/l10n_es_aeat_sii_oca_extension/pyproject.toml b/l10n_es_aeat_sii_oca_extension/pyproject.toml new file mode 100644 index 000000000..4231d0ccc --- /dev/null +++ b/l10n_es_aeat_sii_oca_extension/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" From fccadac741f168786c2e2fdb49740b32b75399db Mon Sep 17 00:00:00 2001 From: ??? Date: Tue, 17 Mar 2026 18:17:04 +0100 Subject: [PATCH 9/9] [MIG] l10n_es_aeat_sii_oca_extension: Migration to 18.0 --- l10n_es_aeat_sii_oca_extension/README.rst | 129 +++++++++++------- .../__manifest__.py | 12 +- .../models/account_move.py | 54 +++++--- .../models/aeat_tax_agency.py | 5 +- .../readme/CONTRIBUTORS.md | 4 + .../readme/CONTRIBUTORS.rst | 3 - .../readme/DESCRIPTION.md | 108 +++++++++++++++ .../readme/DESCRIPTION.rst | 89 ------------ .../static/description/index.html | 94 ++++++++----- 9 files changed, 290 insertions(+), 208 deletions(-) create mode 100644 l10n_es_aeat_sii_oca_extension/readme/CONTRIBUTORS.md delete mode 100644 l10n_es_aeat_sii_oca_extension/readme/CONTRIBUTORS.rst create mode 100644 l10n_es_aeat_sii_oca_extension/readme/DESCRIPTION.md delete mode 100644 l10n_es_aeat_sii_oca_extension/readme/DESCRIPTION.rst diff --git a/l10n_es_aeat_sii_oca_extension/README.rst b/l10n_es_aeat_sii_oca_extension/README.rst index 06f21675e..37dfda777 100644 --- a/l10n_es_aeat_sii_oca_extension/README.rst +++ b/l10n_es_aeat_sii_oca_extension/README.rst @@ -17,14 +17,14 @@ Suministro Inmediato de Información en el IVA Extension :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-NuoBiT%2Fodoo--addons-lightgray.png?logo=github - :target: https://github.com/NuoBiT/odoo-addons/tree/14.0/l10n_es_aeat_sii_oca_extension + :target: https://github.com/NuoBiT/odoo-addons/tree/18.0/l10n_es_aeat_sii_oca_extension :alt: NuoBiT/odoo-addons |badge1| |badge2| |badge3| -This module extends the OCA SII (Suministro Inmediato de Información en el IVA) module with -additional functionalities and fixes that are not accepted or delayed by the OCA l10n_spain -localization community. +This module extends the OCA SII (Suministro Inmediato de Información en +el IVA) module with additional functionalities and fixes that are not +accepted or delayed by the OCA l10n_spain localization community. **All Features Provided:** @@ -32,38 +32,47 @@ localization community. For Received Invoices (Vendor Bills): -* Automatically calculates the actual deductible amount of VAT based on tax configuration -* Only includes the portion that is truly deductible (based on tax repartition lines with account) -* Adds the CuotaDeducible field to SII submissions for received invoices -* Works for taxes mapped as SFRS (IVA Soportado) and SFRISP (IVA Inversión del Sujeto Pasivo) +- Automatically calculates the actual deductible amount of VAT based on + tax configuration +- Only includes the portion that is truly deductible (based on tax + repartition lines with account) +- Adds the CuotaDeducible field to SII submissions for received invoices +- Works for taxes mapped as SFRS (IVA Soportado) and SFRISP (IVA + Inversión del Sujeto Pasivo) How it works: -* Extends ``account.move.line`` to track actual deductible amounts during tax processing -* Automatically sums deductible portions based on tax repartition configuration -* No configuration needed - works automatically if tax has partial deductibility configured +- Extends ``account.move.line`` to track actual deductible amounts + during tax processing +- Automatically sums deductible portions based on tax repartition + configuration +- No configuration needed - works automatically if tax has partial + deductibility configured **2. Clave "06" Support (Grupo de Entidades - Modalidad Avanzada)** Problem Solved: -Companies using **ClaveRegimenEspecialOTrascendencia = "06"** (VAT group in advanced mode) -receive **SII Error 1234** when submitting invoices with both services and goods. +Companies using **ClaveRegimenEspecialOTrascendencia = "06"** (VAT group +in advanced mode) receive **SII Error 1234** when submitting invoices +with both services and goods. What the module does automatically: -* For Outgoing Invoices (Customer Invoices): +- For Outgoing Invoices (Customer Invoices): - * Merges services (PrestacionServicios) and goods (Entrega) into a single tax breakdown - * Consolidates multiple tax lines with the same rate (TipoImpositivo) into one line - * Transforms from DesgloseTipoOperacion to DesgloseFactura structure - * Calculates and adds BaseImponibleACoste field automatically - * Rounds BaseImponibleACoste to proper decimal precision + - Merges services (PrestacionServicios) and goods (Entrega) into a + single tax breakdown + - Consolidates multiple tax lines with the same rate (TipoImpositivo) + into one line + - Transforms from DesgloseTipoOperacion to DesgloseFactura structure + - Calculates and adds BaseImponibleACoste field automatically + - Rounds BaseImponibleACoste to proper decimal precision -* For Incoming Invoices (Vendor Bills): +- For Incoming Invoices (Vendor Bills): - * Calculates and adds BaseImponibleACoste field automatically - * Ensures proper structure for AEAT validation + - Calculates and adds BaseImponibleACoste field automatically + - Ensures proper structure for AEAT validation Result: SII submissions pass AEAT validation without Error 1234 @@ -71,46 +80,59 @@ Result: SII submissions pass AEAT validation without Error 1234 For Advanced Customizations: -* Provides hooks in ``aeat.tax.agency`` model to extend SII web service configurations -* Methods ``_prepare_sii_wdsl_mapping()`` and ``_prepare_sii_port_name_mapping()`` can be overridden -* Allows custom modules to add new WSDL endpoints or modify connection parameters -* Useful for specialized tax agency configurations or testing environments +- Provides hooks in ``aeat.tax.agency`` model to extend SII web service + configurations +- Methods ``_prepare_sii_wdsl_mapping()`` and + ``_prepare_sii_port_name_mapping()`` can be overridden +- Allows custom modules to add new WSDL endpoints or modify connection + parameters +- Useful for specialized tax agency configurations or testing + environments **When to Use This Module:** Install this module if you need: -* Partially deductible VAT reporting (CuotaDeducible field in received invoices) -* VAT group in advanced mode (modalidad avanzada) with clave "06" -* Fix for SII Error 1234 when submitting invoices with services + goods -* Custom tax agency configurations (extensibility hooks) +- Partially deductible VAT reporting (CuotaDeducible field in received + invoices) +- VAT group in advanced mode (modalidad avanzada) with clave "06" +- Fix for SII Error 1234 when submitting invoices with services + goods +- Custom tax agency configurations (extensibility hooks) **How It Works:** The module works automatically after installation: -* No configuration required for standard features -* Only activates clave "06" transformations when registration key = "06" is detected -* Doesn't affect other invoices - backwards compatible -* CuotaDeducible is calculated for all received invoices based on tax configuration -* All transformations happen transparently during SII submission +- No configuration required for standard features +- Only activates clave "06" transformations when registration key = "06" + is detected +- Doesn't affect other invoices - backwards compatible +- CuotaDeducible is calculated for all received invoices based on tax + configuration +- All transformations happen transparently during SII submission **Technical Details:** Models Extended: -* ``account.move`` - Adds SII invoice processing for clave "06" and CuotaDeducible -* ``account.move.line`` - Tracks actual deductible amounts during tax processing -* ``aeat.tax.agency`` - Provides extensibility hooks for custom configurations +- ``account.move`` - Adds SII invoice processing for clave "06" and + CuotaDeducible +- ``account.move.line`` - Tracks actual deductible amounts during tax + processing +- ``aeat.tax.agency`` - Provides extensibility hooks for custom + configurations Key Methods: -* ``_get_sii_in_taxes_deductible()`` - Calculates deductible VAT amount -* ``_get_sii_out_taxes()`` - Transforms tax breakdown for clave "06" outgoing invoices -* ``_get_sii_invoice_dict_in()`` - Adds CuotaDeducible and BaseImponibleACoste to received invoices -* ``_get_sii_invoice_dict_out()`` - Adds BaseImponibleACoste to sent invoices -* ``_process_aeat_tax_base_info()`` / ``_process_aeat_tax_fee_info()`` - Track deductible amounts - +- ``_get_sii_in_taxes_deductible()`` - Calculates deductible VAT amount +- ``_get_sii_out_taxes()`` - Transforms tax breakdown for clave "06" + outgoing invoices +- ``_get_sii_invoice_dict_in()`` - Adds CuotaDeducible and + BaseImponibleACoste to received invoices +- ``_get_sii_invoice_dict_out()`` - Adds BaseImponibleACoste to sent + invoices +- ``_process_aeat_tax_base_info()`` / ``_process_aeat_tax_fee_info()`` - + Track deductible amounts **Table of contents** @@ -123,7 +145,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 to smash it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -131,21 +153,22 @@ Credits ======= Authors -~~~~~~~ +------- -* NuoBiT Solutions -* S.L. +* NuoBiT Solutions SL Contributors -~~~~~~~~~~~~ +------------ -* Eric Antones -* Kilian Niubo +- `NuoBiT `__: + - Frank Cespedes fcespedes@nuobit.com + - Kilian Niubo kniubo@nuobit.com + - Deniz Gallo dgallo@nuobit.com Maintainers -~~~~~~~~~~~ +----------- -This module is part of the `NuoBiT/odoo-addons `_ project on GitHub. +This module is part of the `NuoBiT/odoo-addons `_ project on GitHub. You are welcome to contribute. diff --git a/l10n_es_aeat_sii_oca_extension/__manifest__.py b/l10n_es_aeat_sii_oca_extension/__manifest__.py index 13feb5c9c..a5e51e10f 100644 --- a/l10n_es_aeat_sii_oca_extension/__manifest__.py +++ b/l10n_es_aeat_sii_oca_extension/__manifest__.py @@ -1,19 +1,19 @@ -# Copyright NuoBiT - Eric Antones -# Copyright NuoBiT - Kilian Niubo -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) +# Copyright NuoBiT Solutions SL - Eric Antones +# Copyright NuoBiT Solutions SL - Kilian Niubo +# Copyright 2025 NuoBiT Solutions SL - Deniz Gallo +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { "name": "Suministro Inmediato de Información en el IVA Extension", "summary": "This module extends the OCA SII module with new functionalities " "and fixes that are not accepted or delayed recurrently by " "the OCA l10n_spain localization community", - "author": "NuoBiT Solutions, S.L.", + "author": "NuoBiT Solutions SL", "category": "Accounting & Finance", - "version": "14.0.1.0.3", + "version": "18.0.1.0.0", "license": "AGPL-3", "website": "https://github.com/NuoBiT/odoo-addons", "depends": [ "l10n_es_aeat_sii_oca", ], - "installable": True, } diff --git a/l10n_es_aeat_sii_oca_extension/models/account_move.py b/l10n_es_aeat_sii_oca_extension/models/account_move.py index da62429db..7b5459d33 100644 --- a/l10n_es_aeat_sii_oca_extension/models/account_move.py +++ b/l10n_es_aeat_sii_oca_extension/models/account_move.py @@ -1,16 +1,16 @@ -# Copyright NuoBiT Solutions, S.L. () -# Eric Antones +# Copyright NuoBiT Solutions- Eric Antones +# Copyright 2026 NuoBiT Solutions SL - Deniz Gallo # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) from odoo import _, models from odoo.exceptions import UserError, ValidationError -from odoo.addons.l10n_es_aeat_sii_oca.models.account_move import round_by_keys +from odoo.addons.l10n_es_aeat.models.aeat_mixin import round_by_keys def sum_key(elem, key): value = 0 - if isinstance(elem, (list, tuple)): + if isinstance(elem, (list | tuple)): for v in elem: value += sum_key(v, key) elif isinstance(elem, dict): @@ -41,11 +41,18 @@ def path_exists(data, path): key_funcs = {} if path is None: path = [] - if isinstance(source_dict, (str, int, float, bool)): + if isinstance(source_dict, (str | int | float | bool)): if get_path_value(target_dict, path) != source_dict: raise ValidationError( - _("SII data merge error: No match at path %s: %s != %s") - % (path, get_path_value(target_dict, path), source_dict) + _( + "SII data merge error: No match at path %(path)s:" + " %(target_value)s != %(source_value)s" + ) + % { + "path": path, + "target_value": get_path_value(target_dict, path), + "source_value": source_dict, + } ) elif isinstance(source_dict, dict): for key, value in source_dict.items(): @@ -68,8 +75,8 @@ def path_exists(data, path): set_path_value(target_dict, new_path, value) else: raise UserError( - _("SII data merge error: Unsupported type: %s: %s") - % (type(source_dict), source_dict) + _("SII data merge error: Unsupported type: %(type)s: %(value)s") + % {"type": type(source_dict), "value": source_dict} ) @@ -81,8 +88,8 @@ def merge_detalle_iva(tax_details_list1, tax_details_list2): for tax_detail in tax_details_list1 + tax_details_list2: if rate_key not in tax_detail: raise ValidationError( - _("SII tax detail merge error: Missing '%s' key in %s") - % (rate_key, tax_detail) + _("SII tax detail merge error: Missing '%(key)s' key in %(detail)s") + % {"key": rate_key, "detail": tax_detail} ) tax_detail = dict(tax_detail) tax_rate = tax_detail.pop(rate_key) @@ -93,8 +100,11 @@ def merge_detalle_iva(tax_details_list1, tax_details_list2): for key, value in tax_detail.items(): if key not in merged_by_rate[tax_rate]: raise ValidationError( - _("SII tax detail merge error: Missing '%s' key in %s") - % (key, merged_by_rate[tax_rate]) + _( + "SII tax detail merge error:" + " Missing '%(key)s' key in %(detail)s" + ) + % {"key": key, "detail": merged_by_rate[tax_rate]} ) merged_by_rate[tax_rate][key] += value @@ -114,8 +124,8 @@ class AccountMove(models.Model): def _get_sii_in_taxes_deductible(self): self.ensure_one() - taxes_sfrs = self._get_sii_taxes_map(["SFRS"]) - taxes_sfrisp = self._get_sii_taxes_map(["SFRISP"]) + taxes_sfrs = self._get_aeat_taxes_map(["SFRS"], self.date) + taxes_sfrisp = self._get_aeat_taxes_map(["SFRISP"], self.date) tax_deductible_amount = 0.0 tax_lines = self._get_aeat_tax_info() for tax_line in tax_lines.values(): @@ -124,8 +134,8 @@ def _get_sii_in_taxes_deductible(self): tax_deductible_amount += tax_line["actual_deductible_amount"] return tax_deductible_amount - def _get_sii_invoice_dict_in(self, cancel=False): - inv_dict = super()._get_sii_invoice_dict_in(cancel=cancel) + def _get_aeat_invoice_dict_in(self, cancel=False): + inv_dict = super()._get_aeat_invoice_dict_in(cancel=cancel) if not cancel: inv_dict["FacturaRecibida"]["CuotaDeducible"] = ( self._get_sii_in_taxes_deductible() @@ -158,8 +168,8 @@ def _get_sii_out_taxes(self): tipo_desglose = {"DesgloseFactura": merged_data} return tipo_desglose, not_in_amount_total - def _get_sii_invoice_dict_out(self, cancel=False): - inv_dict = super()._get_sii_invoice_dict_out(cancel=cancel) + def _get_aeat_invoice_dict_out(self, cancel=False): + inv_dict = super()._get_aeat_invoice_dict_out(cancel=cancel) if not cancel: if "06" in ( self.sii_registration_key.code, @@ -171,8 +181,8 @@ def _get_sii_invoice_dict_out(self, cancel=False): ) return inv_dict - def _get_sii_invoice_dict(self): - inv_dict = super()._get_sii_invoice_dict() + def _get_aeat_invoice_dict(self): + inv_dict = super()._get_aeat_invoice_dict() round_by_keys( inv_dict, [ @@ -189,9 +199,11 @@ def _process_aeat_tax_base_info(self, res, tax, sign): super()._process_aeat_tax_base_info(res, tax, sign) for tax in res.keys(): res[tax].setdefault("actual_deductible_amount", 0) + return res def _process_aeat_tax_fee_info(self, res, tax, sign): super()._process_aeat_tax_fee_info(res, tax, sign) res[tax].setdefault("actual_deductible_amount", 0) if self.tax_repartition_line_id.account_id: res[tax]["actual_deductible_amount"] += self.balance * sign + return res diff --git a/l10n_es_aeat_sii_oca_extension/models/aeat_tax_agency.py b/l10n_es_aeat_sii_oca_extension/models/aeat_tax_agency.py index 42c94bcf4..38cc80db2 100644 --- a/l10n_es_aeat_sii_oca_extension/models/aeat_tax_agency.py +++ b/l10n_es_aeat_sii_oca_extension/models/aeat_tax_agency.py @@ -1,5 +1,6 @@ -# Copyright NuoBiT - Kilian Niubo -# Copyright NuoBiT - Eric Antones +# Copyright NuoBiT Solutions SL - Eric Antones +# Copyright NuoBiT Solutions SL - Kilian Niubo +# Copyright 2025 NuoBiT Solutions SL - Deniz Gallo # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import models diff --git a/l10n_es_aeat_sii_oca_extension/readme/CONTRIBUTORS.md b/l10n_es_aeat_sii_oca_extension/readme/CONTRIBUTORS.md new file mode 100644 index 000000000..3dd5aac73 --- /dev/null +++ b/l10n_es_aeat_sii_oca_extension/readme/CONTRIBUTORS.md @@ -0,0 +1,4 @@ +- [NuoBiT](https://www.nuobit.com): + - Frank Cespedes + - Kilian Niubo + - Deniz Gallo diff --git a/l10n_es_aeat_sii_oca_extension/readme/CONTRIBUTORS.rst b/l10n_es_aeat_sii_oca_extension/readme/CONTRIBUTORS.rst deleted file mode 100644 index a75ce7d61..000000000 --- a/l10n_es_aeat_sii_oca_extension/readme/CONTRIBUTORS.rst +++ /dev/null @@ -1,3 +0,0 @@ -* Eric Antones -* Kilian Niubo - diff --git a/l10n_es_aeat_sii_oca_extension/readme/DESCRIPTION.md b/l10n_es_aeat_sii_oca_extension/readme/DESCRIPTION.md new file mode 100644 index 000000000..8741af7a5 --- /dev/null +++ b/l10n_es_aeat_sii_oca_extension/readme/DESCRIPTION.md @@ -0,0 +1,108 @@ +This module extends the OCA SII (Suministro Inmediato de Información en +el IVA) module with additional functionalities and fixes that are not +accepted or delayed by the OCA l10n_spain localization community. + +**All Features Provided:** + +**1. CuotaDeducible Support (Partially Deductible Taxes)** + +For Received Invoices (Vendor Bills): + +- Automatically calculates the actual deductible amount of VAT based on + tax configuration +- Only includes the portion that is truly deductible (based on tax + repartition lines with account) +- Adds the CuotaDeducible field to SII submissions for received invoices +- Works for taxes mapped as SFRS (IVA Soportado) and SFRISP (IVA + Inversión del Sujeto Pasivo) + +How it works: + +- Extends `account.move.line` to track actual deductible amounts during + tax processing +- Automatically sums deductible portions based on tax repartition + configuration +- No configuration needed - works automatically if tax has partial + deductibility configured + +**2. Clave "06" Support (Grupo de Entidades - Modalidad Avanzada)** + +Problem Solved: + +Companies using **ClaveRegimenEspecialOTrascendencia = "06"** (VAT group +in advanced mode) receive **SII Error 1234** when submitting invoices +with both services and goods. + +What the module does automatically: + +- For Outgoing Invoices (Customer Invoices): + - Merges services (PrestacionServicios) and goods (Entrega) into a + single tax breakdown + - Consolidates multiple tax lines with the same rate (TipoImpositivo) + into one line + - Transforms from DesgloseTipoOperacion to DesgloseFactura structure + - Calculates and adds BaseImponibleACoste field automatically + - Rounds BaseImponibleACoste to proper decimal precision +- For Incoming Invoices (Vendor Bills): + - Calculates and adds BaseImponibleACoste field automatically + - Ensures proper structure for AEAT validation + +Result: SII submissions pass AEAT validation without Error 1234 + +**3. Extensible Tax Agency Hooks** + +For Advanced Customizations: + +- Provides hooks in `aeat.tax.agency` model to extend SII web service + configurations +- Methods `_prepare_sii_wdsl_mapping()` and + `_prepare_sii_port_name_mapping()` can be overridden +- Allows custom modules to add new WSDL endpoints or modify connection + parameters +- Useful for specialized tax agency configurations or testing + environments + +**When to Use This Module:** + +Install this module if you need: + +- Partially deductible VAT reporting (CuotaDeducible field in received + invoices) +- VAT group in advanced mode (modalidad avanzada) with clave "06" +- Fix for SII Error 1234 when submitting invoices with services + goods +- Custom tax agency configurations (extensibility hooks) + +**How It Works:** + +The module works automatically after installation: + +- No configuration required for standard features +- Only activates clave "06" transformations when registration key = "06" + is detected +- Doesn't affect other invoices - backwards compatible +- CuotaDeducible is calculated for all received invoices based on tax + configuration +- All transformations happen transparently during SII submission + +**Technical Details:** + +Models Extended: + +- `account.move` - Adds SII invoice processing for clave "06" and + CuotaDeducible +- `account.move.line` - Tracks actual deductible amounts during tax + processing +- `aeat.tax.agency` - Provides extensibility hooks for custom + configurations + +Key Methods: + +- `_get_sii_in_taxes_deductible()` - Calculates deductible VAT amount +- `_get_sii_out_taxes()` - Transforms tax breakdown for clave "06" + outgoing invoices +- `_get_sii_invoice_dict_in()` - Adds CuotaDeducible and + BaseImponibleACoste to received invoices +- `_get_sii_invoice_dict_out()` - Adds BaseImponibleACoste to sent + invoices +- `_process_aeat_tax_base_info()` / `_process_aeat_tax_fee_info()` - + Track deductible amounts diff --git a/l10n_es_aeat_sii_oca_extension/readme/DESCRIPTION.rst b/l10n_es_aeat_sii_oca_extension/readme/DESCRIPTION.rst deleted file mode 100644 index 4f659b2a9..000000000 --- a/l10n_es_aeat_sii_oca_extension/readme/DESCRIPTION.rst +++ /dev/null @@ -1,89 +0,0 @@ -This module extends the OCA SII (Suministro Inmediato de Información en el IVA) module with -additional functionalities and fixes that are not accepted or delayed by the OCA l10n_spain -localization community. - -**All Features Provided:** - -**1. CuotaDeducible Support (Partially Deductible Taxes)** - -For Received Invoices (Vendor Bills): - -* Automatically calculates the actual deductible amount of VAT based on tax configuration -* Only includes the portion that is truly deductible (based on tax repartition lines with account) -* Adds the CuotaDeducible field to SII submissions for received invoices -* Works for taxes mapped as SFRS (IVA Soportado) and SFRISP (IVA Inversión del Sujeto Pasivo) - -How it works: - -* Extends ``account.move.line`` to track actual deductible amounts during tax processing -* Automatically sums deductible portions based on tax repartition configuration -* No configuration needed - works automatically if tax has partial deductibility configured - -**2. Clave "06" Support (Grupo de Entidades - Modalidad Avanzada)** - -Problem Solved: - -Companies using **ClaveRegimenEspecialOTrascendencia = "06"** (VAT group in advanced mode) -receive **SII Error 1234** when submitting invoices with both services and goods. - -What the module does automatically: - -* For Outgoing Invoices (Customer Invoices): - - * Merges services (PrestacionServicios) and goods (Entrega) into a single tax breakdown - * Consolidates multiple tax lines with the same rate (TipoImpositivo) into one line - * Transforms from DesgloseTipoOperacion to DesgloseFactura structure - * Calculates and adds BaseImponibleACoste field automatically - * Rounds BaseImponibleACoste to proper decimal precision - -* For Incoming Invoices (Vendor Bills): - - * Calculates and adds BaseImponibleACoste field automatically - * Ensures proper structure for AEAT validation - -Result: SII submissions pass AEAT validation without Error 1234 - -**3. Extensible Tax Agency Hooks** - -For Advanced Customizations: - -* Provides hooks in ``aeat.tax.agency`` model to extend SII web service configurations -* Methods ``_prepare_sii_wdsl_mapping()`` and ``_prepare_sii_port_name_mapping()`` can be overridden -* Allows custom modules to add new WSDL endpoints or modify connection parameters -* Useful for specialized tax agency configurations or testing environments - -**When to Use This Module:** - -Install this module if you need: - -* Partially deductible VAT reporting (CuotaDeducible field in received invoices) -* VAT group in advanced mode (modalidad avanzada) with clave "06" -* Fix for SII Error 1234 when submitting invoices with services + goods -* Custom tax agency configurations (extensibility hooks) - -**How It Works:** - -The module works automatically after installation: - -* No configuration required for standard features -* Only activates clave "06" transformations when registration key = "06" is detected -* Doesn't affect other invoices - backwards compatible -* CuotaDeducible is calculated for all received invoices based on tax configuration -* All transformations happen transparently during SII submission - -**Technical Details:** - -Models Extended: - -* ``account.move`` - Adds SII invoice processing for clave "06" and CuotaDeducible -* ``account.move.line`` - Tracks actual deductible amounts during tax processing -* ``aeat.tax.agency`` - Provides extensibility hooks for custom configurations - -Key Methods: - -* ``_get_sii_in_taxes_deductible()`` - Calculates deductible VAT amount -* ``_get_sii_out_taxes()`` - Transforms tax breakdown for clave "06" outgoing invoices -* ``_get_sii_invoice_dict_in()`` - Adds CuotaDeducible and BaseImponibleACoste to received invoices -* ``_get_sii_invoice_dict_out()`` - Adds BaseImponibleACoste to sent invoices -* ``_process_aeat_tax_base_info()`` / ``_process_aeat_tax_fee_info()`` - Track deductible amounts - diff --git a/l10n_es_aeat_sii_oca_extension/static/description/index.html b/l10n_es_aeat_sii_oca_extension/static/description/index.html index ffb220981..f6a25be1c 100644 --- a/l10n_es_aeat_sii_oca_extension/static/description/index.html +++ b/l10n_es_aeat_sii_oca_extension/static/description/index.html @@ -369,34 +369,43 @@

Suministro Inmediato de Información en el IVA Extension

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:9eca57c8e44bf6514362004fcb23f016cda0be94835c9130dbe2fa010b81ddef !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Beta License: AGPL-3 NuoBiT/odoo-addons

-

This module extends the OCA SII (Suministro Inmediato de Información en el IVA) module with -additional functionalities and fixes that are not accepted or delayed by the OCA l10n_spain -localization community.

+

Beta License: AGPL-3 NuoBiT/odoo-addons

+

This module extends the OCA SII (Suministro Inmediato de Información en +el IVA) module with additional functionalities and fixes that are not +accepted or delayed by the OCA l10n_spain localization community.

All Features Provided:

1. CuotaDeducible Support (Partially Deductible Taxes)

For Received Invoices (Vendor Bills):

    -
  • Automatically calculates the actual deductible amount of VAT based on tax configuration
  • -
  • Only includes the portion that is truly deductible (based on tax repartition lines with account)
  • +
  • Automatically calculates the actual deductible amount of VAT based on +tax configuration
  • +
  • Only includes the portion that is truly deductible (based on tax +repartition lines with account)
  • Adds the CuotaDeducible field to SII submissions for received invoices
  • -
  • Works for taxes mapped as SFRS (IVA Soportado) and SFRISP (IVA Inversión del Sujeto Pasivo)
  • +
  • Works for taxes mapped as SFRS (IVA Soportado) and SFRISP (IVA +Inversión del Sujeto Pasivo)

How it works:

    -
  • Extends account.move.line to track actual deductible amounts during tax processing
  • -
  • Automatically sums deductible portions based on tax repartition configuration
  • -
  • No configuration needed - works automatically if tax has partial deductibility configured
  • +
  • Extends account.move.line to track actual deductible amounts +during tax processing
  • +
  • Automatically sums deductible portions based on tax repartition +configuration
  • +
  • No configuration needed - works automatically if tax has partial +deductibility configured

2. Clave “06” Support (Grupo de Entidades - Modalidad Avanzada)

Problem Solved:

-

Companies using ClaveRegimenEspecialOTrascendencia = “06” (VAT group in advanced mode) -receive SII Error 1234 when submitting invoices with both services and goods.

+

Companies using ClaveRegimenEspecialOTrascendencia = “06” (VAT group +in advanced mode) receive SII Error 1234 when submitting invoices +with both services and goods.

What the module does automatically:

  • For Outgoing Invoices (Customer Invoices):
      -
    • Merges services (PrestacionServicios) and goods (Entrega) into a single tax breakdown
    • -
    • Consolidates multiple tax lines with the same rate (TipoImpositivo) into one line
    • +
    • Merges services (PrestacionServicios) and goods (Entrega) into a +single tax breakdown
    • +
    • Consolidates multiple tax lines with the same rate (TipoImpositivo) +into one line
    • Transforms from DesgloseTipoOperacion to DesgloseFactura structure
    • Calculates and adds BaseImponibleACoste field automatically
    • Rounds BaseImponibleACoste to proper decimal precision
    • @@ -412,15 +421,20 @@

      Suministro Inmediato de Información en el IVA Extension

      3. Extensible Tax Agency Hooks

      For Advanced Customizations:

        -
      • Provides hooks in aeat.tax.agency model to extend SII web service configurations
      • -
      • Methods _prepare_sii_wdsl_mapping() and _prepare_sii_port_name_mapping() can be overridden
      • -
      • Allows custom modules to add new WSDL endpoints or modify connection parameters
      • -
      • Useful for specialized tax agency configurations or testing environments
      • +
      • Provides hooks in aeat.tax.agency model to extend SII web service +configurations
      • +
      • Methods _prepare_sii_wdsl_mapping() and +_prepare_sii_port_name_mapping() can be overridden
      • +
      • Allows custom modules to add new WSDL endpoints or modify connection +parameters
      • +
      • Useful for specialized tax agency configurations or testing +environments

      When to Use This Module:

      Install this module if you need:

        -
      • Partially deductible VAT reporting (CuotaDeducible field in received invoices)
      • +
      • Partially deductible VAT reporting (CuotaDeducible field in received +invoices)
      • VAT group in advanced mode (modalidad avanzada) with clave “06”
      • Fix for SII Error 1234 when submitting invoices with services + goods
      • Custom tax agency configurations (extensibility hooks)
      • @@ -429,25 +443,34 @@

        Suministro Inmediato de Información en el IVA Extension

        The module works automatically after installation:

        • No configuration required for standard features
        • -
        • Only activates clave “06” transformations when registration key = “06” is detected
        • +
        • Only activates clave “06” transformations when registration key = “06” +is detected
        • Doesn’t affect other invoices - backwards compatible
        • -
        • CuotaDeducible is calculated for all received invoices based on tax configuration
        • +
        • CuotaDeducible is calculated for all received invoices based on tax +configuration
        • All transformations happen transparently during SII submission

        Technical Details:

        Models Extended:

          -
        • account.move - Adds SII invoice processing for clave “06” and CuotaDeducible
        • -
        • account.move.line - Tracks actual deductible amounts during tax processing
        • -
        • aeat.tax.agency - Provides extensibility hooks for custom configurations
        • +
        • account.move - Adds SII invoice processing for clave “06” and +CuotaDeducible
        • +
        • account.move.line - Tracks actual deductible amounts during tax +processing
        • +
        • aeat.tax.agency - Provides extensibility hooks for custom +configurations

        Key Methods:

        • _get_sii_in_taxes_deductible() - Calculates deductible VAT amount
        • -
        • _get_sii_out_taxes() - Transforms tax breakdown for clave “06” outgoing invoices
        • -
        • _get_sii_invoice_dict_in() - Adds CuotaDeducible and BaseImponibleACoste to received invoices
        • -
        • _get_sii_invoice_dict_out() - Adds BaseImponibleACoste to sent invoices
        • -
        • _process_aeat_tax_base_info() / _process_aeat_tax_fee_info() - Track deductible amounts
        • +
        • _get_sii_out_taxes() - Transforms tax breakdown for clave “06” +outgoing invoices
        • +
        • _get_sii_invoice_dict_in() - Adds CuotaDeducible and +BaseImponibleACoste to received invoices
        • +
        • _get_sii_invoice_dict_out() - Adds BaseImponibleACoste to sent +invoices
        • +
        • _process_aeat_tax_base_info() / _process_aeat_tax_fee_info() - +Track deductible amounts

        Table of contents

        @@ -466,7 +489,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 to smash it by providing a detailed and welcomed -feedback.

        +feedback.

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

        @@ -474,20 +497,23 @@

        Credits

        Authors

          -
        • NuoBiT Solutions
        • -
        • S.L.
        • +
        • NuoBiT Solutions SL

        Contributors

        Maintainers

        -

        This module is part of the NuoBiT/odoo-addons project on GitHub.

        +

        This module is part of the NuoBiT/odoo-addons project on GitHub.

        You are welcome to contribute.