odoo-addon-l10n-es-verifactu-oca 15.0.1.0.0.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of odoo-addon-l10n-es-verifactu-oca might be problematic. Click here for more details.
- odoo/addons/l10n_es_verifactu_oca/README.rst +154 -0
- odoo/addons/l10n_es_verifactu_oca/__init__.py +3 -0
- odoo/addons/l10n_es_verifactu_oca/__manifest__.py +48 -0
- odoo/addons/l10n_es_verifactu_oca/data/account_fiscal_position_template_data.xml +129 -0
- odoo/addons/l10n_es_verifactu_oca/data/ir_config_parameter.xml +9 -0
- odoo/addons/l10n_es_verifactu_oca/data/ir_cron.xml +14 -0
- odoo/addons/l10n_es_verifactu_oca/data/mail_activity_data.xml +11 -0
- odoo/addons/l10n_es_verifactu_oca/data/verifactu_map_data.xml +120 -0
- odoo/addons/l10n_es_verifactu_oca/data/verifactu_registration_key_data.xml +207 -0
- odoo/addons/l10n_es_verifactu_oca/data/verifactu_tax_agency_data.xml +19 -0
- odoo/addons/l10n_es_verifactu_oca/hooks.py +43 -0
- odoo/addons/l10n_es_verifactu_oca/i18n/ca.po +1630 -0
- odoo/addons/l10n_es_verifactu_oca/i18n/ca_ES.po +1599 -0
- odoo/addons/l10n_es_verifactu_oca/i18n/es.po +1640 -0
- odoo/addons/l10n_es_verifactu_oca/i18n/l10n_es_verifactu_oca.pot +1673 -0
- odoo/addons/l10n_es_verifactu_oca/models/__init__.py +16 -0
- odoo/addons/l10n_es_verifactu_oca/models/account_fiscal_position.py +40 -0
- odoo/addons/l10n_es_verifactu_oca/models/account_fiscal_position_template.py +18 -0
- odoo/addons/l10n_es_verifactu_oca/models/account_journal.py +64 -0
- odoo/addons/l10n_es_verifactu_oca/models/account_move.py +556 -0
- odoo/addons/l10n_es_verifactu_oca/models/aeat_mixin.py +163 -0
- odoo/addons/l10n_es_verifactu_oca/models/aeat_tax_agency.py +30 -0
- odoo/addons/l10n_es_verifactu_oca/models/res_company.py +48 -0
- odoo/addons/l10n_es_verifactu_oca/models/res_partner.py +33 -0
- odoo/addons/l10n_es_verifactu_oca/models/verifactu_chaining.py +30 -0
- odoo/addons/l10n_es_verifactu_oca/models/verifactu_developer.py +16 -0
- odoo/addons/l10n_es_verifactu_oca/models/verifactu_invoice_entry.py +401 -0
- odoo/addons/l10n_es_verifactu_oca/models/verifactu_invoice_entry_response.py +121 -0
- odoo/addons/l10n_es_verifactu_oca/models/verifactu_invoice_entry_response_line.py +35 -0
- odoo/addons/l10n_es_verifactu_oca/models/verifactu_map.py +66 -0
- odoo/addons/l10n_es_verifactu_oca/models/verifactu_mixin.py +449 -0
- odoo/addons/l10n_es_verifactu_oca/models/verifactu_registration_key.py +24 -0
- odoo/addons/l10n_es_verifactu_oca/readme/CONFIGURE.rst +18 -0
- odoo/addons/l10n_es_verifactu_oca/readme/CONTRIBUTORS.rst +19 -0
- odoo/addons/l10n_es_verifactu_oca/readme/DESCRIPTION.rst +1 -0
- odoo/addons/l10n_es_verifactu_oca/readme/INSTALL.rst +4 -0
- odoo/addons/l10n_es_verifactu_oca/readme/ROADMAP.rst +15 -0
- odoo/addons/l10n_es_verifactu_oca/readme/USAGE.rst +1 -0
- odoo/addons/l10n_es_verifactu_oca/security/ir.model.access.csv +22 -0
- odoo/addons/l10n_es_verifactu_oca/security/verifactu_security.xml +6 -0
- odoo/addons/l10n_es_verifactu_oca/static/description/icon.png +0 -0
- odoo/addons/l10n_es_verifactu_oca/static/description/index.html +508 -0
- odoo/addons/l10n_es_verifactu_oca/tests/__init__.py +5 -0
- odoo/addons/l10n_es_verifactu_oca/tests/common.py +304 -0
- odoo/addons/l10n_es_verifactu_oca/tests/json/verifactu_mocked_response_1.json +35 -0
- odoo/addons/l10n_es_verifactu_oca/tests/json/verifactu_mocked_response_2.json +35 -0
- odoo/addons/l10n_es_verifactu_oca/tests/json/verifactu_out_invoice_s_iva10b_s_iva21s_dict.json +59 -0
- odoo/addons/l10n_es_verifactu_oca/tests/json/verifactu_out_invoice_s_iva21s_s_req52_dict.json +58 -0
- odoo/addons/l10n_es_verifactu_oca/tests/json/verifactu_out_refund_s_iva10b_s_iva10b_s_iva21s_dict.json +66 -0
- odoo/addons/l10n_es_verifactu_oca/tests/test_10n_es_verifactu.py +451 -0
- odoo/addons/l10n_es_verifactu_oca/tests/test_account_journal.py +78 -0
- odoo/addons/l10n_es_verifactu_oca/tests/test_account_move_reversal.py +93 -0
- odoo/addons/l10n_es_verifactu_oca/tests/test_res_partner.py +48 -0
- odoo/addons/l10n_es_verifactu_oca/tests/test_verifactu_invoice.py +350 -0
- odoo/addons/l10n_es_verifactu_oca/views/account_fiscal_position_view.xml +30 -0
- odoo/addons/l10n_es_verifactu_oca/views/account_journal_view.xml +28 -0
- odoo/addons/l10n_es_verifactu_oca/views/account_move_view.xml +219 -0
- odoo/addons/l10n_es_verifactu_oca/views/aeat_tax_agency_view.xml +31 -0
- odoo/addons/l10n_es_verifactu_oca/views/report_invoice.xml +55 -0
- odoo/addons/l10n_es_verifactu_oca/views/res_company_view.xml +50 -0
- odoo/addons/l10n_es_verifactu_oca/views/res_partner_view.xml +27 -0
- odoo/addons/l10n_es_verifactu_oca/views/verifactu_chaining_view.xml +47 -0
- odoo/addons/l10n_es_verifactu_oca/views/verifactu_developer_view.xml +48 -0
- odoo/addons/l10n_es_verifactu_oca/views/verifactu_invoice_entry_response_view.xml +149 -0
- odoo/addons/l10n_es_verifactu_oca/views/verifactu_invoice_entry_view.xml +124 -0
- odoo/addons/l10n_es_verifactu_oca/views/verifactu_map_lines_view.xml +20 -0
- odoo/addons/l10n_es_verifactu_oca/views/verifactu_map_view.xml +53 -0
- odoo/addons/l10n_es_verifactu_oca/views/verifactu_registration_keys_view.xml +42 -0
- odoo/addons/l10n_es_verifactu_oca/wizards/__init__.py +1 -0
- odoo/addons/l10n_es_verifactu_oca/wizards/account_move_reversal.py +16 -0
- odoo_addon_l10n_es_verifactu_oca-15.0.1.0.0.2.dist-info/METADATA +171 -0
- odoo_addon_l10n_es_verifactu_oca-15.0.1.0.0.2.dist-info/RECORD +74 -0
- odoo_addon_l10n_es_verifactu_oca-15.0.1.0.0.2.dist-info/WHEEL +5 -0
- odoo_addon_l10n_es_verifactu_oca-15.0.1.0.0.2.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" ?>
|
|
2
|
+
<!-- Copyright 2024 Almudena de La Puente <almudena@aurestic.es>
|
|
3
|
+
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
|
|
4
|
+
<odoo>
|
|
5
|
+
<record id="verifactu_registration_keys_01" model="verifactu.registration.key">
|
|
6
|
+
<field name="code">01</field>
|
|
7
|
+
<field name="name">Operación de régimen general</field>
|
|
8
|
+
<field name="verifactu_tax_key">01</field>
|
|
9
|
+
</record>
|
|
10
|
+
<record id="verifactu_registration_keys_02" model="verifactu.registration.key">
|
|
11
|
+
<field name="code">02</field>
|
|
12
|
+
<field name="name">Exportación</field>
|
|
13
|
+
<field name="verifactu_tax_key">01</field>
|
|
14
|
+
</record>
|
|
15
|
+
<record id="verifactu_registration_keys_03" model="verifactu.registration.key">
|
|
16
|
+
<field name="code">03</field>
|
|
17
|
+
<field
|
|
18
|
+
name="name"
|
|
19
|
+
>Operaciones a las que se aplique el régimen especial de bienes usados, objetos de arte, antigüedades y objetos de colección</field>
|
|
20
|
+
<field name="verifactu_tax_key">01</field>
|
|
21
|
+
</record>
|
|
22
|
+
<record id="verifactu_registration_keys_04" model="verifactu.registration.key">
|
|
23
|
+
<field name="code">04</field>
|
|
24
|
+
<field name="name">Régimen especial oro de inversión</field>
|
|
25
|
+
<field name="verifactu_tax_key">01</field>
|
|
26
|
+
</record>
|
|
27
|
+
<record id="verifactu_registration_keys_05" model="verifactu.registration.key">
|
|
28
|
+
<field name="code">05</field>
|
|
29
|
+
<field name="name">Régimen especial agencias de viajes</field>
|
|
30
|
+
<field name="verifactu_tax_key">01</field>
|
|
31
|
+
</record>
|
|
32
|
+
<record id="verifactu_registration_keys_06" model="verifactu.registration.key">
|
|
33
|
+
<field name="code">06</field>
|
|
34
|
+
<field
|
|
35
|
+
name="name"
|
|
36
|
+
>Régimen especial grupo de entidades en IVA (Nivel Avanzado)</field>
|
|
37
|
+
<field name="verifactu_tax_key">01</field>
|
|
38
|
+
</record>
|
|
39
|
+
<record id="verifactu_registration_keys_07" model="verifactu.registration.key">
|
|
40
|
+
<field name="code">07</field>
|
|
41
|
+
<field name="name">Régimen especial criterio de caja</field>
|
|
42
|
+
<field name="verifactu_tax_key">01</field>
|
|
43
|
+
</record>
|
|
44
|
+
<record id="verifactu_registration_keys_08" model="verifactu.registration.key">
|
|
45
|
+
<field name="code">08</field>
|
|
46
|
+
<field
|
|
47
|
+
name="name"
|
|
48
|
+
>Operaciones sujetas al IPSI / IGIC (Impuesto sobre la Producción, los Servicios y la Importación / Impuesto General Indirecto Canario)</field>
|
|
49
|
+
<field name="verifactu_tax_key">01</field>
|
|
50
|
+
</record>
|
|
51
|
+
<record id="verifactu_registration_keys_09" model="verifactu.registration.key">
|
|
52
|
+
<field name="code">09</field>
|
|
53
|
+
<field
|
|
54
|
+
name="name"
|
|
55
|
+
>Facturación de las prestaciones de servicios de agencias de viaje que actúan como mediadoras en nombre y por cuenta ajena (D.A.4ª RD1619/2012)</field>
|
|
56
|
+
<field name="verifactu_tax_key">01</field>
|
|
57
|
+
</record>
|
|
58
|
+
<record id="verifactu_registration_keys_10" model="verifactu.registration.key">
|
|
59
|
+
<field name="code">10</field>
|
|
60
|
+
<field
|
|
61
|
+
name="name"
|
|
62
|
+
>Cobros por cuenta de terceros de honorarios profesionales o de derechos derivados de la propiedad industrial, de autor u otros por cuenta de sus socios, asociados o colegiados efectuados por sociedades, asociaciones, colegios profesionales u otras entidades que realicen estas funciones de cobro</field>
|
|
63
|
+
<field name="verifactu_tax_key">01</field>
|
|
64
|
+
</record>
|
|
65
|
+
<record id="verifactu_registration_keys_11" model="verifactu.registration.key">
|
|
66
|
+
<field name="code">11</field>
|
|
67
|
+
<field name="name">Operaciones de arrendamiento de local de negocio.</field>
|
|
68
|
+
<field name="verifactu_tax_key">01</field>
|
|
69
|
+
</record>
|
|
70
|
+
<record id="verifactu_registration_keys_14" model="verifactu.registration.key">
|
|
71
|
+
<field name="code">14</field>
|
|
72
|
+
<field
|
|
73
|
+
name="name"
|
|
74
|
+
>Factura con IVA pendiente de devengo en certificaciones de obra cuyo destinatario sea una Administración Pública.</field>
|
|
75
|
+
<field name="verifactu_tax_key">01</field>
|
|
76
|
+
</record>
|
|
77
|
+
<record id="verifactu_registration_keys_15" model="verifactu.registration.key">
|
|
78
|
+
<field name="code">15</field>
|
|
79
|
+
<field
|
|
80
|
+
name="name"
|
|
81
|
+
>Factura con IVA pendiente de devengo en operaciones de tracto sucesivo</field>
|
|
82
|
+
<field name="verifactu_tax_key">01</field>
|
|
83
|
+
</record>
|
|
84
|
+
<record id="verifactu_registration_keys_17" model="verifactu.registration.key">
|
|
85
|
+
<field name="code">17</field>
|
|
86
|
+
<field
|
|
87
|
+
name="name"
|
|
88
|
+
>Operación acogida a alguno de los regímenes previstos en el Capítulo XI del Título IX (OSS e IOSS)</field>
|
|
89
|
+
<field name="verifactu_tax_key">01</field>
|
|
90
|
+
</record>
|
|
91
|
+
<record id="verifactu_registration_keys_18" model="verifactu.registration.key">
|
|
92
|
+
<field name="code">18</field>
|
|
93
|
+
<field name="name">Recargo de equivalencia.</field>
|
|
94
|
+
<field name="verifactu_tax_key">01</field>
|
|
95
|
+
</record>
|
|
96
|
+
<record id="verifactu_registration_keys_19" model="verifactu.registration.key">
|
|
97
|
+
<field name="code">19</field>
|
|
98
|
+
<field
|
|
99
|
+
name="name"
|
|
100
|
+
>Operaciones de actividades incluidas en el Régimen Especial de Agricultura, Ganadería y Pesca (REAGYP)</field>
|
|
101
|
+
<field name="verifactu_tax_key">01</field>
|
|
102
|
+
</record>
|
|
103
|
+
<record id="verifactu_registration_keys_20" model="verifactu.registration.key">
|
|
104
|
+
<field name="code">20</field>
|
|
105
|
+
<field name="name">Régimen simplificado</field>
|
|
106
|
+
<field name="verifactu_tax_key">01</field>
|
|
107
|
+
</record>
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
<record id="verifactu_registration_keys_igic_01" model="verifactu.registration.key">
|
|
111
|
+
<field name="code">01</field>
|
|
112
|
+
<field name="name">Operación de régimen general</field>
|
|
113
|
+
<field name="verifactu_tax_key">03</field>
|
|
114
|
+
</record>
|
|
115
|
+
<record id="verifactu_registration_keys_igic_02" model="verifactu.registration.key">
|
|
116
|
+
<field name="code">02</field>
|
|
117
|
+
<field name="name">Exportación</field>
|
|
118
|
+
<field name="verifactu_tax_key">03</field>
|
|
119
|
+
</record>
|
|
120
|
+
<record id="verifactu_registration_keys_igic_03" model="verifactu.registration.key">
|
|
121
|
+
<field name="code">03</field>
|
|
122
|
+
<field
|
|
123
|
+
name="name"
|
|
124
|
+
>Operaciones a las que se aplique el régimen especial de bienes usados, objetos de arte, antigüedades y objetos de colección</field>
|
|
125
|
+
<field name="verifactu_tax_key">03</field>
|
|
126
|
+
</record>
|
|
127
|
+
<record id="verifactu_registration_keys_igic_04" model="verifactu.registration.key">
|
|
128
|
+
<field name="code">04</field>
|
|
129
|
+
<field name="name">Régimen especial oro de inversión</field>
|
|
130
|
+
<field name="verifactu_tax_key">03</field>
|
|
131
|
+
</record>
|
|
132
|
+
<record id="verifactu_registration_keys_igic_05" model="verifactu.registration.key">
|
|
133
|
+
<field name="code">05</field>
|
|
134
|
+
<field name="name">Régimen especial agencias de viajes</field>
|
|
135
|
+
<field name="verifactu_tax_key">03</field>
|
|
136
|
+
</record>
|
|
137
|
+
<record id="verifactu_registration_keys_igic_06" model="verifactu.registration.key">
|
|
138
|
+
<field name="code">06</field>
|
|
139
|
+
<field
|
|
140
|
+
name="name"
|
|
141
|
+
>Régimen especial grupo de entidades en IGIC (Nivel Avanzado)</field>
|
|
142
|
+
<field name="verifactu_tax_key">01</field>
|
|
143
|
+
</record>
|
|
144
|
+
<record id="verifactu_registration_keys_igic_07" model="verifactu.registration.key">
|
|
145
|
+
<field name="code">07</field>
|
|
146
|
+
<field name="name">Régimen especial criterio de caja</field>
|
|
147
|
+
<field name="verifactu_tax_key">03</field>
|
|
148
|
+
</record>
|
|
149
|
+
<record id="verifactu_registration_keys_igic_08" model="verifactu.registration.key">
|
|
150
|
+
<field name="code">08</field>
|
|
151
|
+
<field
|
|
152
|
+
name="name"
|
|
153
|
+
>Operaciones sujetas al IPSI / IVA (Impuesto sobre la Producción, los Servicios y la Importación / Impuesto sobre el Valor Añadido).</field>
|
|
154
|
+
<field name="verifactu_tax_key">03</field>
|
|
155
|
+
</record>
|
|
156
|
+
<record id="verifactu_registration_keys_igic_09" model="verifactu.registration.key">
|
|
157
|
+
<field name="code">09</field>
|
|
158
|
+
<field
|
|
159
|
+
name="name"
|
|
160
|
+
>Facturación de las prestaciones de servicios de agencias de viaje que actúan como mediadoras en nombre y por cuenta ajena (D.A.4ª RD1619/2012)</field>
|
|
161
|
+
<field name="verifactu_tax_key">03</field>
|
|
162
|
+
</record>
|
|
163
|
+
<record id="verifactu_registration_keys_igic_10" model="verifactu.registration.key">
|
|
164
|
+
<field name="code">10</field>
|
|
165
|
+
<field
|
|
166
|
+
name="name"
|
|
167
|
+
>Cobros por cuenta de terceros de honorarios profesionales o de derechos derivados de la propiedad industrial, de autor u otros por cuenta de sus socios, asociados o colegiados efectuados por sociedades, asociaciones, colegios profesionales u otras entidades que realicen estas funciones de cobro.</field>
|
|
168
|
+
<field name="verifactu_tax_key">03</field>
|
|
169
|
+
</record>
|
|
170
|
+
<record id="verifactu_registration_keys_igic_11" model="verifactu.registration.key">
|
|
171
|
+
<field name="code">11</field>
|
|
172
|
+
<field name="name">Operaciones de arrendamiento de local de negocio.</field>
|
|
173
|
+
<field name="verifactu_tax_key">03</field>
|
|
174
|
+
</record>
|
|
175
|
+
<record id="verifactu_registration_keys_igic_14" model="verifactu.registration.key">
|
|
176
|
+
<field name="code">14</field>
|
|
177
|
+
<field
|
|
178
|
+
name="name"
|
|
179
|
+
>Factura con IGIC pendiente de devengo en certificaciones de obra cuyo destinatario sea una Administración Pública.</field>
|
|
180
|
+
<field name="verifactu_tax_key">03</field>
|
|
181
|
+
</record>
|
|
182
|
+
<record id="verifactu_registration_keys_igic_15" model="verifactu.registration.key">
|
|
183
|
+
<field name="code">15</field>
|
|
184
|
+
<field
|
|
185
|
+
name="name"
|
|
186
|
+
>Factura con IGIC pendiente de devengo en operaciones de tracto sucesivo.</field>
|
|
187
|
+
<field name="verifactu_tax_key">03</field>
|
|
188
|
+
</record>
|
|
189
|
+
<record id="verifactu_registration_keys_igic_17" model="verifactu.registration.key">
|
|
190
|
+
<field name="code">17</field>
|
|
191
|
+
<field name="name">Régimen especial de comerciante minorista</field>
|
|
192
|
+
<field name="verifactu_tax_key">03</field>
|
|
193
|
+
</record>
|
|
194
|
+
<record id="verifactu_registration_keys_igic_18" model="verifactu.registration.key">
|
|
195
|
+
<field name="code">18</field>
|
|
196
|
+
<field name="name">Régimen especial del pequeño empresario o profesional</field>
|
|
197
|
+
<field name="verifactu_tax_key">03</field>
|
|
198
|
+
</record>
|
|
199
|
+
<record id="verifactu_registration_keys_igic_19" model="verifactu.registration.key">
|
|
200
|
+
<field name="code">19</field>
|
|
201
|
+
<field
|
|
202
|
+
name="name"
|
|
203
|
+
>Operaciones interiores exentas por aplicación artículo 25 Ley 19/1994</field>
|
|
204
|
+
<field name="verifactu_tax_key">03</field>
|
|
205
|
+
</record>
|
|
206
|
+
|
|
207
|
+
</odoo>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" ?>
|
|
2
|
+
<!-- Copyright 2024 Jose Zambudio <jose@aurestic.es>
|
|
3
|
+
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
|
|
4
|
+
<odoo>
|
|
5
|
+
<record id="l10n_es_aeat.aeat_tax_agency_spain" model="aeat.tax.agency">
|
|
6
|
+
<field
|
|
7
|
+
name="verifactu_wsdl_out"
|
|
8
|
+
>https://prewww2.aeat.es/static_files/common/internet/dep/aplicaciones/es/aeat/tikeV1.0/cont/ws/SistemaFacturacion.wsdl</field>
|
|
9
|
+
<field
|
|
10
|
+
name="verifactu_wsdl_out_test_address"
|
|
11
|
+
>https://prewww1.aeat.es/wlpl/TIKE-CONT/ws/SistemaFacturacion/VerifactuSOAP</field>
|
|
12
|
+
<field
|
|
13
|
+
name="verifactu_qr_base_url"
|
|
14
|
+
>https://www2.agenciatributaria.gob.es/wlpl/TIKE-CONT/ValidarQR</field>
|
|
15
|
+
<field
|
|
16
|
+
name="verifactu_qr_base_url_test_address"
|
|
17
|
+
>https://prewww2.aeat.es/wlpl/TIKE-CONT/ValidarQR</field>
|
|
18
|
+
</record>
|
|
19
|
+
</odoo>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Copyright 2025 Tecnativa - Pedro M. Baeza
|
|
2
|
+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
|
3
|
+
from odoo import SUPERUSER_ID, api, tools
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def pre_init_hook(cr):
|
|
7
|
+
"""Avoid the heavy compute methods, specially when account.move table is very
|
|
8
|
+
populated, pre-creating the columns and filling them with sane defaultes. Some of it
|
|
9
|
+
is done on post-init hook.
|
|
10
|
+
WARNING: For special cases like IGIC or other, the default value doesn't serve.
|
|
11
|
+
"""
|
|
12
|
+
column_exists = tools.sql.column_exists
|
|
13
|
+
create_column = tools.sql.create_column
|
|
14
|
+
if not column_exists(cr, "account_move", "verifactu_refund_type"):
|
|
15
|
+
create_column(cr, "account_move", "verifactu_refund_type", "varchar")
|
|
16
|
+
cr.execute(
|
|
17
|
+
"UPDATE account_move SET verifactu_refund_type = 'I' "
|
|
18
|
+
"WHERE move_type = 'out_refund'"
|
|
19
|
+
)
|
|
20
|
+
if not column_exists(cr, "account_move", "verifactu_registration_key"):
|
|
21
|
+
create_column(cr, "account_move", "verifactu_registration_key", "int4")
|
|
22
|
+
# Initialization done on post-init
|
|
23
|
+
if not column_exists(cr, "account_move", "verifactu_tax_key"):
|
|
24
|
+
create_column(cr, "account_move", "verifactu_tax_key", "varchar")
|
|
25
|
+
cr.execute(
|
|
26
|
+
"UPDATE account_move SET verifactu_tax_key = '01' "
|
|
27
|
+
"WHERE move_type IN ('out_invoice', 'out_refund')"
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def post_init_hook(cr, registry):
|
|
32
|
+
"""Perform the initialization of this column once the registration keys have been
|
|
33
|
+
loaded.
|
|
34
|
+
WARNING: Only 01 case is covered here, so existing export/intra-community/other
|
|
35
|
+
invoices should be changed later.
|
|
36
|
+
"""
|
|
37
|
+
env = api.Environment(cr, SUPERUSER_ID, {})
|
|
38
|
+
key = env.ref("l10n_es_verifactu_oca.verifactu_registration_keys_01")
|
|
39
|
+
cr.execute(
|
|
40
|
+
"UPDATE account_move SET verifactu_registration_key = %s "
|
|
41
|
+
"WHERE move_type = 'out_refund' AND verifactu_registration_key IS NULL",
|
|
42
|
+
(key.id,),
|
|
43
|
+
)
|