Skip to content

Commit

Permalink
[IMP] : black, isort, prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
eLBati authored and OCA-git-bot committed Nov 9, 2023
1 parent 7bc3c0e commit b9ef807
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 41 deletions.
7 changes: 3 additions & 4 deletions l10n_it_fatturapa_out_triple_discount/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

{

"name": "ITA - Fattura elettronica - Integrazione sconto triplo",
"summary": "Modulo ponte tra emissione " "fatture elettroniche e sconto triplo",
"summary": "Modulo ponte tra emissione fatture elettroniche e sconto triplo",
"version": "14.0.1.0.0",
"development_status": "Beta",
"category": "Hidden",
'website': 'https://github.com/OCA/l10n-italy'
'/tree/12.0/l10n_it_fatturapa_out_triple_discount',
"website": "https://github.com/OCA/l10n-italy"
"/tree/12.0/l10n_it_fatturapa_out_triple_discount",
"author": "Agile Business Group, Odoo Community Association (OCA)",
"license": "AGPL-3",
"auto_install": True,
Expand Down
2 changes: 1 addition & 1 deletion l10n_it_fatturapa_out_triple_discount/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

# tests disabled because unstable
# TODO https://github.com/OCA/l10n-italy/issues/1588
#from . import test_fatturapa_triple_discount
# from . import test_fatturapa_triple_discount
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8" ?>
<ns1:FatturaElettronica
xmlns:ns1="http://ivaservizi.agenziaentrate.gov.it/docs/xsd/fatture/v1.2"
versione="FPA12">
xmlns:ns1="http://ivaservizi.agenziaentrate.gov.it/docs/xsd/fatture/v1.2"
versione="FPA12"
>
<FatturaElettronicaHeader>
<DatiTrasmissione>
<IdTrasmittente>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,49 +2,57 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

import codecs
from odoo.addons.l10n_it_fatturapa_out.tests.fatturapa_common import (
FatturaPACommon)

from odoo.addons.l10n_it_fatturapa_out.tests.fatturapa_common import FatturaPACommon

class TestInvoiceTripleDiscount(FatturaPACommon):

class TestInvoiceTripleDiscount(FatturaPACommon):
def setUp(self):
super(TestInvoiceTripleDiscount, self).setUp()

def test_xml_export_triple_discount(self):
self.set_sequences(13, '2016-01-07')
invoice = self.invoice_model.create({
'date_invoice': '2016-01-07',
'partner_id': self.res_partner_fatturapa_0.id,
'journal_id': self.sales_journal.id,
'account_id': self.a_recv.id,
'payment_term_id': self.account_payment_term.id,
'user_id': self.user_demo.id,
'type': 'out_invoice',
'currency_id': self.EUR.id,
'invoice_line_ids': [
(0, 0, {
'account_id': self.a_sale.id,
'product_id': self.product_product_10.id,
'name': 'Mouse\nOptical',
'quantity': 1,
'uom_id': self.product_uom_unit.id,
'price_unit': 10,
'discount': 50,
'discount2': 50,
'discount3': 50,
'invoice_line_tax_ids': [(6, 0, {
self.tax_22.id})]
})],
})
self.set_sequences(13, "2016-01-07")
invoice = self.invoice_model.create(
{
"date_invoice": "2016-01-07",
"partner_id": self.res_partner_fatturapa_0.id,
"journal_id": self.sales_journal.id,
"account_id": self.a_recv.id,
"payment_term_id": self.account_payment_term.id,
"user_id": self.user_demo.id,
"type": "out_invoice",
"currency_id": self.EUR.id,
"invoice_line_ids": [
(
0,
0,
{
"account_id": self.a_sale.id,
"product_id": self.product_product_10.id,
"name": "Mouse\nOptical",
"quantity": 1,
"uom_id": self.product_uom_unit.id,
"price_unit": 10,
"discount": 50,
"discount2": 50,
"discount3": 50,
"invoice_line_tax_ids": [(6, 0, {self.tax_22.id})],
},
)
],
}
)
invoice.action_invoice_open()
res = self.run_wizard(invoice.id)

self.assertTrue(res)
attachment = self.attach_model.browse(res['res_id'])
self.set_e_invoice_file_id(attachment, 'IT06363391001_00001.xml')
attachment = self.attach_model.browse(res["res_id"])
self.set_e_invoice_file_id(attachment, "IT06363391001_00001.xml")

# XML doc to be validated
xml_content = codecs.decode(attachment.datas, 'base64')
self.check_content(xml_content, 'IT06363391001_00001.xml',
module_name='l10n_it_fatturapa_out_triple_discount')
xml_content = codecs.decode(attachment.datas, "base64")
self.check_content(
xml_content,
"IT06363391001_00001.xml",
module_name="l10n_it_fatturapa_out_triple_discount",
)
6 changes: 6 additions & 0 deletions setup/l10n_it_fatturapa_out_triple_discount/setup.py
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,
)

0 comments on commit b9ef807

Please sign in to comment.