Skip to content

Commit

Permalink
[MIG] l10n_es_aeat_sii_invoice_summary: Migration to 14.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ramiadavid committed Jun 13, 2022
1 parent 3c66f00 commit 22b08a5
Show file tree
Hide file tree
Showing 12 changed files with 234 additions and 79 deletions.
1 change: 1 addition & 0 deletions l10n_es_aeat_sii_invoice_summary/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# © 2017 FactorLibre - Hugo Santos <[email protected]>
# © 2022 ProcessControl - David Ramia <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import models
11 changes: 7 additions & 4 deletions l10n_es_aeat_sii_invoice_summary/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
# © 2017 FactorLibre - Hugo Santos <[email protected]>
# © 2022 ProcessControl - David Ramia <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Envio de factura simplificada resumen TPV a SII",
"version": "10.0.1.0.0",
"depends": ["l10n_es_aeat_sii"],
"version": "14.0.1.0.0",
"depends": [
"l10n_es_aeat_sii_oca",
],
"category": "Accounting & Finance",
"author": "FactorLibre," "Odoo Community Association (OCA)",
"author": "FactorLibre," "ProcessControl," "Odoo Community Association (OCA)",
"license": "AGPL-3",
"website": "https://github.com/OCA/l10n-spain",
"data": ["views/account_invoice_view.xml"],
"data": ["views/account_move_view.xml"],
"installable": True,
"application": False,
}
77 changes: 67 additions & 10 deletions l10n_es_aeat_sii_invoice_summary/i18n/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,92 @@
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 11.0\n"
"Project-Id-Version: Odoo Server 14.0+e\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-03-20 12:10+0000\n"
"PO-Revision-Date: 2018-03-20 13:13+0100\n"
"POT-Creation-Date: 2022-05-26 19:46+0000\n"
"PO-Revision-Date: 2022-05-26 21:48+0200\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: \n"
"X-Generator: Poedit 1.8.7.1\n"
"X-Generator: Poedit 3.0.1\n"

#. module: l10n_es_aeat_sii_invoice_summary
#: model:ir.model,name:l10n_es_aeat_sii_invoice_summary.model_account_invoice
msgid "Invoice"
msgstr "Factura"
#: model:ir.model.fields,field_description:l10n_es_aeat_sii_invoice_summary.field_account_move__display_name
msgid "Display Name"
msgstr "Nombre mostrado"

#. module: l10n_es_aeat_sii_invoice_summary
#: model:ir.model.fields,field_description:l10n_es_aeat_sii_invoice_summary.field_account_invoice_is_invoice_summary
#: model:ir.model.fields,field_description:l10n_es_aeat_sii_invoice_summary.field_account_move__id
msgid "ID"
msgstr "ID"

#. module: l10n_es_aeat_sii_invoice_summary
#: model:ir.model.fields,field_description:l10n_es_aeat_sii_invoice_summary.field_account_bank_statement_line__is_invoice_summary
#: model:ir.model.fields,field_description:l10n_es_aeat_sii_invoice_summary.field_account_move__is_invoice_summary
#: model:ir.model.fields,field_description:l10n_es_aeat_sii_invoice_summary.field_account_payment__is_invoice_summary
msgid "Is SII simplified invoice Summary?"
msgstr "Resumen facturas simplificadas SII"

#. module: l10n_es_aeat_sii_invoice_summary
#: model:ir.model.fields,field_description:l10n_es_aeat_sii_invoice_summary.field_account_invoice_sii_invoice_summary_start
#: model:ir.model,name:l10n_es_aeat_sii_invoice_summary.model_account_move
msgid "Journal Entry"
msgstr "Asiento contable"

#. module: l10n_es_aeat_sii_invoice_summary
#: model:ir.model.fields,field_description:l10n_es_aeat_sii_invoice_summary.field_account_move____last_update
msgid "Last Modified on"
msgstr "Modificado por última vez el"

#. module: l10n_es_aeat_sii_invoice_summary
#: model:ir.model.fields,field_description:l10n_es_aeat_sii_invoice_summary.field_account_bank_statement_line__sii_invoice_summary_start
#: model:ir.model.fields,field_description:l10n_es_aeat_sii_invoice_summary.field_account_move__sii_invoice_summary_start
#: model:ir.model.fields,field_description:l10n_es_aeat_sii_invoice_summary.field_account_payment__sii_invoice_summary_start
msgid "SII Invoice Summary: First Invoice"
msgstr "Resumen facturas simplificadas SII: Primera factura"

#. module: l10n_es_aeat_sii_invoice_summary
#: model:ir.model.fields,field_description:l10n_es_aeat_sii_invoice_summary.field_account_invoice_sii_invoice_summary_end
#: model:ir.model.fields,field_description:l10n_es_aeat_sii_invoice_summary.field_account_bank_statement_line__sii_invoice_summary_end
#: model:ir.model.fields,field_description:l10n_es_aeat_sii_invoice_summary.field_account_move__sii_invoice_summary_end
#: model:ir.model.fields,field_description:l10n_es_aeat_sii_invoice_summary.field_account_payment__sii_invoice_summary_end
msgid "SII Invoice Summary: Last Invoice"
msgstr "Resumen facturas simplificadas SII: Última factura"

#. module: l10n_es_aeat_sii_invoice_summary
#: code:addons/l10n_es_aeat_sii_invoice_summary/models/account_move.py:0
#, python-format
msgid "The partner has not a VAT configured."
msgstr "El cliente no tiene un CIF/NIF configurado."

#. module: l10n_es_aeat_sii_invoice_summary
#: code:addons/l10n_es_aeat_sii_invoice_summary/models/account_move.py:0
#, python-format
msgid "The supplier number invoice is required"
msgstr "El nº de factura del proveedor es obligatorio"

#. module: l10n_es_aeat_sii_invoice_summary
#: code:addons/l10n_es_aeat_sii_invoice_summary/models/account_move.py:0
#, python-format
msgid "This company doesn't have SII enabled."
msgstr "Esta compañía no tiene el SII habilitado."

#. module: l10n_es_aeat_sii_invoice_summary
#: code:addons/l10n_es_aeat_sii_invoice_summary/models/account_move.py:0
#, python-format
msgid "This invoice is not SII enabled."
msgstr "Esta compañía no tiene el SII habilitado."

#. module: l10n_es_aeat_sii_invoice_summary
#: code:addons/l10n_es_aeat_sii_invoice_summary/models/account_move.py:0
#, python-format
msgid "You can't make a supplier simplified invoice."
msgstr "No puede realizar una factura simplificada a un proveedor."

#. module: l10n_es_aeat_sii_invoice_summary
#: code:addons/l10n_es_aeat_sii_invoice_summary/models/account_move.py:0
#, python-format
msgid "You have to select what account chart template use this company."
msgstr "Debe seleccionar el plan de cuentas que está utilizando esta compañía."
Original file line number Diff line number Diff line change
@@ -1,35 +1,93 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * l10n_es_aeat_sii_invoice_summary
# * l10n_es_aeat_sii_invoice_summary
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Project-Id-Version: Odoo Server 14.0+e\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: <>\n"
"POT-Creation-Date: 2022-05-26 19:46+0000\n"
"PO-Revision-Date: 2022-05-26 19:46+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: l10n_es_aeat_sii_invoice_summary
#: model:ir.model,name:l10n_es_aeat_sii_invoice_summary.model_account_invoice
msgid "Invoice"
#: model:ir.model.fields,field_description:l10n_es_aeat_sii_invoice_summary.field_account_move__display_name
msgid "Display Name"
msgstr ""

#. module: l10n_es_aeat_sii_invoice_summary
#: model:ir.model.fields,field_description:l10n_es_aeat_sii_invoice_summary.field_account_invoice_is_invoice_summary
#: model:ir.model.fields,field_description:l10n_es_aeat_sii_invoice_summary.field_account_move__id
msgid "ID"
msgstr ""

#. module: l10n_es_aeat_sii_invoice_summary
#: model:ir.model.fields,field_description:l10n_es_aeat_sii_invoice_summary.field_account_bank_statement_line__is_invoice_summary
#: model:ir.model.fields,field_description:l10n_es_aeat_sii_invoice_summary.field_account_move__is_invoice_summary
#: model:ir.model.fields,field_description:l10n_es_aeat_sii_invoice_summary.field_account_payment__is_invoice_summary
msgid "Is SII simplified invoice Summary?"
msgstr ""

#. module: l10n_es_aeat_sii_invoice_summary
#: model:ir.model.fields,field_description:l10n_es_aeat_sii_invoice_summary.field_account_invoice_sii_invoice_summary_start
#: model:ir.model,name:l10n_es_aeat_sii_invoice_summary.model_account_move
msgid "Journal Entry"
msgstr ""

#. module: l10n_es_aeat_sii_invoice_summary
#: model:ir.model.fields,field_description:l10n_es_aeat_sii_invoice_summary.field_account_move____last_update
msgid "Last Modified on"
msgstr ""

#. module: l10n_es_aeat_sii_invoice_summary
#: model:ir.model.fields,field_description:l10n_es_aeat_sii_invoice_summary.field_account_bank_statement_line__sii_invoice_summary_start
#: model:ir.model.fields,field_description:l10n_es_aeat_sii_invoice_summary.field_account_move__sii_invoice_summary_start
#: model:ir.model.fields,field_description:l10n_es_aeat_sii_invoice_summary.field_account_payment__sii_invoice_summary_start
msgid "SII Invoice Summary: First Invoice"
msgstr ""

#. module: l10n_es_aeat_sii_invoice_summary
#: model:ir.model.fields,field_description:l10n_es_aeat_sii_invoice_summary.field_account_invoice_sii_invoice_summary_end
#: model:ir.model.fields,field_description:l10n_es_aeat_sii_invoice_summary.field_account_bank_statement_line__sii_invoice_summary_end
#: model:ir.model.fields,field_description:l10n_es_aeat_sii_invoice_summary.field_account_move__sii_invoice_summary_end
#: model:ir.model.fields,field_description:l10n_es_aeat_sii_invoice_summary.field_account_payment__sii_invoice_summary_end
msgid "SII Invoice Summary: Last Invoice"
msgstr ""

#. module: l10n_es_aeat_sii_invoice_summary
#: code:addons/l10n_es_aeat_sii_invoice_summary/models/account_move.py:0
#, python-format
msgid "The partner has not a VAT configured."
msgstr ""

#. module: l10n_es_aeat_sii_invoice_summary
#: code:addons/l10n_es_aeat_sii_invoice_summary/models/account_move.py:0
#, python-format
msgid "The supplier number invoice is required"
msgstr ""

#. module: l10n_es_aeat_sii_invoice_summary
#: code:addons/l10n_es_aeat_sii_invoice_summary/models/account_move.py:0
#, python-format
msgid "This company doesn't have SII enabled."
msgstr ""

#. module: l10n_es_aeat_sii_invoice_summary
#: code:addons/l10n_es_aeat_sii_invoice_summary/models/account_move.py:0
#, python-format
msgid "This invoice is not SII enabled."
msgstr ""

#. module: l10n_es_aeat_sii_invoice_summary
#: code:addons/l10n_es_aeat_sii_invoice_summary/models/account_move.py:0
#, python-format
msgid "You can't make a supplier simplified invoice."
msgstr ""

#. module: l10n_es_aeat_sii_invoice_summary
#: code:addons/l10n_es_aeat_sii_invoice_summary/models/account_move.py:0
#, python-format
msgid "You have to select what account chart template use this company."
msgstr ""
3 changes: 2 additions & 1 deletion l10n_es_aeat_sii_invoice_summary/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# © 2017 FactorLibre - Hugo Santos <[email protected]>
# © 2022 ProcessControl - David Ramia <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import account_invoice
from . import account_move
35 changes: 0 additions & 35 deletions l10n_es_aeat_sii_invoice_summary/models/account_invoice.py

This file was deleted.

66 changes: 66 additions & 0 deletions l10n_es_aeat_sii_invoice_summary/models/account_move.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# © 2017 FactorLibre - Hugo Santos <[email protected]>
# © 2018 FactorLibre - Victor Rodrigo <[email protected]>
# © 2022 ProcessControl - David Ramia <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import _, exceptions, fields, models


class AccountMove(models.Model):
_inherit = "account.move"

is_invoice_summary = fields.Boolean("Is SII simplified invoice Summary?")
sii_invoice_summary_start = fields.Char("SII Invoice Summary: First Invoice")
sii_invoice_summary_end = fields.Char("SII Invoice Summary: Last Invoice")

def _get_sii_invoice_dict_out(self, cancel=False):
inv_dict = super(AccountMove, self)._get_sii_invoice_dict_out(cancel=cancel)
if self.is_invoice_summary and self.move_type == "out_invoice":
tipo_factura = "F4"
if self.sii_invoice_summary_start:
if self.sii_invoice_summary_start == self.sii_invoice_summary_end:
tipo_factura = "F2"
else:
inv_dict["IDFactura"][
"NumSerieFacturaEmisor"
] = self.sii_invoice_summary_start
inv_dict["IDFactura"][
"NumSerieFacturaEmisorResumenFin"
] = self.sii_invoice_summary_end
if "FacturaExpedida" in inv_dict:
if "TipoFactura" in inv_dict["FacturaExpedida"]:
inv_dict["FacturaExpedida"]["TipoFactura"] = tipo_factura
if "Contraparte" in inv_dict["FacturaExpedida"]:
del inv_dict["FacturaExpedida"]["Contraparte"]

return inv_dict

def _sii_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 is_simplified_invoice and self.move_type[:2] == "in":
raise exceptions.UserError(
_("You can't make a supplier simplified invoice.")
)
if (
(gen_type != 3 or country_code == "ES")
and not partner.vat
and not is_simplified_invoice
and not self.is_invoice_summary
):
raise exceptions.UserError(_("The partner has not a VAT configured."))

if not self.company_id.chart_template_id:
raise exceptions.UserError(
_("You have to select what account chart template use this" " company.")
)
if not self.company_id.sii_enabled:
raise exceptions.UserError(_("This company doesn't have SII enabled."))
if not self.sii_enabled:
raise exceptions.UserError(_("This invoice is not SII enabled."))
if not self.ref and self.move_type in ["in_invoice", "in_refund"]:
raise exceptions.UserError(_("The supplier number invoice is required"))
1 change: 1 addition & 0 deletions l10n_es_aeat_sii_invoice_summary/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
* Hugo Santos <[email protected]> (https://factorlibre.com/)
* Victor Rodrigo <[email protected]> (https://factorlibre.com/)
* Omar Castiñeira <[email protected]> (https://comunitea.com/)
* David Ramia <[email protected]> (https://processcontrol.es)
19 changes: 0 additions & 19 deletions l10n_es_aeat_sii_invoice_summary/views/account_invoice_view.xml

This file was deleted.

24 changes: 24 additions & 0 deletions l10n_es_aeat_sii_invoice_summary/views/account_move_view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- © 2018 Victor Rodrigo <[email protected]>
© 2022 ProcessControl - David Ramia <[email protected]>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -->
<odoo>
<record id="invoice_sii_move_summary_form_view" model="ir.ui.view">
<field name="name">account.move.sii.invoice.summary.form.view</field>
<field name="model">account.move</field>
<field name="inherit_id" ref="l10n_es_aeat_sii_oca.invoice_sii_form" />
<field name="arch" type="xml">
<field name="sii_description" position="before">
<field name="is_invoice_summary" />
<field
name="sii_invoice_summary_start"
attrs="{'invisible': [('is_invoice_summary', '=', False)]}"
/>
<field
name="sii_invoice_summary_end"
attrs="{'invisible': [('is_invoice_summary', '=', False)]}"
/>
</field>
</field>
</record>
</odoo>
1 change: 0 additions & 1 deletion setup/l10n_es_aeat_sii_invoice_summary/odoo/__init__.py

This file was deleted.

This file was deleted.

0 comments on commit 22b08a5

Please sign in to comment.