odoo-addon-l10n-es-verifactu-oca 18.0.1.2.1__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.
- odoo/addons/l10n_es_verifactu_oca/README.rst +195 -0
- odoo/addons/l10n_es_verifactu_oca/__init__.py +3 -0
- odoo/addons/l10n_es_verifactu_oca/__manifest__.py +50 -0
- odoo/addons/l10n_es_verifactu_oca/data/ir_config_parameter.xml +9 -0
- odoo/addons/l10n_es_verifactu_oca/data/ir_cron.xml +13 -0
- odoo/addons/l10n_es_verifactu_oca/data/l10n.es.aeat.map.tax.line.tax.csv +50 -0
- odoo/addons/l10n_es_verifactu_oca/data/mail_activity_data.xml +11 -0
- odoo/addons/l10n_es_verifactu_oca/data/neutralize.sql +2 -0
- odoo/addons/l10n_es_verifactu_oca/data/template/account.fiscal.position-es_common.csv +27 -0
- odoo/addons/l10n_es_verifactu_oca/data/verifactu.map.csv +2 -0
- odoo/addons/l10n_es_verifactu_oca/data/verifactu.map.line.csv +8 -0
- odoo/addons/l10n_es_verifactu_oca/data/verifactu_registration_key_data.xml +205 -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/es.po +1682 -0
- odoo/addons/l10n_es_verifactu_oca/i18n/l10n_es_verifactu_oca.pot +1640 -0
- odoo/addons/l10n_es_verifactu_oca/migrations/18.0.1.1.0/pre-migration.py +25 -0
- odoo/addons/l10n_es_verifactu_oca/models/__init__.py +15 -0
- odoo/addons/l10n_es_verifactu_oca/models/account_chart_template.py +17 -0
- odoo/addons/l10n_es_verifactu_oca/models/account_fiscal_position.py +34 -0
- odoo/addons/l10n_es_verifactu_oca/models/account_journal.py +64 -0
- odoo/addons/l10n_es_verifactu_oca/models/account_move.py +631 -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 +26 -0
- odoo/addons/l10n_es_verifactu_oca/models/verifactu_chaining.py +37 -0
- odoo/addons/l10n_es_verifactu_oca/models/verifactu_developer.py +16 -0
- odoo/addons/l10n_es_verifactu_oca/models/verifactu_invoice_entry.py +398 -0
- odoo/addons/l10n_es_verifactu_oca/models/verifactu_invoice_entry_response.py +116 -0
- odoo/addons/l10n_es_verifactu_oca/models/verifactu_invoice_entry_response_line.py +47 -0
- odoo/addons/l10n_es_verifactu_oca/models/verifactu_map.py +68 -0
- odoo/addons/l10n_es_verifactu_oca/models/verifactu_mixin.py +485 -0
- odoo/addons/l10n_es_verifactu_oca/models/verifactu_registration_key.py +26 -0
- odoo/addons/l10n_es_verifactu_oca/readme/CONFIGURE.md +27 -0
- odoo/addons/l10n_es_verifactu_oca/readme/CONTRIBUTORS.md +18 -0
- odoo/addons/l10n_es_verifactu_oca/readme/DESCRIPTION.md +1 -0
- odoo/addons/l10n_es_verifactu_oca/readme/INSTALL.md +6 -0
- odoo/addons/l10n_es_verifactu_oca/readme/ROADMAP.md +30 -0
- odoo/addons/l10n_es_verifactu_oca/readme/USAGE.md +3 -0
- odoo/addons/l10n_es_verifactu_oca/security/ir.model.access.csv +23 -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 +551 -0
- odoo/addons/l10n_es_verifactu_oca/tests/__init__.py +2 -0
- odoo/addons/l10n_es_verifactu_oca/tests/common.py +281 -0
- odoo/addons/l10n_es_verifactu_oca/tests/json/verifactu_mocked_response_accepted_with_errors.json +35 -0
- odoo/addons/l10n_es_verifactu_oca/tests/json/verifactu_mocked_response_cancel.json +35 -0
- odoo/addons/l10n_es_verifactu_oca/tests/json/verifactu_mocked_response_cancel_incorrect.json +37 -0
- odoo/addons/l10n_es_verifactu_oca/tests/json/verifactu_mocked_response_cancel_with_errors.json +35 -0
- odoo/addons/l10n_es_verifactu_oca/tests/json/verifactu_mocked_response_correct.json +35 -0
- odoo/addons/l10n_es_verifactu_oca/tests/json/verifactu_mocked_response_duplicated.json +43 -0
- odoo/addons/l10n_es_verifactu_oca/tests/json/verifactu_mocked_response_incorrect.json +37 -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 +506 -0
- odoo/addons/l10n_es_verifactu_oca/tests/test_verifactu_invoice.py +348 -0
- odoo/addons/l10n_es_verifactu_oca/views/account_fiscal_position_view.xml +29 -0
- odoo/addons/l10n_es_verifactu_oca/views/account_journal_view.xml +22 -0
- odoo/addons/l10n_es_verifactu_oca/views/account_move_view.xml +237 -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 +53 -0
- odoo/addons/l10n_es_verifactu_oca/views/res_company_view.xml +50 -0
- odoo/addons/l10n_es_verifactu_oca/views/verifactu_chaining_view.xml +45 -0
- odoo/addons/l10n_es_verifactu_oca/views/verifactu_developer_view.xml +46 -0
- odoo/addons/l10n_es_verifactu_oca/views/verifactu_invoice_entry_response_view.xml +134 -0
- odoo/addons/l10n_es_verifactu_oca/views/verifactu_invoice_entry_view.xml +127 -0
- odoo/addons/l10n_es_verifactu_oca/views/verifactu_map_lines_view.xml +16 -0
- odoo/addons/l10n_es_verifactu_oca/views/verifactu_map_view.xml +54 -0
- odoo/addons/l10n_es_verifactu_oca/views/verifactu_registration_keys_view.xml +43 -0
- odoo/addons/l10n_es_verifactu_oca/wizards/__init__.py +2 -0
- odoo/addons/l10n_es_verifactu_oca/wizards/account_move_reversal.py +16 -0
- odoo/addons/l10n_es_verifactu_oca/wizards/verifactu_cancel_invoice_wizard.py +24 -0
- odoo/addons/l10n_es_verifactu_oca/wizards/verifactu_cancel_invoice_wizard_view.xml +35 -0
- odoo_addon_l10n_es_verifactu_oca-18.0.1.2.1.dist-info/METADATA +213 -0
- odoo_addon_l10n_es_verifactu_oca-18.0.1.2.1.dist-info/RECORD +78 -0
- odoo_addon_l10n_es_verifactu_oca-18.0.1.2.1.dist-info/WHEEL +5 -0
- odoo_addon_l10n_es_verifactu_oca-18.0.1.2.1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Copyright 2025 Factor Libre - Almudena de La Puente
|
|
2
|
+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
def migrate(cr, version):
|
|
6
|
+
cr.execute(
|
|
7
|
+
"""UPDATE verifactu_invoice_entry
|
|
8
|
+
SET send_state = 'sent'
|
|
9
|
+
WHERE send_state = 'correct'"""
|
|
10
|
+
)
|
|
11
|
+
cr.execute(
|
|
12
|
+
"""UPDATE verifactu_invoice_entry
|
|
13
|
+
SET send_state = 'sent_w_errors'
|
|
14
|
+
WHERE send_state = 'accepted_with_errors'"""
|
|
15
|
+
)
|
|
16
|
+
cr.execute(
|
|
17
|
+
"""UPDATE verifactu_invoice_entry_response_line
|
|
18
|
+
SET send_state = 'sent'
|
|
19
|
+
WHERE send_state = 'correct'"""
|
|
20
|
+
)
|
|
21
|
+
cr.execute(
|
|
22
|
+
"""UPDATE verifactu_invoice_entry_response_line
|
|
23
|
+
SET send_state = 'sent_w_errors'
|
|
24
|
+
WHERE send_state = 'accepted_with_errors'"""
|
|
25
|
+
)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
from . import account_chart_template
|
|
2
|
+
from . import account_journal
|
|
3
|
+
from . import res_company
|
|
4
|
+
from . import verifactu_mixin
|
|
5
|
+
from . import verifactu_invoice_entry
|
|
6
|
+
from . import account_move
|
|
7
|
+
from . import aeat_tax_agency
|
|
8
|
+
from . import account_fiscal_position
|
|
9
|
+
from . import res_partner
|
|
10
|
+
from . import verifactu_map
|
|
11
|
+
from . import verifactu_registration_key
|
|
12
|
+
from . import verifactu_developer
|
|
13
|
+
from . import verifactu_invoice_entry_response
|
|
14
|
+
from . import verifactu_invoice_entry_response_line
|
|
15
|
+
from . import verifactu_chaining
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Copyright 20254 Tecnativa - Pedro M. Baeza
|
|
2
|
+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
|
3
|
+
from odoo import models
|
|
4
|
+
|
|
5
|
+
from odoo.addons.account.models.chart_template import template
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class AccountChartTemplate(models.AbstractModel):
|
|
9
|
+
_inherit = "account.chart.template"
|
|
10
|
+
|
|
11
|
+
@template("es_common_mainland", "account.fiscal.position")
|
|
12
|
+
def _get_es_facturae_account_tax(self):
|
|
13
|
+
return self._parse_csv(
|
|
14
|
+
"es_common_mainland",
|
|
15
|
+
"account.fiscal.position",
|
|
16
|
+
module="l10n_es_verifactu_oca",
|
|
17
|
+
)
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Copyright 2024 Aures TIC - Jose Zambudio <jose@aurestic.es>
|
|
2
|
+
# Copyright 2024 Aures TIC - Almudena de La Puente <almudena@aurestic.es>
|
|
3
|
+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
|
4
|
+
|
|
5
|
+
from odoo import api, fields, models
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class AccountFiscalPosition(models.Model):
|
|
9
|
+
_inherit = "account.fiscal.position"
|
|
10
|
+
|
|
11
|
+
verifactu_enabled = fields.Boolean(
|
|
12
|
+
related="company_id.verifactu_enabled", readonly=True
|
|
13
|
+
)
|
|
14
|
+
verifactu_tax_key = fields.Selection(
|
|
15
|
+
selection="_get_verifactu_tax_keys", default="01", string="VERI*FACTU tax key"
|
|
16
|
+
)
|
|
17
|
+
verifactu_registration_key = fields.Many2one(
|
|
18
|
+
comodel_name="verifactu.registration.key",
|
|
19
|
+
ondelete="restrict",
|
|
20
|
+
string="VERI*FACTU registration key",
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
@api.model
|
|
24
|
+
def _get_verifactu_tax_keys(self):
|
|
25
|
+
return [
|
|
26
|
+
("01", "Impuesto sobre el Valor Añadido (IVA)"),
|
|
27
|
+
(
|
|
28
|
+
"02",
|
|
29
|
+
"Impuesto sobre la Producción, los Servicios y "
|
|
30
|
+
"la Importación (IPSI) de Ceuta y Melilla",
|
|
31
|
+
),
|
|
32
|
+
("03", "Impuesto General Indirecto Canario (IGIC)"),
|
|
33
|
+
("05", "Otros"),
|
|
34
|
+
]
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# Copyright 2024 Aures TIC - Jose Zambudio
|
|
2
|
+
# Copyright 2024 Aures TIC - Almudena de La Puente
|
|
3
|
+
# Copyright 2025 Tecnativa - Pedro M. Baeza
|
|
4
|
+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
|
5
|
+
|
|
6
|
+
from odoo import _, api, fields, models
|
|
7
|
+
from odoo.exceptions import ValidationError
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class AccountJournal(models.Model):
|
|
11
|
+
_inherit = "account.journal"
|
|
12
|
+
|
|
13
|
+
# This field from Odoo upstream is converted here to computed writable
|
|
14
|
+
restrict_mode_hash_table = fields.Boolean(
|
|
15
|
+
compute="_compute_restrict_mode_hash_table", store=True, readonly=False
|
|
16
|
+
)
|
|
17
|
+
restrict_mode_hash_table_readonly = fields.Boolean(
|
|
18
|
+
store=True, compute="_compute_restrict_mode_hash_table"
|
|
19
|
+
)
|
|
20
|
+
company_verifactu_enabled = fields.Boolean(
|
|
21
|
+
related="company_id.verifactu_enabled", string="VERI*FACTU company enabled"
|
|
22
|
+
)
|
|
23
|
+
verifactu_enabled = fields.Boolean(string="VERI*FACTU enabled", default=True)
|
|
24
|
+
|
|
25
|
+
@api.depends(
|
|
26
|
+
"company_id", "company_id.verifactu_enabled", "verifactu_enabled", "type"
|
|
27
|
+
) # company_id* triggers aren't launched anyway - see res.company~write method
|
|
28
|
+
def _compute_restrict_mode_hash_table(self):
|
|
29
|
+
self.restrict_mode_hash_table = False
|
|
30
|
+
self.restrict_mode_hash_table_readonly = False
|
|
31
|
+
for record in self:
|
|
32
|
+
if (
|
|
33
|
+
record.company_id.verifactu_enabled
|
|
34
|
+
and record.verifactu_enabled
|
|
35
|
+
and record.type == "sale"
|
|
36
|
+
):
|
|
37
|
+
record.restrict_mode_hash_table = True
|
|
38
|
+
record.restrict_mode_hash_table_readonly = True
|
|
39
|
+
|
|
40
|
+
def check_hash_modification(self, vals):
|
|
41
|
+
verifactu_enabled = vals.get("verifactu_enabled", self.verifactu_enabled)
|
|
42
|
+
company_id = vals.get("company_id", self.company_id.id)
|
|
43
|
+
company = self.env["res.company"].browse(company_id)
|
|
44
|
+
journal_type = vals.get("type", self.type)
|
|
45
|
+
if verifactu_enabled and journal_type == "sale" and company.verifactu_enabled:
|
|
46
|
+
raise ValidationError(
|
|
47
|
+
_(
|
|
48
|
+
"You can't have a sale journal with VERI*FACTU enabled "
|
|
49
|
+
"and not restricted hash modification."
|
|
50
|
+
)
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
@api.model_create_multi
|
|
54
|
+
def create(self, vals_list):
|
|
55
|
+
for vals in vals_list:
|
|
56
|
+
if vals.get("restrict_mode_hash_table") is False:
|
|
57
|
+
self.check_hash_modification(vals)
|
|
58
|
+
return super().create(vals_list)
|
|
59
|
+
|
|
60
|
+
def write(self, vals):
|
|
61
|
+
if vals.get("restrict_mode_hash_table") is False:
|
|
62
|
+
for record in self:
|
|
63
|
+
record.check_hash_modification(vals)
|
|
64
|
+
return super().write(vals)
|