|
2 | 2 | # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
3 | 3 |
|
4 | 4 | import codecs |
5 | | -from odoo.addons.l10n_it_fatturapa_out.tests.fatturapa_common import ( |
6 | | - FatturaPACommon) |
7 | 5 |
|
| 6 | +from odoo.addons.l10n_it_fatturapa_out.tests.fatturapa_common import FatturaPACommon |
8 | 7 |
|
9 | | -class TestInvoiceTripleDiscount(FatturaPACommon): |
10 | 8 |
|
| 9 | +class TestInvoiceTripleDiscount(FatturaPACommon): |
11 | 10 | def setUp(self): |
12 | 11 | super(TestInvoiceTripleDiscount, self).setUp() |
13 | 12 |
|
14 | 13 | def test_xml_export_triple_discount(self): |
15 | | - self.set_sequences(13, '2016-01-07') |
16 | | - invoice = self.invoice_model.create({ |
17 | | - 'date_invoice': '2016-01-07', |
18 | | - 'partner_id': self.res_partner_fatturapa_0.id, |
19 | | - 'journal_id': self.sales_journal.id, |
20 | | - 'account_id': self.a_recv.id, |
21 | | - 'payment_term_id': self.account_payment_term.id, |
22 | | - 'user_id': self.user_demo.id, |
23 | | - 'type': 'out_invoice', |
24 | | - 'currency_id': self.EUR.id, |
25 | | - 'invoice_line_ids': [ |
26 | | - (0, 0, { |
27 | | - 'account_id': self.a_sale.id, |
28 | | - 'product_id': self.product_product_10.id, |
29 | | - 'name': 'Mouse\nOptical', |
30 | | - 'quantity': 1, |
31 | | - 'uom_id': self.product_uom_unit.id, |
32 | | - 'price_unit': 10, |
33 | | - 'discount': 50, |
34 | | - 'discount2': 50, |
35 | | - 'discount3': 50, |
36 | | - 'invoice_line_tax_ids': [(6, 0, { |
37 | | - self.tax_22.id})] |
38 | | - })], |
39 | | - }) |
| 14 | + self.set_sequences(13, "2016-01-07") |
| 15 | + invoice = self.invoice_model.create( |
| 16 | + { |
| 17 | + "date_invoice": "2016-01-07", |
| 18 | + "partner_id": self.res_partner_fatturapa_0.id, |
| 19 | + "journal_id": self.sales_journal.id, |
| 20 | + "account_id": self.a_recv.id, |
| 21 | + "payment_term_id": self.account_payment_term.id, |
| 22 | + "user_id": self.user_demo.id, |
| 23 | + "type": "out_invoice", |
| 24 | + "currency_id": self.EUR.id, |
| 25 | + "invoice_line_ids": [ |
| 26 | + ( |
| 27 | + 0, |
| 28 | + 0, |
| 29 | + { |
| 30 | + "account_id": self.a_sale.id, |
| 31 | + "product_id": self.product_product_10.id, |
| 32 | + "name": "Mouse\nOptical", |
| 33 | + "quantity": 1, |
| 34 | + "uom_id": self.product_uom_unit.id, |
| 35 | + "price_unit": 10, |
| 36 | + "discount": 50, |
| 37 | + "discount2": 50, |
| 38 | + "discount3": 50, |
| 39 | + "invoice_line_tax_ids": [(6, 0, {self.tax_22.id})], |
| 40 | + }, |
| 41 | + ) |
| 42 | + ], |
| 43 | + } |
| 44 | + ) |
40 | 45 | invoice.action_invoice_open() |
41 | 46 | res = self.run_wizard(invoice.id) |
42 | 47 |
|
43 | 48 | self.assertTrue(res) |
44 | | - attachment = self.attach_model.browse(res['res_id']) |
45 | | - self.set_e_invoice_file_id(attachment, 'IT06363391001_00001.xml') |
| 49 | + attachment = self.attach_model.browse(res["res_id"]) |
| 50 | + self.set_e_invoice_file_id(attachment, "IT06363391001_00001.xml") |
46 | 51 |
|
47 | 52 | # XML doc to be validated |
48 | | - xml_content = codecs.decode(attachment.datas, 'base64') |
49 | | - self.check_content(xml_content, 'IT06363391001_00001.xml', |
50 | | - module_name='l10n_it_fatturapa_out_triple_discount') |
| 53 | + xml_content = codecs.decode(attachment.datas, "base64") |
| 54 | + self.check_content( |
| 55 | + xml_content, |
| 56 | + "IT06363391001_00001.xml", |
| 57 | + module_name="l10n_it_fatturapa_out_triple_discount", |
| 58 | + ) |
0 commit comments