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,16 @@
|
|
|
1
|
+
from . import account_journal
|
|
2
|
+
from . import res_company
|
|
3
|
+
from . import verifactu_mixin
|
|
4
|
+
from . import verifactu_invoice_entry
|
|
5
|
+
from . import account_move
|
|
6
|
+
from . import aeat_tax_agency
|
|
7
|
+
from . import aeat_mixin
|
|
8
|
+
from . import account_fiscal_position
|
|
9
|
+
from . import account_fiscal_position_template
|
|
10
|
+
from . import res_partner
|
|
11
|
+
from . import verifactu_map
|
|
12
|
+
from . import verifactu_registration_key
|
|
13
|
+
from . import verifactu_developer
|
|
14
|
+
from . import verifactu_invoice_entry_response
|
|
15
|
+
from . import verifactu_invoice_entry_response_line
|
|
16
|
+
from . import verifactu_chaining
|
|
@@ -0,0 +1,40 @@
|
|
|
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
|
+
aeat_active = fields.Boolean(
|
|
23
|
+
string="AEAT Active",
|
|
24
|
+
copy=False,
|
|
25
|
+
default=True,
|
|
26
|
+
help="Enable AEAT communication for this fiscal position?",
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
@api.model
|
|
30
|
+
def _get_verifactu_tax_keys(self):
|
|
31
|
+
return [
|
|
32
|
+
("01", "Impuesto sobre el Valor Añadido (IVA)"),
|
|
33
|
+
(
|
|
34
|
+
"02",
|
|
35
|
+
"Impuesto sobre la Producción, los Servicios y "
|
|
36
|
+
"la Importación (IPSI) de Ceuta y Melilla",
|
|
37
|
+
),
|
|
38
|
+
("03", "Impuesto General Indirecto Canario (IGIC)"),
|
|
39
|
+
("05", "Otros"),
|
|
40
|
+
]
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
from odoo import api, fields, models
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class AccountFiscalPositionTemplate(models.Model):
|
|
5
|
+
_inherit = "account.fiscal.position.template"
|
|
6
|
+
|
|
7
|
+
verifactu_tax_key = fields.Selection(
|
|
8
|
+
selection="_get_verifactu_tax_keys", string="VERI*FACTU tax key"
|
|
9
|
+
)
|
|
10
|
+
verifactu_registration_key = fields.Many2one(
|
|
11
|
+
comodel_name="verifactu.registration.key",
|
|
12
|
+
string="VERI*FACTU registration key",
|
|
13
|
+
ondelete="restrict",
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
@api.model
|
|
17
|
+
def _get_verifactu_tax_keys(self):
|
|
18
|
+
return self.env["account.fiscal.position"]._get_verifactu_tax_keys()
|
|
@@ -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)
|