-
-
Notifications
You must be signed in to change notification settings - Fork 524
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMP] l10n_es_aeat_sii_invoice_summary: black, isort, prettier
- Loading branch information
1 parent
ff9ccde
commit 3c66f00
Showing
8 changed files
with
44 additions
and
48 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,4 +1,3 @@ | ||
# -*- coding: utf-8 -*- | ||
# © 2017 FactorLibre - Hugo Santos <[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,20 +1,14 @@ | ||
# -*- coding: utf-8 -*- | ||
# © 2017 FactorLibre - Hugo Santos <[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' | ||
], | ||
'category': "Accounting & Finance", | ||
'author': 'FactorLibre,' | ||
'Odoo Community Association (OCA)', | ||
'license': 'AGPL-3', | ||
'website': 'https://odoospain.odoo.com', | ||
'data': [ | ||
'views/account_invoice_view.xml' | ||
], | ||
'installable': True, | ||
'application': False | ||
"name": "Envio de factura simplificada resumen TPV a SII", | ||
"version": "10.0.1.0.0", | ||
"depends": ["l10n_es_aeat_sii"], | ||
"category": "Accounting & Finance", | ||
"author": "FactorLibre," "Odoo Community Association (OCA)", | ||
"license": "AGPL-3", | ||
"website": "https://github.com/OCA/l10n-spain", | ||
"data": ["views/account_invoice_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
# -*- coding: utf-8 -*- | ||
# © 2017 FactorLibre - Hugo Santos <[email protected]> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
from . import account_invoice |
46 changes: 21 additions & 25 deletions
46
l10n_es_aeat_sii_invoice_summary/models/account_invoice.py
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,39 +1,35 @@ | ||
# -*- coding: utf-8 -*- | ||
# © 2017 FactorLibre - Hugo Santos <[email protected]> | ||
# © 2018 FactorLibre - Victor Rodrigo <[email protected]> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
from openerp import api, fields, models | ||
|
||
|
||
class AccountInvoice(models.Model): | ||
_inherit = 'account.invoice' | ||
_inherit = "account.invoice" | ||
|
||
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') | ||
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") | ||
|
||
@api.multi | ||
def _get_sii_invoice_dict_out(self, cancel=False): | ||
inv_dict = super(AccountInvoice, self)._get_sii_invoice_dict_out( | ||
cancel=cancel) | ||
if self.is_invoice_summary and \ | ||
self.type == 'out_invoice': | ||
tipo_factura = 'F4' | ||
inv_dict = super(AccountInvoice, self)._get_sii_invoice_dict_out(cancel=cancel) | ||
if self.is_invoice_summary and self.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' | ||
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 tipo_factura == 'F4': | ||
if 'Contraparte' in inv_dict['FacturaExpedida']: | ||
del inv_dict['FacturaExpedida']['Contraparte'] | ||
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 tipo_factura == "F4": | ||
if "Contraparte" in inv_dict["FacturaExpedida"]: | ||
del inv_dict["FacturaExpedida"]["Contraparte"] | ||
return inv_dict |
10 changes: 5 additions & 5 deletions
10
l10n_es_aeat_sii_invoice_summary/views/account_invoice_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 |
---|---|---|
@@ -1,17 +1,17 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<!-- © 2018 Victor Rodrigo <[email protected]> | ||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). --> | ||
<openerp> | ||
<data> | ||
<record id="account_invoice_form_view" model="ir.ui.view"> | ||
<field name="name">account.invoice.form</field> | ||
<field name="model">account.invoice</field> | ||
<field name="inherit_id" ref="l10n_es_aeat_sii.invoice_sii_form"/> | ||
<field name="inherit_id" ref="l10n_es_aeat_sii.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"/> | ||
<field name="sii_invoice_summary_end"/> | ||
<field name="is_invoice_summary" /> | ||
<field name="sii_invoice_summary_start" /> | ||
<field name="sii_invoice_summary_end" /> | ||
</field> | ||
</field> | ||
</record> | ||
|
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 @@ | ||
__import__('pkg_resources').declare_namespace(__name__) |
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 @@ | ||
__import__('pkg_resources').declare_namespace(__name__) |
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,6 @@ | ||
import setuptools | ||
|
||
setuptools.setup( | ||
setup_requires=['setuptools-odoo'], | ||
odoo_addon=True, | ||
) |