diff --git a/l10n_es_aeat/models/__init__.py b/l10n_es_aeat/models/__init__.py index adba2a03bf8..05dce909fdd 100644 --- a/l10n_es_aeat/models/__init__.py +++ b/l10n_es_aeat/models/__init__.py @@ -1,18 +1,20 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from . import account_fiscal_position from . import account_journal from . import account_move from . import account_tax -from . import res_company -from . import res_partner -from . import res_partner_bank +from . import aeat_certificate +from . import aeat_mixin +from . import aeat_soap +from . import aeat_tax_agency +from . import l10n_es_aeat_export_config +from . import l10n_es_aeat_export_config_line from . import l10n_es_aeat_map_tax from . import l10n_es_aeat_map_tax_line from . import l10n_es_aeat_report from . import l10n_es_aeat_report_tax_mapping from . import l10n_es_aeat_tax_line -from . import l10n_es_aeat_export_config -from . import l10n_es_aeat_export_config_line -from . import aeat_certificate -from . import aeat_soap -from . import aeat_tax_agency +from . import res_company +from . import res_partner +from . import res_partner_bank diff --git a/l10n_es_aeat/models/account_fiscal_position.py b/l10n_es_aeat/models/account_fiscal_position.py new file mode 100644 index 00000000000..c72a6ee102e --- /dev/null +++ b/l10n_es_aeat/models/account_fiscal_position.py @@ -0,0 +1,16 @@ +# Copyright 2017 FactorLibre - Ismael Calvo +# Copyright 2024 Aures TIC - Jose Zambudio +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import fields, models + + +class AccountFiscalPosition(models.Model): + _inherit = "account.fiscal.position" + + aeat_active = fields.Boolean( + string="AEAT Active", + copy=False, + default=True, + help="Enable AEAT communication for this fiscal position?", + ) \ No newline at end of file diff --git a/l10n_es_aeat/models/aeat_mixin.py b/l10n_es_aeat/models/aeat_mixin.py new file mode 100644 index 00000000000..3885cd762ca --- /dev/null +++ b/l10n_es_aeat/models/aeat_mixin.py @@ -0,0 +1,163 @@ +# Copyright 2021 Tecnativa - João Marques +# Copyright 2022 ForgeFlow - Lois Rilo +# Copyright 2011-2023 Tecnativa - Pedro M. Baeza +# Copyright 2023 Aures Tic - Almudena de la Puente +# Copyright 2023-2024 Aures Tic - Jose Zambudio +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +import logging + +from requests import Session + +from odoo import _, api, fields, models +from odoo.exceptions import UserError + +_logger = logging.getLogger(__name__) + +try: + from zeep import Client + from zeep.plugins import HistoryPlugin + from zeep.transports import Transport +except (ImportError, IOError) as err: + _logger.debug(err) + +AEAT_DATE_FORMAT = "%d-%m-%Y" +AEAT_STATES = [ + ("not_sent", "Not sent"), + ("sent", "Sent"), + ("sent_w_errors", "Accepted with errors"), +] + + +def round_by_keys(elem, search_keys, prec=2): + """This uses ``round`` method directly as if has been tested that Odoo's + ``float_round`` still returns incorrect amounts for certain values. Try + 3 units x 3,77 €/unit with 10% tax and you will be hit by the error + (on regular x86 architectures).""" + if isinstance(elem, dict): + for key, value in elem.items(): + if key in search_keys: + elem[key] = round(elem[key], prec) + else: + round_by_keys(value, search_keys) + elif isinstance(elem, list): + for value in elem: + round_by_keys(value, search_keys) + + +class AeatMixin(models.AbstractModel): + _name = "aeat.mixin" + _description = "Aeat Mixin" + + aeat_state = fields.Selection( + selection=AEAT_STATES, + string="AEAT send state", + default="not_sent", + readonly=True, + copy=False, + help="Indicates the state of this document in relation with the " + "presentation at the AEAT", + ) + aeat_send_error = fields.Text( + string="AEAT Send Error", + readonly=True, + copy=False, + ) + aeat_send_failed = fields.Boolean( + string="SII send failed", + copy=False, + help="Indicates that the last attempt to communicate this document to " + "the SII has failed. See SII return for details", + ) + aeat_header_sent = fields.Text( + string="AEAT last header sent", + copy=False, + readonly=True, + ) + aeat_content_sent = fields.Text( + string="AEAT last content sent", + copy=False, + readonly=True, + ) + + def _get_document_date(self): + raise NotImplementedError() + + def _get_document_serial_number(self): + raise NotImplementedError() + + def _aeat_get_partner(self): + raise NotImplementedError() + + def _get_document_fiscal_date(self): + raise NotImplementedError() + + def _get_document_fiscal_year(self): + return fields.Date.to_date(self._get_document_fiscal_date()).year + + def _change_date_format(self, date): + datetimeobject = fields.Date.to_date(date) + new_date = datetimeobject.strftime(AEAT_DATE_FORMAT) + return new_date + + def _get_document_period(self): + return "%02d" % fields.Date.to_date(self._get_document_fiscal_date()).month + + def _is_aeat_simplified_invoice(self): + """Inheritable method to allow control when an + invoice are simplified or normal""" + return self._aeat_get_partner().aeat_simplified_invoice + + def _get_document_amount_total(self): + raise NotImplementedError() + + def _get_mapping_key(self): + raise NotImplementedError() + + def _get_aeat_invoice_dict(self): + raise NotImplementedError() + + @api.model + def _get_aeat_taxes_map(self, codes, date): + raise NotImplementedError() + + def _get_valid_document_states(self): + raise NotImplementedError() + + def _get_aeat_header(self, tipo_comunicacion=False, cancellation=False): + raise NotImplementedError() + + def _bind_service(self, client, port_name, address=None): + raise NotImplementedError() + + def _connect_params_aeat(self, mapping_key): + raise NotImplementedError() + + def _connect_aeat(self, mapping_key): + self.ensure_one() + public_crt, private_key = self.env["l10n.es.aeat.certificate"].get_certificates( + company=self.company_id + ) + params = self._connect_params_aeat(mapping_key) + session = Session() + session.cert = (public_crt, private_key) + transport = Transport(session=session) + history = HistoryPlugin() + client = Client(wsdl=params["wsdl"], transport=transport, plugins=[history]) + return self._bind_service(client, params["port_name"], params["address"]) + + def _get_aeat_country_code(self): + self.ensure_one() + return self._aeat_get_partner()._parse_aeat_vat_info()[0] + + def _aeat_check_exceptions(self): + """Inheritable method for exceptions control when sending AEAT documentss.""" + self.ensure_one() + partner = self._aeat_get_partner() + country_code = self._get_aeat_country_code() + is_simplified_invoice = self._is_aeat_simplified_invoice() + if country_code == "ES" and not partner.vat and not is_simplified_invoice: + raise UserError(_("The partner has not a VAT configured.")) + if not self.company_id.chart_template_id: + raise UserError( + _("You have to select what account chart template use this" " company.") + ) \ No newline at end of file diff --git a/l10n_es_aeat/models/res_partner.py b/l10n_es_aeat/models/res_partner.py index 0aae1d79a80..30e73131706 100644 --- a/l10n_es_aeat/models/res_partner.py +++ b/l10n_es_aeat/models/res_partner.py @@ -1,4 +1,5 @@ # Copyright 2019 Tecnativa - Carlos Dauden +# Copyright 2017 Tecnativa - Pedro M. Baeza # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from odoo import fields, models @@ -15,8 +16,8 @@ class ResPartner(models.Model): aeat_identification_type = fields.Selection( string="AEAT Identification type", help=( - "Used to specify an identification type to send to SII. Normally for " - "sending national and export invoices to SII where the customer country " + "Used to specify an identification type to send to AEAT. Normally for " + "sending national and export invoices to AEAT where the customer country " "is not Spain, it would calculate an identification type of 04 if the VAT " "field is filled and 06 if it was not. This field is to specify " "types of 03 through 05, in the event that the customer doesn't identify " @@ -35,6 +36,17 @@ class ResPartner(models.Model): # 02 - NIF - VAT # 04 - Official document from the original country # 07 - Not registered on census + aeat_simplified_invoice = fields.Boolean( + string="Simplified invoices in AEAT?", + help="Checking this mark, invoices done to this partner will be " + "sent to AEAT as simplified invoices.", + ) + aeat_sending_enabled = fields.Boolean( + compute="_compute_aeat_sending_enabled", + ) + + def _compute_aeat_sending_enabled(self): + self.aeat_sending_enabled = False def _map_aeat_country_code(self, country_code, extended=False): """Map country codes according the fiscal conditions. diff --git a/l10n_es_aeat/static/description/index.html b/l10n_es_aeat/static/description/index.html index 3ea4701d3b4..93a1f70ba53 100644 --- a/l10n_es_aeat/static/description/index.html +++ b/l10n_es_aeat/static/description/index.html @@ -301,7 +301,7 @@ span.pre { white-space: pre } -span.problematic, pre.problematic { +span.problematic, pre.problematic, pre.problematic { color: red } span.section-subtitle { diff --git a/l10n_es_aeat/views/res_partner_view.xml b/l10n_es_aeat/views/res_partner_view.xml index 90b5ad3a685..8a85d350bea 100644 --- a/l10n_es_aeat/views/res_partner_view.xml +++ b/l10n_es_aeat/views/res_partner_view.xml @@ -16,6 +16,13 @@ + + + + diff --git a/l10n_es_aeat_sii_match/models/account_move.py b/l10n_es_aeat_sii_match/models/account_move.py index e6610998008..7eaa076d54c 100644 --- a/l10n_es_aeat_sii_match/models/account_move.py +++ b/l10n_es_aeat_sii_match/models/account_move.py @@ -104,8 +104,8 @@ def _get_diffs(self, odoo_values, sii_values): def _get_diffs_values(self, sii_values): self.ensure_one() res = [] - if self.sii_content_sent: - odoo_values = json.loads(self.sii_content_sent) + if self.aeat_content_sent: + odoo_values = json.loads(self.aeat_content_sent) if self.move_type in ["out_invoice", "out_refund"]: res += self._get_diffs( odoo_values["FacturaExpedida"], sii_values["DatosFacturaEmitida"] @@ -135,7 +135,7 @@ def _process_invoice_for_contrast_aeat(self): def contrast_aeat(self): invoices = self.filtered( lambda i: ( - i.sii_state == "sent" + i.aeat_state == "sent" and i.state == "posted" and i.sii_csv and i.sii_enabled @@ -162,7 +162,7 @@ def direct_contrast_aeat(self): if ( self.sii_csv and self.sii_enabled - and self.sii_state == "sent" + and self.aeat_state == "sent" and self.state == "posted" ): self._contrast_invoice_to_aeat() @@ -197,7 +197,7 @@ def _get_contrast_invoice_dict_out(self): "FechaExpedicionFacturaEmisor": invoice_date, }, } - if not partner.sii_simplified_invoice: + if not partner.aeat_simplified_invoice: # Simplified invoices don't have counterpart inv_dict["Contraparte"] = {"NombreRazon": partner.name[0:120]} # Uso condicional de IDOtro/NIF @@ -231,7 +231,7 @@ def _get_contrast_invoice_dict_in(self): def _get_contrast_invoice_dict(self): self.ensure_one() - self._sii_check_exceptions() + self._aeat_check_exceptions() if self.move_type in ["out_invoice", "out_refund"]: return self._get_contrast_invoice_dict_out() elif self.move_type in ["in_invoice", "in_refund"]: @@ -240,8 +240,8 @@ def _get_contrast_invoice_dict(self): def _contrast_invoice_to_aeat(self): for invoice in self.filtered(lambda i: i.state == "posted"): - serv = invoice._connect_sii(invoice.move_type) - header = invoice._get_sii_header(False, True) + serv = invoice._connect_aeat(invoice.move_type) + header = invoice._get_aeat_header(False, True) inv_vals = {} try: inv_dict = invoice._get_contrast_invoice_dict() diff --git a/l10n_es_aeat_sii_match/models/aeat_sii_match_report.py b/l10n_es_aeat_sii_match/models/aeat_sii_match_report.py index 1fabe95da95..30afe04738d 100644 --- a/l10n_es_aeat_sii_match/models/aeat_sii_match_report.py +++ b/l10n_es_aeat_sii_match/models/aeat_sii_match_report.py @@ -371,9 +371,9 @@ def _get_invoices_from_sii(self): if sii_match_report.invoice_type == "in": mapping_key = "in_invoice" serv = ( - self.env["account.move"].search([], limit=1)._connect_sii(mapping_key) + self.env["account.move"].search([], limit=1)._connect_aeat(mapping_key) ) - header = sii_match_report._get_sii_header() + header = sii_match_report._get_aeat_header() match_vals = {} summary = {} try: @@ -426,7 +426,7 @@ def _get_invoices_from_sii(self): new_cr.close() raise - def _get_sii_header(self): + def _get_aeat_header(self): """Builds SII send header :return Dict with header data depending on cancellation diff --git a/l10n_es_aeat_sii_match/tests/test_l10n_es_aeat_sii_match.py b/l10n_es_aeat_sii_match/tests/test_l10n_es_aeat_sii_match.py index d0d50e8d1a8..859f876753e 100644 --- a/l10n_es_aeat_sii_match/tests/test_l10n_es_aeat_sii_match.py +++ b/l10n_es_aeat_sii_match/tests/test_l10n_es_aeat_sii_match.py @@ -22,7 +22,7 @@ def setUpClass(cls): def test_invoice_diffs_values(self): self._activate_certificate() invoice = self.invoice - invoice.sii_state = "sent" - invoice.sii_csv = invoice._get_sii_invoice_dict() + invoice.aeat_state = "sent" + invoice.sii_csv = invoice._get_aeat_invoice_dict() res = invoice._get_diffs_values(invoice.sii_csv) self.assertEqual(res, []) diff --git a/l10n_es_aeat_sii_match/views/account_move_views.xml b/l10n_es_aeat_sii_match/views/account_move_views.xml index 55588de7ec9..16f34737fa4 100644 --- a/l10n_es_aeat_sii_match/views/account_move_views.xml +++ b/l10n_es_aeat_sii_match/views/account_move_views.xml @@ -18,7 +18,7 @@ ('sii_csv', '=', False)]}" /> - + diff --git a/l10n_es_aeat_sii_oca/i18n/bg.po b/l10n_es_aeat_sii_oca/i18n/bg.po index ae4c24bb034..8b884e402f6 100644 --- a/l10n_es_aeat_sii_oca/i18n/bg.po +++ b/l10n_es_aeat_sii_oca/i18n/bg.po @@ -196,8 +196,8 @@ msgid "" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_partner__sii_simplified_invoice -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_users__sii_simplified_invoice +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_partner__aeat_simplified_invoice +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_users__aeat_simplified_invoice msgid "" "Checking this mark, invoices done to this partner will be sent to SII as " "simplified invoices." @@ -324,7 +324,7 @@ msgid "Enable SII" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_account_fiscal_position__sii_active +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_account_fiscal_position__aeat_active msgid "Enable SII for this fiscal position?" msgstr "" @@ -650,7 +650,7 @@ msgid "SII" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_account_fiscal_position__sii_active +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_account_fiscal_position__aeat_active msgid "SII Active" msgstr "" @@ -908,8 +908,8 @@ msgid "Sii Refund Specific Invoice Type" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_partner__sii_simplified_invoice -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_users__sii_simplified_invoice +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_partner__aeat_simplified_invoice +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_users__aeat_simplified_invoice msgid "Simplified invoices in SII?" msgstr "" diff --git a/l10n_es_aeat_sii_oca/i18n/ca.po b/l10n_es_aeat_sii_oca/i18n/ca.po index 2ebd4ceb937..d41b54b81f7 100644 --- a/l10n_es_aeat_sii_oca/i18n/ca.po +++ b/l10n_es_aeat_sii_oca/i18n/ca.po @@ -208,8 +208,8 @@ msgid "" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_partner__sii_simplified_invoice -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_users__sii_simplified_invoice +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_partner__aeat_simplified_invoice +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_users__aeat_simplified_invoice msgid "" "Checking this mark, invoices done to this partner will be sent to SII as " "simplified invoices." @@ -338,7 +338,7 @@ msgid "Enable SII" msgstr "Activa SII" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_account_fiscal_position__sii_active +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_account_fiscal_position__aeat_active msgid "Enable SII for this fiscal position?" msgstr "Voleu activar SII per a aquesta posició fiscal?" @@ -676,7 +676,7 @@ msgid "SII" msgstr "SII" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_account_fiscal_position__sii_active +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_account_fiscal_position__aeat_active msgid "SII Active" msgstr "SII Actiu" @@ -934,8 +934,8 @@ msgid "Sii Refund Specific Invoice Type" msgstr "Tipus de factura específica d'abonament de SII" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_partner__sii_simplified_invoice -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_users__sii_simplified_invoice +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_partner__aeat_simplified_invoice +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_users__aeat_simplified_invoice msgid "Simplified invoices in SII?" msgstr "Factures simplificades a SII?" diff --git a/l10n_es_aeat_sii_oca/i18n/cs.po b/l10n_es_aeat_sii_oca/i18n/cs.po index 61de9dc2f94..d7acece9b45 100644 --- a/l10n_es_aeat_sii_oca/i18n/cs.po +++ b/l10n_es_aeat_sii_oca/i18n/cs.po @@ -196,8 +196,8 @@ msgid "" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_partner__sii_simplified_invoice -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_users__sii_simplified_invoice +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_partner__aeat_simplified_invoice +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_users__aeat_simplified_invoice msgid "" "Checking this mark, invoices done to this partner will be sent to SII as " "simplified invoices." @@ -324,7 +324,7 @@ msgid "Enable SII" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_account_fiscal_position__sii_active +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_account_fiscal_position__aeat_active msgid "Enable SII for this fiscal position?" msgstr "" @@ -650,7 +650,7 @@ msgid "SII" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_account_fiscal_position__sii_active +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_account_fiscal_position__aeat_active msgid "SII Active" msgstr "" @@ -908,8 +908,8 @@ msgid "Sii Refund Specific Invoice Type" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_partner__sii_simplified_invoice -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_users__sii_simplified_invoice +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_partner__aeat_simplified_invoice +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_users__aeat_simplified_invoice msgid "Simplified invoices in SII?" msgstr "" diff --git a/l10n_es_aeat_sii_oca/i18n/de.po b/l10n_es_aeat_sii_oca/i18n/de.po index d934e561f44..b0868432081 100644 --- a/l10n_es_aeat_sii_oca/i18n/de.po +++ b/l10n_es_aeat_sii_oca/i18n/de.po @@ -196,8 +196,8 @@ msgid "" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_partner__sii_simplified_invoice -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_users__sii_simplified_invoice +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_partner__aeat_simplified_invoice +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_users__aeat_simplified_invoice msgid "" "Checking this mark, invoices done to this partner will be sent to SII as " "simplified invoices." @@ -324,7 +324,7 @@ msgid "Enable SII" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_account_fiscal_position__sii_active +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_account_fiscal_position__aeat_active msgid "Enable SII for this fiscal position?" msgstr "" @@ -650,7 +650,7 @@ msgid "SII" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_account_fiscal_position__sii_active +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_account_fiscal_position__aeat_active msgid "SII Active" msgstr "" @@ -908,8 +908,8 @@ msgid "Sii Refund Specific Invoice Type" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_partner__sii_simplified_invoice -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_users__sii_simplified_invoice +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_partner__aeat_simplified_invoice +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_users__aeat_simplified_invoice msgid "Simplified invoices in SII?" msgstr "" diff --git a/l10n_es_aeat_sii_oca/i18n/es.po b/l10n_es_aeat_sii_oca/i18n/es.po index 2e2d7597ce1..a3821702242 100644 --- a/l10n_es_aeat_sii_oca/i18n/es.po +++ b/l10n_es_aeat_sii_oca/i18n/es.po @@ -208,8 +208,8 @@ msgstr "" "000 000,00 euros." #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_partner__sii_simplified_invoice -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_users__sii_simplified_invoice +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_partner__aeat_simplified_invoice +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_users__aeat_simplified_invoice msgid "" "Checking this mark, invoices done to this partner will be sent to SII as " "simplified invoices." @@ -338,7 +338,7 @@ msgid "Enable SII" msgstr "Activar SII" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_account_fiscal_position__sii_active +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_account_fiscal_position__aeat_active msgid "Enable SII for this fiscal position?" msgstr "¿Activar SII para esta posición fiscal?" @@ -683,7 +683,7 @@ msgid "SII" msgstr "SII" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_account_fiscal_position__sii_active +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_account_fiscal_position__aeat_active msgid "SII Active" msgstr "Activa para el SII" @@ -941,8 +941,8 @@ msgid "Sii Refund Specific Invoice Type" msgstr "Tipo específico de factura rectificativa SII" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_partner__sii_simplified_invoice -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_users__sii_simplified_invoice +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_partner__aeat_simplified_invoice +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_users__aeat_simplified_invoice msgid "Simplified invoices in SII?" msgstr "¿Facturas simplificadas en el SII?" diff --git a/l10n_es_aeat_sii_oca/i18n/es_CO.po b/l10n_es_aeat_sii_oca/i18n/es_CO.po index f4f8e311068..806d53f752f 100644 --- a/l10n_es_aeat_sii_oca/i18n/es_CO.po +++ b/l10n_es_aeat_sii_oca/i18n/es_CO.po @@ -197,8 +197,8 @@ msgid "" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_partner__sii_simplified_invoice -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_users__sii_simplified_invoice +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_partner__aeat_simplified_invoice +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_users__aeat_simplified_invoice msgid "" "Checking this mark, invoices done to this partner will be sent to SII as " "simplified invoices." @@ -325,7 +325,7 @@ msgid "Enable SII" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_account_fiscal_position__sii_active +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_account_fiscal_position__aeat_active msgid "Enable SII for this fiscal position?" msgstr "" @@ -651,7 +651,7 @@ msgid "SII" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_account_fiscal_position__sii_active +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_account_fiscal_position__aeat_active msgid "SII Active" msgstr "" @@ -909,8 +909,8 @@ msgid "Sii Refund Specific Invoice Type" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_partner__sii_simplified_invoice -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_users__sii_simplified_invoice +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_partner__aeat_simplified_invoice +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_users__aeat_simplified_invoice msgid "Simplified invoices in SII?" msgstr "" diff --git a/l10n_es_aeat_sii_oca/i18n/es_CR.po b/l10n_es_aeat_sii_oca/i18n/es_CR.po index 06d8d1b1d01..93756db0313 100644 --- a/l10n_es_aeat_sii_oca/i18n/es_CR.po +++ b/l10n_es_aeat_sii_oca/i18n/es_CR.po @@ -197,8 +197,8 @@ msgid "" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_partner__sii_simplified_invoice -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_users__sii_simplified_invoice +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_partner__aeat_simplified_invoice +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_users__aeat_simplified_invoice msgid "" "Checking this mark, invoices done to this partner will be sent to SII as " "simplified invoices." @@ -325,7 +325,7 @@ msgid "Enable SII" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_account_fiscal_position__sii_active +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_account_fiscal_position__aeat_active msgid "Enable SII for this fiscal position?" msgstr "" @@ -651,7 +651,7 @@ msgid "SII" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_account_fiscal_position__sii_active +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_account_fiscal_position__aeat_active msgid "SII Active" msgstr "" @@ -909,8 +909,8 @@ msgid "Sii Refund Specific Invoice Type" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_partner__sii_simplified_invoice -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_users__sii_simplified_invoice +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_partner__aeat_simplified_invoice +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_users__aeat_simplified_invoice msgid "Simplified invoices in SII?" msgstr "" diff --git a/l10n_es_aeat_sii_oca/i18n/eu.po b/l10n_es_aeat_sii_oca/i18n/eu.po index 2283da1abc8..35c36651b32 100644 --- a/l10n_es_aeat_sii_oca/i18n/eu.po +++ b/l10n_es_aeat_sii_oca/i18n/eu.po @@ -196,8 +196,8 @@ msgid "" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_partner__sii_simplified_invoice -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_users__sii_simplified_invoice +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_partner__aeat_simplified_invoice +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_users__aeat_simplified_invoice msgid "" "Checking this mark, invoices done to this partner will be sent to SII as " "simplified invoices." @@ -324,7 +324,7 @@ msgid "Enable SII" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_account_fiscal_position__sii_active +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_account_fiscal_position__aeat_active msgid "Enable SII for this fiscal position?" msgstr "" @@ -651,7 +651,7 @@ msgid "SII" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_account_fiscal_position__sii_active +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_account_fiscal_position__aeat_active msgid "SII Active" msgstr "" @@ -909,8 +909,8 @@ msgid "Sii Refund Specific Invoice Type" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_partner__sii_simplified_invoice -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_users__sii_simplified_invoice +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_partner__aeat_simplified_invoice +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_users__aeat_simplified_invoice msgid "Simplified invoices in SII?" msgstr "" diff --git a/l10n_es_aeat_sii_oca/i18n/fr.po b/l10n_es_aeat_sii_oca/i18n/fr.po index cb230ad2576..70b7dd7198f 100644 --- a/l10n_es_aeat_sii_oca/i18n/fr.po +++ b/l10n_es_aeat_sii_oca/i18n/fr.po @@ -196,8 +196,8 @@ msgid "" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_partner__sii_simplified_invoice -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_users__sii_simplified_invoice +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_partner__aeat_simplified_invoice +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_users__aeat_simplified_invoice msgid "" "Checking this mark, invoices done to this partner will be sent to SII as " "simplified invoices." @@ -324,7 +324,7 @@ msgid "Enable SII" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_account_fiscal_position__sii_active +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_account_fiscal_position__aeat_active msgid "Enable SII for this fiscal position?" msgstr "" @@ -650,7 +650,7 @@ msgid "SII" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_account_fiscal_position__sii_active +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_account_fiscal_position__aeat_active msgid "SII Active" msgstr "" @@ -908,8 +908,8 @@ msgid "Sii Refund Specific Invoice Type" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_partner__sii_simplified_invoice -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_users__sii_simplified_invoice +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_partner__aeat_simplified_invoice +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_users__aeat_simplified_invoice msgid "Simplified invoices in SII?" msgstr "" diff --git a/l10n_es_aeat_sii_oca/i18n/gl.po b/l10n_es_aeat_sii_oca/i18n/gl.po index 0c79fb671ff..71cadbe1453 100644 --- a/l10n_es_aeat_sii_oca/i18n/gl.po +++ b/l10n_es_aeat_sii_oca/i18n/gl.po @@ -197,8 +197,8 @@ msgid "" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_partner__sii_simplified_invoice -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_users__sii_simplified_invoice +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_partner__aeat_simplified_invoice +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_users__aeat_simplified_invoice msgid "" "Checking this mark, invoices done to this partner will be sent to SII as " "simplified invoices." @@ -325,7 +325,7 @@ msgid "Enable SII" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_account_fiscal_position__sii_active +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_account_fiscal_position__aeat_active msgid "Enable SII for this fiscal position?" msgstr "" @@ -651,7 +651,7 @@ msgid "SII" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_account_fiscal_position__sii_active +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_account_fiscal_position__aeat_active msgid "SII Active" msgstr "" @@ -909,8 +909,8 @@ msgid "Sii Refund Specific Invoice Type" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_partner__sii_simplified_invoice -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_users__sii_simplified_invoice +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_partner__aeat_simplified_invoice +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_users__aeat_simplified_invoice msgid "Simplified invoices in SII?" msgstr "" diff --git a/l10n_es_aeat_sii_oca/i18n/hr.po b/l10n_es_aeat_sii_oca/i18n/hr.po index c12760b6357..6dee61639b9 100644 --- a/l10n_es_aeat_sii_oca/i18n/hr.po +++ b/l10n_es_aeat_sii_oca/i18n/hr.po @@ -197,8 +197,8 @@ msgid "" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_partner__sii_simplified_invoice -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_users__sii_simplified_invoice +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_partner__aeat_simplified_invoice +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_users__aeat_simplified_invoice msgid "" "Checking this mark, invoices done to this partner will be sent to SII as " "simplified invoices." @@ -325,7 +325,7 @@ msgid "Enable SII" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_account_fiscal_position__sii_active +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_account_fiscal_position__aeat_active msgid "Enable SII for this fiscal position?" msgstr "" @@ -651,7 +651,7 @@ msgid "SII" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_account_fiscal_position__sii_active +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_account_fiscal_position__aeat_active msgid "SII Active" msgstr "" @@ -909,8 +909,8 @@ msgid "Sii Refund Specific Invoice Type" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_partner__sii_simplified_invoice -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_users__sii_simplified_invoice +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_partner__aeat_simplified_invoice +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_users__aeat_simplified_invoice msgid "Simplified invoices in SII?" msgstr "" diff --git a/l10n_es_aeat_sii_oca/i18n/l10n_es_aeat_sii_oca.pot b/l10n_es_aeat_sii_oca/i18n/l10n_es_aeat_sii_oca.pot index 303e2fe49c0..68d1f45d513 100644 --- a/l10n_es_aeat_sii_oca/i18n/l10n_es_aeat_sii_oca.pot +++ b/l10n_es_aeat_sii_oca/i18n/l10n_es_aeat_sii_oca.pot @@ -190,8 +190,8 @@ msgid "" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_partner__sii_simplified_invoice -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_users__sii_simplified_invoice +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_partner__aeat_simplified_invoice +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_users__aeat_simplified_invoice msgid "" "Checking this mark, invoices done to this partner will be sent to SII as " "simplified invoices." @@ -318,7 +318,7 @@ msgid "Enable SII" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_account_fiscal_position__sii_active +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_account_fiscal_position__aeat_active msgid "Enable SII for this fiscal position?" msgstr "" @@ -641,7 +641,7 @@ msgid "SII" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_account_fiscal_position__sii_active +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_account_fiscal_position__aeat_active msgid "SII Active" msgstr "" @@ -899,8 +899,8 @@ msgid "Sii Refund Specific Invoice Type" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_partner__sii_simplified_invoice -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_users__sii_simplified_invoice +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_partner__aeat_simplified_invoice +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_users__aeat_simplified_invoice msgid "Simplified invoices in SII?" msgstr "" diff --git a/l10n_es_aeat_sii_oca/i18n/nl.po b/l10n_es_aeat_sii_oca/i18n/nl.po index 71fc5d247e4..c15ca646fea 100644 --- a/l10n_es_aeat_sii_oca/i18n/nl.po +++ b/l10n_es_aeat_sii_oca/i18n/nl.po @@ -196,8 +196,8 @@ msgid "" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_partner__sii_simplified_invoice -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_users__sii_simplified_invoice +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_partner__aeat_simplified_invoice +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_users__aeat_simplified_invoice msgid "" "Checking this mark, invoices done to this partner will be sent to SII as " "simplified invoices." @@ -324,7 +324,7 @@ msgid "Enable SII" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_account_fiscal_position__sii_active +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_account_fiscal_position__aeat_active msgid "Enable SII for this fiscal position?" msgstr "" @@ -650,7 +650,7 @@ msgid "SII" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_account_fiscal_position__sii_active +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_account_fiscal_position__aeat_active msgid "SII Active" msgstr "" @@ -908,8 +908,8 @@ msgid "Sii Refund Specific Invoice Type" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_partner__sii_simplified_invoice -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_users__sii_simplified_invoice +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_partner__aeat_simplified_invoice +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_users__aeat_simplified_invoice msgid "Simplified invoices in SII?" msgstr "" diff --git a/l10n_es_aeat_sii_oca/i18n/pl.po b/l10n_es_aeat_sii_oca/i18n/pl.po index 476f5f8c290..19a1b796aeb 100644 --- a/l10n_es_aeat_sii_oca/i18n/pl.po +++ b/l10n_es_aeat_sii_oca/i18n/pl.po @@ -198,8 +198,8 @@ msgid "" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_partner__sii_simplified_invoice -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_users__sii_simplified_invoice +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_partner__aeat_simplified_invoice +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_users__aeat_simplified_invoice msgid "" "Checking this mark, invoices done to this partner will be sent to SII as " "simplified invoices." @@ -326,7 +326,7 @@ msgid "Enable SII" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_account_fiscal_position__sii_active +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_account_fiscal_position__aeat_active msgid "Enable SII for this fiscal position?" msgstr "" @@ -652,7 +652,7 @@ msgid "SII" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_account_fiscal_position__sii_active +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_account_fiscal_position__aeat_active msgid "SII Active" msgstr "" @@ -910,8 +910,8 @@ msgid "Sii Refund Specific Invoice Type" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_partner__sii_simplified_invoice -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_users__sii_simplified_invoice +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_partner__aeat_simplified_invoice +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_users__aeat_simplified_invoice msgid "Simplified invoices in SII?" msgstr "" diff --git a/l10n_es_aeat_sii_oca/i18n/pt.po b/l10n_es_aeat_sii_oca/i18n/pt.po index 519fefd8b4c..5bc5a65a07a 100644 --- a/l10n_es_aeat_sii_oca/i18n/pt.po +++ b/l10n_es_aeat_sii_oca/i18n/pt.po @@ -196,8 +196,8 @@ msgid "" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_partner__sii_simplified_invoice -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_users__sii_simplified_invoice +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_partner__aeat_simplified_invoice +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_users__aeat_simplified_invoice msgid "" "Checking this mark, invoices done to this partner will be sent to SII as " "simplified invoices." @@ -324,7 +324,7 @@ msgid "Enable SII" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_account_fiscal_position__sii_active +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_account_fiscal_position__aeat_active msgid "Enable SII for this fiscal position?" msgstr "" @@ -650,7 +650,7 @@ msgid "SII" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_account_fiscal_position__sii_active +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_account_fiscal_position__aeat_active msgid "SII Active" msgstr "" @@ -908,8 +908,8 @@ msgid "Sii Refund Specific Invoice Type" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_partner__sii_simplified_invoice -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_users__sii_simplified_invoice +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_partner__aeat_simplified_invoice +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_users__aeat_simplified_invoice msgid "Simplified invoices in SII?" msgstr "" diff --git a/l10n_es_aeat_sii_oca/i18n/pt_BR.po b/l10n_es_aeat_sii_oca/i18n/pt_BR.po index 0beab1aaa5e..f6b49ba052d 100644 --- a/l10n_es_aeat_sii_oca/i18n/pt_BR.po +++ b/l10n_es_aeat_sii_oca/i18n/pt_BR.po @@ -197,8 +197,8 @@ msgid "" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_partner__sii_simplified_invoice -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_users__sii_simplified_invoice +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_partner__aeat_simplified_invoice +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_users__aeat_simplified_invoice msgid "" "Checking this mark, invoices done to this partner will be sent to SII as " "simplified invoices." @@ -325,7 +325,7 @@ msgid "Enable SII" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_account_fiscal_position__sii_active +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_account_fiscal_position__aeat_active msgid "Enable SII for this fiscal position?" msgstr "" @@ -651,7 +651,7 @@ msgid "SII" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_account_fiscal_position__sii_active +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_account_fiscal_position__aeat_active msgid "SII Active" msgstr "" @@ -909,8 +909,8 @@ msgid "Sii Refund Specific Invoice Type" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_partner__sii_simplified_invoice -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_users__sii_simplified_invoice +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_partner__aeat_simplified_invoice +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_users__aeat_simplified_invoice msgid "Simplified invoices in SII?" msgstr "" diff --git a/l10n_es_aeat_sii_oca/i18n/ru.po b/l10n_es_aeat_sii_oca/i18n/ru.po index 69337ac27d4..1745e6e2339 100644 --- a/l10n_es_aeat_sii_oca/i18n/ru.po +++ b/l10n_es_aeat_sii_oca/i18n/ru.po @@ -198,8 +198,8 @@ msgid "" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_partner__sii_simplified_invoice -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_users__sii_simplified_invoice +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_partner__aeat_simplified_invoice +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_users__aeat_simplified_invoice msgid "" "Checking this mark, invoices done to this partner will be sent to SII as " "simplified invoices." @@ -326,7 +326,7 @@ msgid "Enable SII" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_account_fiscal_position__sii_active +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_account_fiscal_position__aeat_active msgid "Enable SII for this fiscal position?" msgstr "" @@ -652,7 +652,7 @@ msgid "SII" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_account_fiscal_position__sii_active +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_account_fiscal_position__aeat_active msgid "SII Active" msgstr "" @@ -910,8 +910,8 @@ msgid "Sii Refund Specific Invoice Type" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_partner__sii_simplified_invoice -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_users__sii_simplified_invoice +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_partner__aeat_simplified_invoice +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_users__aeat_simplified_invoice msgid "Simplified invoices in SII?" msgstr "" diff --git a/l10n_es_aeat_sii_oca/i18n/sl.po b/l10n_es_aeat_sii_oca/i18n/sl.po index 50577d4acc0..3454dce5dc9 100644 --- a/l10n_es_aeat_sii_oca/i18n/sl.po +++ b/l10n_es_aeat_sii_oca/i18n/sl.po @@ -197,8 +197,8 @@ msgid "" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_partner__sii_simplified_invoice -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_users__sii_simplified_invoice +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_partner__aeat_simplified_invoice +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_users__aeat_simplified_invoice msgid "" "Checking this mark, invoices done to this partner will be sent to SII as " "simplified invoices." @@ -325,7 +325,7 @@ msgid "Enable SII" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_account_fiscal_position__sii_active +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_account_fiscal_position__aeat_active msgid "Enable SII for this fiscal position?" msgstr "" @@ -651,7 +651,7 @@ msgid "SII" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_account_fiscal_position__sii_active +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_account_fiscal_position__aeat_active msgid "SII Active" msgstr "" @@ -909,8 +909,8 @@ msgid "Sii Refund Specific Invoice Type" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_partner__sii_simplified_invoice -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_users__sii_simplified_invoice +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_partner__aeat_simplified_invoice +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_users__aeat_simplified_invoice msgid "Simplified invoices in SII?" msgstr "" diff --git a/l10n_es_aeat_sii_oca/i18n/sv.po b/l10n_es_aeat_sii_oca/i18n/sv.po index 6e117a50bc9..57af28fa3ba 100644 --- a/l10n_es_aeat_sii_oca/i18n/sv.po +++ b/l10n_es_aeat_sii_oca/i18n/sv.po @@ -196,8 +196,8 @@ msgid "" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_partner__sii_simplified_invoice -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_users__sii_simplified_invoice +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_partner__aeat_simplified_invoice +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_users__aeat_simplified_invoice msgid "" "Checking this mark, invoices done to this partner will be sent to SII as " "simplified invoices." @@ -324,7 +324,7 @@ msgid "Enable SII" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_account_fiscal_position__sii_active +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_account_fiscal_position__aeat_active msgid "Enable SII for this fiscal position?" msgstr "" @@ -650,7 +650,7 @@ msgid "SII" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_account_fiscal_position__sii_active +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_account_fiscal_position__aeat_active msgid "SII Active" msgstr "" @@ -908,8 +908,8 @@ msgid "Sii Refund Specific Invoice Type" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_partner__sii_simplified_invoice -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_users__sii_simplified_invoice +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_partner__aeat_simplified_invoice +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_users__aeat_simplified_invoice msgid "Simplified invoices in SII?" msgstr "" diff --git a/l10n_es_aeat_sii_oca/i18n/tr.po b/l10n_es_aeat_sii_oca/i18n/tr.po index cf23f912033..e79ce01b0b7 100644 --- a/l10n_es_aeat_sii_oca/i18n/tr.po +++ b/l10n_es_aeat_sii_oca/i18n/tr.po @@ -196,8 +196,8 @@ msgid "" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_partner__sii_simplified_invoice -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_users__sii_simplified_invoice +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_partner__aeat_simplified_invoice +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_users__aeat_simplified_invoice msgid "" "Checking this mark, invoices done to this partner will be sent to SII as " "simplified invoices." @@ -324,7 +324,7 @@ msgid "Enable SII" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_account_fiscal_position__sii_active +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_account_fiscal_position__aeat_active msgid "Enable SII for this fiscal position?" msgstr "" @@ -650,7 +650,7 @@ msgid "SII" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_account_fiscal_position__sii_active +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_account_fiscal_position__aeat_active msgid "SII Active" msgstr "" @@ -908,8 +908,8 @@ msgid "Sii Refund Specific Invoice Type" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_partner__sii_simplified_invoice -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_users__sii_simplified_invoice +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_partner__aeat_simplified_invoice +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_users__aeat_simplified_invoice msgid "Simplified invoices in SII?" msgstr "" diff --git a/l10n_es_aeat_sii_oca/i18n/vi.po b/l10n_es_aeat_sii_oca/i18n/vi.po index fd2fc669dca..1ad39fe036e 100644 --- a/l10n_es_aeat_sii_oca/i18n/vi.po +++ b/l10n_es_aeat_sii_oca/i18n/vi.po @@ -196,8 +196,8 @@ msgid "" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_partner__sii_simplified_invoice -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_users__sii_simplified_invoice +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_partner__aeat_simplified_invoice +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_res_users__aeat_simplified_invoice msgid "" "Checking this mark, invoices done to this partner will be sent to SII as " "simplified invoices." @@ -324,7 +324,7 @@ msgid "Enable SII" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_account_fiscal_position__sii_active +#: model:ir.model.fields,help:l10n_es_aeat_sii_oca.field_account_fiscal_position__aeat_active msgid "Enable SII for this fiscal position?" msgstr "" @@ -650,7 +650,7 @@ msgid "SII" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_account_fiscal_position__sii_active +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_account_fiscal_position__aeat_active msgid "SII Active" msgstr "" @@ -908,8 +908,8 @@ msgid "Sii Refund Specific Invoice Type" msgstr "" #. module: l10n_es_aeat_sii_oca -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_partner__sii_simplified_invoice -#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_users__sii_simplified_invoice +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_partner__aeat_simplified_invoice +#: model:ir.model.fields,field_description:l10n_es_aeat_sii_oca.field_res_users__aeat_simplified_invoice msgid "Simplified invoices in SII?" msgstr "" diff --git a/l10n_es_aeat_sii_oca/models/account_fiscal_position.py b/l10n_es_aeat_sii_oca/models/account_fiscal_position.py index fb94a027990..0718ae36d64 100644 --- a/l10n_es_aeat_sii_oca/models/account_fiscal_position.py +++ b/l10n_es_aeat_sii_oca/models/account_fiscal_position.py @@ -32,12 +32,7 @@ def default_sii_exempt_cause(self): "Default SII Registration Key for Purchases", domain=[("type", "=", "purchase")], ) - sii_active = fields.Boolean( - string="SII Active", - copy=False, - default=True, - help="Enable SII for this fiscal position?", - ) + sii_no_taxable_cause = fields.Selection( selection=[ ( diff --git a/l10n_es_aeat_sii_oca/models/account_move.py b/l10n_es_aeat_sii_oca/models/account_move.py index ddf9bcedbd3..f8408ad30a1 100644 --- a/l10n_es_aeat_sii_oca/models/account_move.py +++ b/l10n_es_aeat_sii_oca/models/account_move.py @@ -115,7 +115,7 @@ def _compute_sii_registration_key(self): def _compute_macrodata(self): return super()._compute_macrodata() - def _sii_get_partner(self): + def _aeat_get_partner(self): return self.commercial_partner_id def _raise_exception_sii(self, field_name): @@ -133,7 +133,7 @@ def write(self, vals): VAT/ID Otro and the supplier invoice number. Cannot let change these values in a SII registered supplier invoice""" for invoice in self.filtered( - lambda x: x.is_invoice() and x.sii_state != "not_sent" + lambda x: x.is_invoice() and x.aeat_state != "not_sent" ): if "invoice_date" in vals: self._raise_exception_sii(_("invoice date")) @@ -141,7 +141,7 @@ def write(self, vals): self._raise_exception_sii(_("third-party number")) if invoice.move_type in ["in_invoice", "in_refund"]: if "partner_id" in vals: - correct_partners = invoice._sii_get_partner() + correct_partners = invoice._aeat_get_partner() correct_partners |= correct_partners.child_ids if vals["partner_id"] not in correct_partners.ids: self._raise_exception_sii(_("supplier")) @@ -173,7 +173,7 @@ def _get_sii_tax_req(self, tax): :return: REQ tax (or empty recordset) linked to the provided tax. """ self.ensure_one() - taxes_req = self._get_sii_taxes_map(["RE"], self._get_document_fiscal_date()) + taxes_req = self._get_aeat_taxes_map(["RE"], self._get_document_fiscal_date()) re_lines = self.line_ids.filtered( lambda x: tax in x.tax_ids and x.tax_ids & taxes_req ) @@ -223,19 +223,19 @@ def _get_sii_out_taxes(self): # noqa: C901 """ self.ensure_one() taxes_dict = {} - taxes_sfesb = self._get_sii_taxes_map(["SFESB"], self.date) - taxes_sfesbe = self._get_sii_taxes_map(["SFESBE"], self.date) - taxes_sfesisp = self._get_sii_taxes_map(["SFESISP"], self.date) + taxes_sfesb = self._get_aeat_taxes_map(["SFESB"], self.date) + taxes_sfesbe = self._get_aeat_taxes_map(["SFESBE"], self.date) + taxes_sfesisp = self._get_aeat_taxes_map(["SFESISP"], self.date) # taxes_sfesisps = self._get_taxes_map(['SFESISPS']) - taxes_sfens = self._get_sii_taxes_map(["SFENS"], self.date) - taxes_sfess = self._get_sii_taxes_map(["SFESS"], self.date) - taxes_sfesse = self._get_sii_taxes_map(["SFESSE"], self.date) - taxes_sfesns = self._get_sii_taxes_map(["SFESNS"], self.date) - taxes_not_in_total = self._get_sii_taxes_map(["NotIncludedInTotal"], self.date) - taxes_not_in_total_neg = self._get_sii_taxes_map( + taxes_sfens = self._get_aeat_taxes_map(["SFENS"], self.date) + taxes_sfess = self._get_aeat_taxes_map(["SFESS"], self.date) + taxes_sfesse = self._get_aeat_taxes_map(["SFESSE"], self.date) + taxes_sfesns = self._get_aeat_taxes_map(["SFESNS"], self.date) + taxes_not_in_total = self._get_aeat_taxes_map(["NotIncludedInTotal"], self.date) + taxes_not_in_total_neg = self._get_aeat_taxes_map( ["NotIncludedInTotalNegative"], self.date ) - base_not_in_total = self._get_sii_taxes_map( + base_not_in_total = self._get_aeat_taxes_map( ["BaseNotIncludedInTotal"], self.date ) not_in_amount_total = 0 @@ -356,17 +356,17 @@ def _get_sii_in_taxes(self): """ self.ensure_one() taxes_dict = {} - taxes_sfrs = self._get_sii_taxes_map(["SFRS"], self.date) - taxes_sfrsa = self._get_sii_taxes_map(["SFRSA"], self.date) - taxes_sfrisp = self._get_sii_taxes_map(["SFRISP"], self.date) - taxes_sfrns = self._get_sii_taxes_map(["SFRNS"], self.date) - taxes_sfrnd = self._get_sii_taxes_map(["SFRND"], self.date) - taxes_sfrbi = self._get_sii_taxes_map(["SFRBI"], self.date) - taxes_not_in_total = self._get_sii_taxes_map(["NotIncludedInTotal"], self.date) - taxes_not_in_total_neg = self._get_sii_taxes_map( + taxes_sfrs = self._get_aeat_taxes_map(["SFRS"], self.date) + taxes_sfrsa = self._get_aeat_taxes_map(["SFRSA"], self.date) + taxes_sfrisp = self._get_aeat_taxes_map(["SFRISP"], self.date) + taxes_sfrns = self._get_aeat_taxes_map(["SFRNS"], self.date) + taxes_sfrnd = self._get_aeat_taxes_map(["SFRND"], self.date) + taxes_sfrbi = self._get_aeat_taxes_map(["SFRBI"], self.date) + taxes_not_in_total = self._get_aeat_taxes_map(["NotIncludedInTotal"], self.date) + taxes_not_in_total_neg = self._get_aeat_taxes_map( ["NotIncludedInTotalNegative"], self.date ) - base_not_in_total = self._get_sii_taxes_map( + base_not_in_total = self._get_aeat_taxes_map( ["BaseNotIncludedInTotal"], self.date ) tax_amount = 0.0 @@ -415,9 +415,9 @@ def _get_sii_in_taxes(self): def _get_mapping_key(self): return self.move_type - def _sii_check_exceptions(self): - res = super()._sii_check_exceptions() - is_simplified_invoice = self._is_sii_simplified_invoice() + def _aeat_check_exceptions(self): + res = super()._aeat_check_exceptions() + is_simplified_invoice = self._is_aeat_simplified_invoice() if is_simplified_invoice and self.move_type[:2] == "in": raise exceptions.UserError( _("You can't make a supplier simplified invoice.") @@ -433,7 +433,7 @@ def _get_sii_invoice_type(self): if self.move_type in ["in_invoice", "in_refund"]: invoice_type = "R4" if self.move_type == "in_refund" else "F1" elif self.move_type in ["out_invoice", "out_refund"]: - is_simplified = self._is_sii_simplified_invoice() + is_simplified = self._is_aeat_simplified_invoice() invoice_type = "F2" if is_simplified else "F1" if self.move_type == "out_refund": if self.sii_refund_specific_invoice_type: @@ -442,8 +442,8 @@ def _get_sii_invoice_type(self): invoice_type = "R5" if is_simplified else "R1" return invoice_type - 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 cancel: return inv_dict if self.thirdparty_invoice: @@ -496,7 +496,7 @@ def _get_document_serial_number(self): serial_number = self.thirdparty_number[0:60] return serial_number - def _get_sii_invoice_dict_in(self, cancel=False): + def _get_aeat_invoice_dict_in(self, cancel=False): """Build dict with data to send to AEAT WS for invoice types: in_invoice and in_refund. @@ -509,7 +509,7 @@ def _get_sii_invoice_dict_in(self, cancel=False): reg_date = self._change_date_format(self._get_account_registration_date()) ejercicio = fields.Date.to_date(self.date).year periodo = self._get_document_period() - partner = self._sii_get_partner() + partner = self._aeat_get_partner() desglose_factura, tax_amount, not_in_amount_total = self._get_sii_in_taxes() inv_dict = { "IDFactura": { @@ -574,34 +574,34 @@ def _get_sii_invoice_dict_in(self, cancel=False): def _get_cancel_sii_invoice_dict(self): self.ensure_one() - self._sii_check_exceptions() + self._aeat_check_exceptions() if self.move_type in ["out_invoice", "out_refund"]: - return self._get_sii_invoice_dict_out(cancel=True) + return self._get_aeat_invoice_dict_out(cancel=True) elif self.move_type in ["in_invoice", "in_refund"]: - return self._get_sii_invoice_dict_in(cancel=True) + return self._get_aeat_invoice_dict_in(cancel=True) return {} def _sii_invoice_dict_not_modified(self): self.ensure_one() - to_send = self._get_sii_invoice_dict() - content_sent = json.loads(self.sii_content_sent) + to_send = self._get_aeat_invoice_dict() + content_sent = json.loads(self.aeat_content_sent) return to_send == content_sent def _post(self, soft=True): res = super()._post(soft=soft) for invoice in self.filtered(lambda x: x.sii_enabled and x.is_invoice()): - invoice._sii_check_exceptions() + invoice._aeat_check_exceptions() if ( - invoice.sii_state in ["sent_modified", "sent"] + invoice.aeat_state in ["sent_modified", "sent"] and invoice._sii_invoice_dict_not_modified() ): - if invoice.sii_state == "sent_modified": - invoice.sii_state = "sent" + if invoice.aeat_state == "sent_modified": + invoice.aeat_state = "sent" continue - if invoice.sii_state == "sent": - invoice.sii_state = "sent_modified" - elif invoice.sii_state == "cancelled": - invoice.sii_state = "cancelled_modified" + if invoice.aeat_state == "sent": + invoice.aeat_state = "sent_modified" + elif invoice.aeat_state == "cancelled": + invoice.aeat_state = "cancelled_modified" company = invoice.company_id if company.sii_method != "auto": continue @@ -641,11 +641,11 @@ def _get_valid_document_states(self): def _cancel_invoice_to_sii(self): for invoice in self.filtered(lambda i: i.state in ["cancel"]): - serv = invoice._connect_sii(invoice.move_type) - header = invoice._get_sii_header(cancellation=True) + serv = invoice._connect_aeat(invoice.move_type) + header = invoice._get_aeat_header(cancellation=True) inv_vals = { - "sii_send_failed": True, - "sii_send_error": False, + "aeat_send_failed": True, + "aeat_send_error": False, } try: inv_dict = invoice._get_cancel_sii_invoice_dict() @@ -662,14 +662,14 @@ def _cancel_invoice_to_sii(self): if res["EstadoEnvio"] == "Correcto": inv_vals.update( { - "sii_state": "cancelled", + "aeat_state": "cancelled", "sii_csv": res["CSV"], - "sii_send_failed": False, + "aeat_send_failed": False, } ) res_line = res["RespuestaLinea"][0] if res_line["CodigoErrorRegistro"]: - inv_vals["sii_send_error"] = "{} | {}".format( + inv_vals["aeat_send_error"] = "{} | {}".format( str(res_line["CodigoErrorRegistro"]), str(res_line["DescripcionErrorRegistro"])[:60], ) @@ -680,8 +680,8 @@ def _cancel_invoice_to_sii(self): invoice = env["account.move"].browse(invoice.id) inv_vals.update( { - "sii_send_failed": True, - "sii_send_error": repr(fault)[:60], + "aeat_send_failed": True, + "aeat_send_error": repr(fault)[:60], "sii_return": repr(fault), } ) @@ -695,7 +695,7 @@ def cancel_sii(self): lambda i: ( i.sii_enabled and i.state in ["cancel"] - and i.sii_state in ["sent", "sent_w_errors", "sent_modified"] + and i.aeat_state in ["sent", "sent_w_errors", "sent_modified"] ) ) if not invoices._cancel_sii_jobs(): @@ -728,12 +728,12 @@ def button_cancel(self): ) res = super().button_cancel() for invoice in self.filtered(lambda x: x.sii_enabled): - if invoice.sii_state == "sent": - invoice.sii_state = "sent_modified" - elif invoice.sii_state == "cancelled_modified": + if invoice.aeat_state == "sent": + invoice.aeat_state = "sent_modified" + elif invoice.aeat_state == "cancelled_modified": # Case when repoen a cancelled invoice, validate and cancel # again without any SII communication. - invoice.sii_state = "cancelled" + invoice.aeat_state = "cancelled" return res def button_draft(self): @@ -807,7 +807,7 @@ def _compute_sii_description(self): "journal_id.sii_enabled", "move_type", "fiscal_position_id", - "fiscal_position_id.sii_active", + "fiscal_position_id.aeat_active", ) def _compute_sii_enabled(self): """Compute if the invoice is enabled for the SII""" @@ -818,7 +818,8 @@ def _compute_sii_enabled(self): and invoice.is_invoice() ): invoice.sii_enabled = ( - invoice.fiscal_position_id and invoice.fiscal_position_id.sii_active + invoice.fiscal_position_id + and invoice.fiscal_position_id.aeat_active ) or not invoice.fiscal_position_id else: invoice.sii_enabled = False diff --git a/l10n_es_aeat_sii_oca/models/res_company.py b/l10n_es_aeat_sii_oca/models/res_company.py index 49f6340069e..e97909a169d 100644 --- a/l10n_es_aeat_sii_oca/models/res_company.py +++ b/l10n_es_aeat_sii_oca/models/res_company.py @@ -15,7 +15,7 @@ class ResCompany(models.Model): _inherit = "res.company" sii_enabled = fields.Boolean(string="Enable SII") - sii_test = fields.Boolean(string="Is Test Environment?") + sii_test = fields.Boolean(string="Is the SII Test Environment?") sii_description_method = fields.Selection( string="SII Description Method", selection=[("auto", "Automatic"), ("fixed", "Fixed"), ("manual", "Manual")], diff --git a/l10n_es_aeat_sii_oca/models/res_partner.py b/l10n_es_aeat_sii_oca/models/res_partner.py index a95d5ec90b2..e52a3dc480b 100644 --- a/l10n_es_aeat_sii_oca/models/res_partner.py +++ b/l10n_es_aeat_sii_oca/models/res_partner.py @@ -10,7 +10,7 @@ class ResPartner(models.Model): sii_enabled = fields.Boolean( compute="_compute_sii_enabled", ) - sii_simplified_invoice = fields.Boolean( + aeat_simplified_invoice = fields.Boolean( string="Simplified invoices in SII?", help="Checking this mark, invoices done to this partner will be " "sent to SII as simplified invoices.", diff --git a/l10n_es_aeat_sii_oca/models/sii_mixin.py b/l10n_es_aeat_sii_oca/models/sii_mixin.py index cbe536589e7..07aeacc1bca 100644 --- a/l10n_es_aeat_sii_oca/models/sii_mixin.py +++ b/l10n_es_aeat_sii_oca/models/sii_mixin.py @@ -7,26 +7,16 @@ import json import logging -from requests import Session - from odoo import _, api, exceptions, fields, models from odoo.exceptions import UserError, ValidationError from odoo.modules.registry import Registry from odoo.tools.float_utils import float_compare -_logger = logging.getLogger(__name__) +from odoo.addons.l10n_es_aeat.models.aeat_mixin import round_by_keys -try: - from zeep import Client - from zeep.plugins import HistoryPlugin - from zeep.transports import Transport -except (ImportError, IOError) as err: - _logger.debug(err) +_logger = logging.getLogger(__name__) SII_STATES = [ - ("not_sent", "Not sent"), - ("sent", "Sent"), - ("sent_w_errors", "Accepted with errors"), ("sent_modified", "Registered in SII but last modifications not sent"), ("cancelled", "Cancelled"), ("cancelled_modified", "Cancelled in SII but last modifications not sent"), @@ -36,24 +26,9 @@ SII_DATE_FORMAT = "%d-%m-%Y" -def round_by_keys(elem, search_keys, prec=2): - """This uses ``round`` method directly as if has been tested that Odoo's - ``float_round`` still returns incorrect amounts for certain values. Try - 3 units x 3,77 €/unit with 10% tax and you will be hit by the error - (on regular x86 architectures).""" - if isinstance(elem, dict): - for key, value in elem.items(): - if key in search_keys: - elem[key] = round(elem[key], prec) - else: - round_by_keys(value, search_keys) - elif isinstance(elem, list): - for value in elem: - round_by_keys(value, search_keys) - - class SiiMixin(models.AbstractModel): _name = "sii.mixin" + _inherit = "aeat.mixin" _description = "SII Mixin" company_id = fields.Many2one( @@ -68,38 +43,14 @@ class SiiMixin(models.AbstractModel): readonly=False, copy=False, ) - sii_state = fields.Selection( - selection=SII_STATES, - string="SII send state", - default="not_sent", - readonly=True, - copy=False, - help="Indicates the state of this document in relation with the " - "presentation at the SII", + + aeat_state = fields.Selection( + selection_add=SII_STATES, ) + sii_csv = fields.Char(string="SII CSV", copy=False, readonly=True) sii_return = fields.Text(string="SII Return", copy=False, readonly=True) - sii_header_sent = fields.Text( - string="SII last header sent", - copy=False, - readonly=True, - ) - sii_content_sent = fields.Text( - string="SII last content sent", - copy=False, - readonly=True, - ) - sii_send_error = fields.Text( - string="SII Send Error", - readonly=True, - copy=False, - ) - sii_send_failed = fields.Boolean( - string="SII send failed", - copy=False, - help="Indicates that the last attempt to communicate this document to " - "the SII has failed. See SII return for details", - ) + sii_refund_type = fields.Selection( selection=[ # ('S', 'By substitution'), - Removed as not fully supported @@ -212,17 +163,11 @@ def _compute_macrodata(self): >= 0 ) - def _sii_get_partner(self): - raise NotImplementedError - - def _get_sii_country_code(self): - self.ensure_one() - return self._sii_get_partner()._parse_aeat_vat_info()[0] def _filter_sii_unlink_not_possible(self): """Filter records that we do not allow to be deleted, all those that are not in not_sent sii status.""" - return self.filtered(lambda rec: rec.sii_state != "not_sent") + return self.filtered(lambda rec: rec.aeat_state != "not_sent") @api.ondelete(at_uninstall=False) def _unlink_except_sii(self): @@ -233,7 +178,7 @@ def _unlink_except_sii(self): ) @api.model - def _get_sii_taxes_map(self, codes, date): + def _get_aeat_taxes_map(self, codes, date): """Return the codes that correspond to that sii map line codes. :param codes: List of code strings to get the mapping. @@ -255,12 +200,7 @@ def _get_sii_taxes_map(self, codes, date): tax_templates = sii_map.map_lines.filtered(lambda x: x.code in codes).taxes return self.company_id.get_taxes_from_templates(tax_templates) - def _change_date_format(self, date): - datetimeobject = fields.Date.to_date(date) - new_date = datetimeobject.strftime(SII_DATE_FORMAT) - return new_date - - def _get_sii_header(self, tipo_comunicacion=False, cancellation=False): + def _get_aeat_header(self, tipo_comunicacion=False, cancellation=False): """Builds SII send header :param tipo_comunicacion String 'A0': new reg, 'A1': modification @@ -295,15 +235,12 @@ def _cancel_sii_jobs(self): queue.unlink() return True - def _get_valid_document_states(self): - raise NotImplementedError() - def send_sii(self): documents = self.filtered( lambda document: ( document.sii_enabled and document.state in self._get_valid_document_states() - and document.sii_state not in ["sent", "cancelled"] + and document.aeat_state not in ["sent", "cancelled"] ) ) if not documents._cancel_sii_jobs(): @@ -330,20 +267,20 @@ def _process_sii_send(self): new_delay = ( record.sudo() .with_context(company_id=company.id) - .with_delay(eta=eta if not record.sii_send_failed else False) + .with_delay(eta=eta if not record.aeat_send_failed else False) .confirm_one_document() ) job = queue_obj.search([("uuid", "=", new_delay.uuid)], limit=1) setattr(record.sudo(), self._get_sii_jobs_field_name(), [(4, job.id)]) - def _bind_sii(self, client, port_name, address=None): + def _bind_service(self, client, port_name, address=None): self.ensure_one() service = client._get_service("siiService") port = client._get_port(service, port_name) address = address or port.binding_options["address"] return client.create_service(port.binding.name, address) - def _connect_params_sii(self, mapping_key): + def _connect_params_aeat(self, mapping_key): self.ensure_one() agency = self.company_id.tax_agency_id if not agency: @@ -354,19 +291,6 @@ def _connect_params_sii(self, mapping_key): agency = self.env.ref("l10n_es_aeat.aeat_tax_agency_spain") return agency._connect_params_sii(mapping_key, self.company_id) - def _connect_sii(self, mapping_key): - self.ensure_one() - public_crt, private_key = self.env["l10n.es.aeat.certificate"].get_certificates( - company=self.company_id - ) - params = self._connect_params_sii(mapping_key) - session = Session() - session.cert = (public_crt, private_key) - transport = Transport(session=session) - history = HistoryPlugin() - client = Client(wsdl=params["wsdl"], transport=transport, plugins=[history]) - return self._bind_sii(client, params["port_name"], params["address"]) - def _get_sii_gen_type(self): """Make a choice for general invoice type @@ -385,39 +309,29 @@ def _get_sii_gen_type(self): res = 1 return res - def _is_sii_simplified_invoice(self): + def _is_aeat_simplified_invoice(self): """Inheritable method to allow control when an invoice are simplified or normal""" - partner = self._sii_get_partner() - return partner.sii_simplified_invoice + partner = self._aeat_get_partner() + return partner.aeat_simplified_invoice - def _sii_check_exceptions(self): + def _aeat_check_exceptions(self): """Inheritable method for exceptions control when sending SII invoices.""" - self.ensure_one() - gen_type = self._get_sii_gen_type() - partner = self._sii_get_partner() - country_code = self._get_sii_country_code() - is_simplified_invoice = self._is_sii_simplified_invoice() - if ( - (gen_type != 3 or country_code == "ES") - and not partner.vat - and not is_simplified_invoice - ): - raise UserError(_("The partner has not a VAT configured.")) - if not self.company_id.chart_template_id: - raise UserError( - _("You have to select what account chart template use this" " company.") - ) - if not self.company_id.sii_enabled: - raise UserError(_("This company doesn't have SII enabled.")) - if not self.sii_enabled: - raise UserError(_("This invoice is not SII enabled.")) - - def _get_mapping_key(self): - raise NotImplementedError() - - def _get_document_date(self): - raise NotImplementedError() + res = super()._aeat_check_exceptions() + if self.company_id.sii_enabled: + gen_type = self._get_sii_gen_type() + partner = self._aeat_get_partner() + country_code = self._get_aeat_country_code() + is_simplified_invoice = self._is_aeat_simplified_invoice() + if ( + (gen_type != 3 or country_code == "ES") + and not partner.vat + and not is_simplified_invoice + ): + raise UserError(_("The partner has not a VAT configured.")) + if not self.sii_enabled: + raise UserError(_("This invoice is not SII enabled.")) + return res def _get_document_fiscal_date(self): raise NotImplementedError() @@ -433,9 +347,6 @@ def _get_document_period(self): period = str(int(((month - 1) / 3) + 1)) + "T" return period - def _get_document_serial_number(self): - raise NotImplementedError() - def _get_document_product_exempt(self, applied_taxes): raise NotImplementedError() @@ -520,7 +431,7 @@ def _is_sii_type_breakdown_required(self, taxes_dict): self.ensure_one() if "DesgloseFactura" not in taxes_dict: return False - country_code = self._get_sii_country_code() + country_code = self._get_aeat_country_code() sii_gen_type = self._get_sii_gen_type() if "DesgloseTipoOperacion" in taxes_dict: # DesgloseTipoOperacion and DesgloseFactura are Exclusive @@ -533,7 +444,7 @@ def _is_sii_type_breakdown_required(self, taxes_dict): # DesgloseTipoOperacion required for national operations # with 'IDOtro' in the SII identifier block return True - elif sii_gen_type == 1 and (self._sii_get_partner().vat or "").startswith( + elif sii_gen_type == 1 and (self._aeat_get_partner().vat or "").startswith( "ESN" ): # DesgloseTipoOperacion required if customer's country is Spain and @@ -549,19 +460,19 @@ def _get_sii_out_taxes(self): # noqa: C901 self.ensure_one() taxes_dict = {} date = self._get_document_fiscal_date() - taxes_sfesb = self._get_sii_taxes_map(["SFESB"], date) - taxes_sfesbe = self._get_sii_taxes_map(["SFESBE"], date) - taxes_sfesisp = self._get_sii_taxes_map(["SFESISP"], date) + taxes_sfesb = self._get_aeat_taxes_map(["SFESB"], date) + taxes_sfesbe = self._get_aeat_taxes_map(["SFESBE"], date) + taxes_sfesisp = self._get_aeat_taxes_map(["SFESISP"], date) # taxes_sfesisps = self._get_taxes_map(['SFESISPS']) - taxes_sfens = self._get_sii_taxes_map(["SFENS"], date) - taxes_sfess = self._get_sii_taxes_map(["SFESS"], date) - taxes_sfesse = self._get_sii_taxes_map(["SFESSE"], date) - taxes_sfesns = self._get_sii_taxes_map(["SFESNS"], date) - taxes_not_in_total = self._get_sii_taxes_map(["NotIncludedInTotal"], date) - taxes_not_in_total_neg = self._get_sii_taxes_map( + taxes_sfens = self._get_aeat_taxes_map(["SFENS"], date) + taxes_sfess = self._get_aeat_taxes_map(["SFESS"], date) + taxes_sfesse = self._get_aeat_taxes_map(["SFESSE"], date) + taxes_sfesns = self._get_aeat_taxes_map(["SFESNS"], date) + taxes_not_in_total = self._get_aeat_taxes_map(["NotIncludedInTotal"], date) + taxes_not_in_total_neg = self._get_aeat_taxes_map( ["NotIncludedInTotalNegative"], date ) - base_not_in_total = self._get_sii_taxes_map(["BaseNotIncludedInTotal"], date) + base_not_in_total = self._get_aeat_taxes_map(["BaseNotIncludedInTotal"], date) not_in_amount_total = 0 exempt_cause = self._get_sii_exempt_cause(taxes_sfesbe + taxes_sfesse) tax_lines = self._get_tax_info() @@ -663,9 +574,6 @@ def _get_sii_out_taxes(self): # noqa: C901 del taxes_dict["DesgloseFactura"] return taxes_dict, not_in_amount_total - def _get_document_amount_total(self): - raise NotImplementedError() - def _get_sii_invoice_type(self): raise NotImplementedError() @@ -679,7 +587,7 @@ def _get_sii_identifier(self): country_code, identifier_type, identifier, - ) = self._sii_get_partner()._parse_aeat_vat_info() + ) = self._aeat_get_partner()._parse_aeat_vat_info() # Limpiar alfanum if identifier: identifier = "".join(e for e in identifier if e.isalnum()).upper() @@ -687,7 +595,7 @@ def _get_sii_identifier(self): identifier = "NO_DISPONIBLE" identifier_type = "06" if gen_type == 1: - if "1117" in (self.sii_send_error or ""): + if "1117" in (self.aeat_send_error or ""): return { "IDOtro": { "CodigoPais": country_code, @@ -703,8 +611,8 @@ def _get_sii_identifier(self): "CodigoPais": country_code, "IDType": identifier_type, "ID": country_code + identifier - if self._sii_get_partner()._map_aeat_country_code(country_code) - in self._sii_get_partner()._get_aeat_europe_codes() + if self._aeat_get_partner()._map_aeat_country_code(country_code) + in self._aeat_get_partner()._get_aeat_europe_codes() else identifier, }, } @@ -726,7 +634,7 @@ def _get_sii_identifier(self): elif gen_type == 3: return {"NIF": identifier} - def _get_sii_invoice_dict_out(self, cancel=False): + def _get_aeat_invoice_dict_out(self, cancel=False): """Build dict with data to send to AEAT WS for document types: out_invoice and out_refund. @@ -736,11 +644,11 @@ def _get_sii_invoice_dict_out(self, cancel=False): """ self.ensure_one() document_date = self._change_date_format(self._get_document_date()) - partner = self._sii_get_partner() + partner = self._aeat_get_partner() company = self.company_id fiscal_year = self._get_document_fiscal_year() period = self._get_document_period() - is_simplified_invoice = self._is_sii_simplified_invoice() + is_simplified_invoice = self._is_aeat_simplified_invoice() serial_number = self._get_document_serial_number() inv_dict = { "IDFactura": { @@ -778,7 +686,7 @@ def _get_sii_invoice_dict_out(self, cancel=False): exp_dict["Contraparte"].update(self._get_sii_identifier()) return inv_dict - def _get_sii_invoice_dict_in(self, cancel=False): + def _get_aeat_invoice_dict_in(self, cancel=False): """Build dict with data to send to AEAT WS for invoice types: in_invoice and in_refund. @@ -788,15 +696,15 @@ def _get_sii_invoice_dict_in(self, cancel=False): """ raise NotImplementedError() - def _get_sii_invoice_dict(self): + def _get_aeat_invoice_dict(self): self.ensure_one() - self._sii_check_exceptions() + self._aeat_check_exceptions() inv_dict = {} mapping_key = self._get_mapping_key() if mapping_key in ["out_invoice", "out_refund"]: - inv_dict = self._get_sii_invoice_dict_out() + inv_dict = self._get_aeat_invoice_dict_out() elif mapping_key in ["in_invoice", "in_refund"]: - inv_dict = self._get_sii_invoice_dict_in() + inv_dict = self._get_aeat_invoice_dict_in() round_by_keys( inv_dict, [ @@ -831,24 +739,24 @@ def _send_document_to_sii(self): for document in self.filtered( lambda i: i.state in self._get_valid_document_states() ): - if document.sii_state == "not_sent": + if document.aeat_state == "not_sent": tipo_comunicacion = "A0" else: tipo_comunicacion = "A1" - header = document._get_sii_header(tipo_comunicacion) + header = document._get_aeat_header(tipo_comunicacion) doc_vals = { - "sii_header_sent": json.dumps(header, indent=4), + "aeat_header_sent": json.dumps(header, indent=4), } - # add this extra try except in case _get_sii_invoice_dict fails + # add this extra try except in case _get_aeat_invoice_dict fails # if not, get the value doc_dict for the next try and except below try: - inv_dict = document._get_sii_invoice_dict() + inv_dict = document._get_aeat_invoice_dict() except Exception as fault: raise ValidationError(fault) from fault try: mapping_key = document._get_mapping_key() - serv = document._connect_sii(mapping_key) - doc_vals["sii_content_sent"] = json.dumps(inv_dict, indent=4) + serv = document._connect_aeat(mapping_key) + doc_vals["aeat_content_sent"] = json.dumps(inv_dict, indent=4) if mapping_key in ["out_invoice", "out_refund"]: res = serv.SuministroLRFacturasEmitidas(header, inv_dict) elif mapping_key in ["in_invoice", "in_refund"]: @@ -862,9 +770,9 @@ def _send_document_to_sii(self): if res["EstadoEnvio"] == "Correcto": doc_vals.update( { - "sii_state": "sent", + "aeat_state": "sent", "sii_csv": res["CSV"], - "sii_send_failed": False, + "aeat_send_failed": False, } ) elif ( @@ -873,15 +781,15 @@ def _send_document_to_sii(self): ): doc_vals.update( { - "sii_state": "sent_w_errors", + "aeat_state": "sent_w_errors", "sii_csv": res["CSV"], - "sii_send_failed": True, + "aeat_send_failed": True, } ) else: - doc_vals["sii_send_failed"] = True + doc_vals["aeat_send_failed"] = True if ( - "sii_state" in doc_vals + "aeat_state" in doc_vals and not document.sii_account_registration_date and mapping_key[:2] == "in" ): @@ -895,7 +803,7 @@ def _send_document_to_sii(self): str(res_line["CodigoErrorRegistro"]), str(res_line["DescripcionErrorRegistro"])[:60], ) - doc_vals["sii_send_error"] = send_error + doc_vals["aeat_send_error"] = send_error document.write(doc_vals) except Exception as fault: new_cr = Registry(self.env.cr.dbname).cursor() @@ -903,10 +811,10 @@ def _send_document_to_sii(self): document = env[document._name].browse(document.id) doc_vals.update( { - "sii_send_failed": True, - "sii_send_error": repr(fault)[:60], + "aeat_send_failed": True, + "aeat_send_error": repr(fault)[:60], "sii_return": repr(fault), - "sii_content_sent": json.dumps(inv_dict, indent=4), + "aeat_content_sent": json.dumps(inv_dict, indent=4), } ) document.write(doc_vals) diff --git a/l10n_es_aeat_sii_oca/tests/test_l10n_es_aeat_sii.py b/l10n_es_aeat_sii_oca/tests/test_l10n_es_aeat_sii.py index a83b05abbc5..4f95bb2a12e 100644 --- a/l10n_es_aeat_sii_oca/tests/test_l10n_es_aeat_sii.py +++ b/l10n_es_aeat_sii_oca/tests/test_l10n_es_aeat_sii.py @@ -108,7 +108,7 @@ def _compare_sii_dict( if extra_vals: vals.update(extra_vals) invoice = self.env["account.move"].create(vals) - result_dict = invoice._get_sii_invoice_dict() + result_dict = invoice._get_aeat_invoice_dict() path = get_resource_path(module, "tests/json", json_file) if not path: raise Exception("Incorrect JSON file: %s" % json_file) @@ -207,7 +207,7 @@ def test_intracomunitary_customer_extracomunitary_delivery(self): {"partner_id": eu_customer.id, "fiscal_position_id": fp_extra.id} ) invoice.action_post() - sii_info = invoice._get_sii_invoice_dict() + sii_info = invoice._get_aeat_invoice_dict() self.assertEqual( sii_info["FacturaExpedida"]["Contraparte"], { @@ -369,7 +369,7 @@ def _check_binding_address(self, invoice): company = invoice.company_id tax_agency = company.tax_agency_id self.sii_cert.company_id.tax_agency_id = tax_agency - proxy = invoice._connect_sii(invoice.move_type) + proxy = invoice._connect_aeat(invoice.move_type) address = proxy._binding_options["address"] self.assertTrue(address) if company.sii_test and tax_agency: @@ -429,13 +429,13 @@ def test_refund_sii_refund_type_write(self): invoice.move_type = "out_refund" self.assertEqual(invoice.sii_refund_type, "I") - def test_is_sii_simplified_invoice(self): - self.assertFalse(self.invoice._is_sii_simplified_invoice()) - self.partner.sii_simplified_invoice = True - self.assertTrue(self.invoice._is_sii_simplified_invoice()) + def test_is_aeat_simplified_invoice(self): + self.assertFalse(self.invoice._is_aeat_simplified_invoice()) + self.partner.aeat_simplified_invoice = True + self.assertTrue(self.invoice._is_aeat_simplified_invoice()) - def test_sii_check_exceptions_case_supplier_simplified(self): - self.partner.sii_simplified_invoice = True + def test_aeat_check_exceptions_case_supplier_simplified(self): + self.partner.aeat_simplified_invoice = True invoice = self.env["account.move"].create( { "partner_id": self.partner.id, @@ -444,9 +444,9 @@ def test_sii_check_exceptions_case_supplier_simplified(self): } ) with self.assertRaises(exceptions.UserError): - invoice._sii_check_exceptions() + invoice._aeat_check_exceptions() - def test_sii_check_exceptions_case_supplier_on_post(self): + def test_aeat_check_exceptions_case_supplier_on_post(self): """Check sii exceptions when posting supplier bills""" supplier = self.supplier.copy() supplier.country_id = self.env.ref("base.es") @@ -481,14 +481,14 @@ def test_unlink_draft_invoice_when_not_sent_to_sii(self): self.assertFalse(draft_invoice.exists()) def test_unlink_invoice_when_sent_to_sii(self): - self.invoice.sii_state = "sent" + self. invoice.aeat_state = "sent" self.invoice.button_draft() # Convert to draft to check only SII exception with self.assertRaises(exceptions.UserError): self.invoice.unlink() def test_account_move_sii_write_exceptions(self): # out_invoice - self.invoice.sii_state = "sent" + self. invoice.aeat_state = "sent" with self.assertRaises(exceptions.UserError): self.invoice.write({"invoice_date": "2022-01-01"}) with self.assertRaises(exceptions.UserError): @@ -501,7 +501,7 @@ def test_account_move_sii_write_exceptions(self): "ref": "REF", } ) - in_invoice.sii_state = "sent" + in_invoice.aeat_state = "sent" partner = self.partner.copy() with self.assertRaises(exceptions.UserError): in_invoice.write({"partner_id": partner.id}) diff --git a/l10n_es_aeat_sii_oca/views/account_fiscal_position_view.xml b/l10n_es_aeat_sii_oca/views/account_fiscal_position_view.xml index 4c39838bc31..06d977c1a46 100644 --- a/l10n_es_aeat_sii_oca/views/account_fiscal_position_view.xml +++ b/l10n_es_aeat_sii_oca/views/account_fiscal_position_view.xml @@ -17,26 +17,26 @@ > - + diff --git a/l10n_es_aeat_sii_oca/views/account_move_views.xml b/l10n_es_aeat_sii_oca/views/account_move_views.xml index d2236826663..4f18a99c4d1 100644 --- a/l10n_es_aeat_sii_oca/views/account_move_views.xml +++ b/l10n_es_aeat_sii_oca/views/account_move_views.xml @@ -26,14 +26,14 @@ string="Send to SII" name="send_sii" groups="l10n_es_aeat.group_account_aeat" - attrs="{'invisible': ['|','|',('sii_enabled', '=', False), ('state', 'not in', ['posted']), ('sii_state','in',['sent','cancelled'])]}" + attrs="{'invisible': ['|','|',('sii_enabled', '=', False), ('state', 'not in', ['posted']), ('aeat_state','in',['sent','cancelled'])]}" /> @@ -118,18 +118,18 @@ - + @@ -140,13 +140,13 @@ groups="base.group_no_one" > - - + - - + @@ -188,32 +188,32 @@ @@ -224,8 +224,8 @@ diff --git a/l10n_es_aeat_sii_oca/views/res_partner_views.xml b/l10n_es_aeat_sii_oca/views/res_partner_views.xml index a71246bc451..7edfbea3b78 100644 --- a/l10n_es_aeat_sii_oca/views/res_partner_views.xml +++ b/l10n_es_aeat_sii_oca/views/res_partner_views.xml @@ -4,14 +4,10 @@ res.partner - + - + - diff --git a/l10n_es_aeat_sii_oss/models/account_move.py b/l10n_es_aeat_sii_oss/models/account_move.py index 4b82b9e3498..bb9071863e6 100644 --- a/l10n_es_aeat_sii_oss/models/account_move.py +++ b/l10n_es_aeat_sii_oss/models/account_move.py @@ -8,9 +8,9 @@ class AccountMove(models.Model): _inherit = "account.move" - def _get_sii_taxes_map(self, codes, date): + def _get_aeat_taxes_map(self, codes, date): """Inject OSS taxes when querying not subjected invoices.""" - taxes = super()._get_sii_taxes_map(codes, date) + taxes = super()._get_aeat_taxes_map(codes, date) if any([x in ["SFENS", "NotIncludedInTotal"] for x in codes]): taxes |= self.env["account.tax"].search( [ diff --git a/l10n_es_aeat_sii_oss/tests/test_l10n_es_aeat_sii.py b/l10n_es_aeat_sii_oss/tests/test_l10n_es_aeat_sii.py index 04ccd9ac3ae..6c26ad4cf81 100644 --- a/l10n_es_aeat_sii_oss/tests/test_l10n_es_aeat_sii.py +++ b/l10n_es_aeat_sii_oss/tests/test_l10n_es_aeat_sii.py @@ -34,7 +34,7 @@ def setUpClass(cls): ) def test_invoice_sii_oss(self): - self.partner.sii_simplified_invoice = True + self.partner.aeat_simplified_invoice = True invoice_form = Form( self.env["account.move"].with_context(default_move_type="out_invoice") ) @@ -48,6 +48,6 @@ def test_invoice_sii_oss(self): line_form.tax_ids.clear() line_form.tax_ids.add(self.tax_fr_20) invoice = invoice_form.save() - res = invoice._get_sii_invoice_dict() + res = invoice._get_aeat_invoice_dict() res_issue = res["FacturaExpedida"] self.assertEqual(res_issue["ImporteTotal"], 100) diff --git a/l10n_es_dua_sii/models/account_move.py b/l10n_es_dua_sii/models/account_move.py index 42175480fcf..332b28906a7 100644 --- a/l10n_es_dua_sii/models/account_move.py +++ b/l10n_es_dua_sii/models/account_move.py @@ -36,7 +36,7 @@ def _get_dua_fiscal_position_id(self, company): @api.depends("company_id", "fiscal_position_id", "invoice_line_ids.tax_ids") def _compute_dua_invoice(self): for invoice in self: - taxes = invoice._get_sii_taxes_map( + taxes = invoice._get_aeat_taxes_map( ["DUA"], self._get_document_fiscal_date() ) invoice.sii_dua_invoice = invoice.invoice_line_ids.filtered( @@ -59,7 +59,7 @@ def _compute_sii_enabled(self): invoice.sii_enabled = False return res - def _get_sii_invoice_dict_in(self, cancel=False): + def _get_aeat_invoice_dict_in(self, cancel=False): """Según la documentación de la AEAT, la operación de importación se registra con TipoFactura = F5, sin FechaOperacion y con el NIF de la propia compañia en IDEmisorFactura y Contraparte @@ -70,7 +70,7 @@ def _get_sii_invoice_dict_in(self, cancel=False): factura DUA se debe mantener el TipoFactura = LC. Puntos 4.24 y 4.25 de este pdf: https://www.agenciatributaria.es/static_files/AEAT/Contenidos_Comunes/La_Agencia_Tributaria/Modelos_y_formularios/Suministro_inmediato_informacion/V_1_1/Faqs_General/FAQs11_11_2020.pdf # noqa """ - res = super()._get_sii_invoice_dict_in(cancel=cancel) + res = super()._get_aeat_invoice_dict_in(cancel=cancel) if res.get("FacturaRecibida") and self.sii_dua_invoice: if not self.sii_lc_operation: res["FacturaRecibida"]["TipoFactura"] = "F5" diff --git a/l10n_es_pos_sii/models/pos_order.py b/l10n_es_pos_sii/models/pos_order.py index 372515424bc..515feae653a 100644 --- a/l10n_es_pos_sii/models/pos_order.py +++ b/l10n_es_pos_sii/models/pos_order.py @@ -34,14 +34,14 @@ def _compute_macrodata(self): "company_id", "company_id.sii_enabled", "fiscal_position_id", - "fiscal_position_id.sii_active", + "fiscal_position_id.aeat_active", ) def _compute_sii_enabled(self): """Compute if the order is enabled for the SII""" for order in self: if order.company_id.sii_enabled: order.sii_enabled = ( - order.fiscal_position_id and order.fiscal_position_id.sii_active + order.fiscal_position_id and order.fiscal_position_id.aeat_active ) or not order.fiscal_position_id else: order.sii_enabled = False @@ -62,10 +62,10 @@ def _get_sii_jobs_field_name(self): def _get_valid_document_states(self): return SII_VALID_POS_ORDER_STATES - def _sii_get_partner(self): + def _aeat_get_partner(self): return self.env["res.partner"].new({"name": "Cliente contado"}) - def _is_sii_simplified_invoice(self): + def _is_aeat_simplified_invoice(self): return True def _get_mapping_key(self): @@ -104,7 +104,7 @@ def _get_tax_info(self): line.order_id.pricelist_id.currency_id or self.session_id.currency_id, line.qty, product=line.product_id, - partner=self._sii_get_partner(), + partner=self._aeat_get_partner(), ) for line_tax in line_taxes["taxes"]: tax = self.env["account.tax"].browse(line_tax["id"]) @@ -124,7 +124,7 @@ def _get_sii_tax_req(self, tax): :return: REQ tax (or empty recordset) linked to the provided tax. """ self.ensure_one() - taxes_req = self._get_sii_taxes_map(["RE"], self._get_document_fiscal_date()) + taxes_req = self._get_aeat_taxes_map(["RE"], self._get_document_fiscal_date()) re_lines = self.lines.filtered( lambda x: tax in x.tax_ids_after_fiscal_position and x.tax_ids_after_fiscal_position & taxes_req @@ -140,8 +140,8 @@ def _get_document_amount_total(self): def _get_sii_invoice_type(self): return "R5" if self.amount_total < 0.0 else "F2" - 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 self.amount_total < 0.0: inv_dict["FacturaExpedida"]["TipoRectificativa"] = "I" return inv_dict diff --git a/l10n_es_pos_sii/tests/test_l10n_es_pos_sii.py b/l10n_es_pos_sii/tests/test_l10n_es_pos_sii.py index 03d6bb16b26..9bc930648ca 100644 --- a/l10n_es_pos_sii/tests/test_l10n_es_pos_sii.py +++ b/l10n_es_pos_sii/tests/test_l10n_es_pos_sii.py @@ -60,7 +60,7 @@ def setUp(self): .create( { "name": "Test simplified default customer", - "sii_simplified_invoice": True, + "aeat_simplified_invoice": True, } ) .id, @@ -199,7 +199,7 @@ def _create_session_closed(self): def _compare_sii_dict(self, json_file, order): """Helper method for comparing the expected SII dict with .""" module = "l10n_es_pos_sii" - result_dict = order._get_sii_invoice_dict() + result_dict = order._get_aeat_invoice_dict() path = get_resource_path(module, "tests/json", json_file) if not path: raise Exception("Incorrect JSON file: %s" % json_file) @@ -248,9 +248,9 @@ def test_03_job_creation(self): order.send_sii() self.assertTrue(order.order_jobs_ids) - def test_04_is_sii_simplified_invoice(self): + def test_04_is_aeat_simplified_invoice(self): for order in self.session.order_ids: - self.assertTrue(order._is_sii_simplified_invoice()) + self.assertTrue(order._is_aeat_simplified_invoice()) def test_05_sii_description(self): company = self.order.company_id diff --git a/l10n_es_pos_sii/views/pos_order.xml b/l10n_es_pos_sii/views/pos_order.xml index 63a4d211186..9a47d6d081e 100644 --- a/l10n_es_pos_sii/views/pos_order.xml +++ b/l10n_es_pos_sii/views/pos_order.xml @@ -18,7 +18,7 @@ string="Send to SII" name="send_sii" groups="l10n_es_aeat.group_account_aeat" - attrs="{'invisible': ['|','|',('sii_enabled', '=', False),('state', 'not in', ['done']),('sii_state','in',['sent','cancelled'])]}" + attrs="{'invisible': ['|','|',('sii_enabled', '=', False),('state', 'not in', ['done']),('aeat_state','in',['sent','cancelled'])]}" /> @@ -51,14 +51,14 @@ - + @@ -69,13 +69,13 @@ groups="base.group_no_one" > - - + - - +