-
-
Notifications
You must be signed in to change notification settings - Fork 523
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIG] l10n_es_aeat_sii_invoice_summary: Migration to 14.0
- Loading branch information
1 parent
3c66f00
commit 22b08a5
Showing
12 changed files
with
234 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 66 additions & 8 deletions
74
l10n_es_aeat_sii_invoice_summary/i18n/l10n_es_aeat_sii_invoice_summary.pot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
35
l10n_es_aeat_sii_invoice_summary/models/account_invoice.py
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
19
l10n_es_aeat_sii_invoice_summary/views/account_invoice_view.xml
This file was deleted.
Oops, something went wrong.
24 changes: 24 additions & 0 deletions
24
l10n_es_aeat_sii_invoice_summary/views/account_move_view.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.