| 1 |
from odoo import Command |
| 2 |
from odoo.tests import tagged |
| 3 |
from odoo.addons.l10n_sa_edi.tests.common import TestSaEdiCommon |
| 4 |
|
| 5 |
|
| 6 |
@tagged('post_install_l10n', 'post_install', '-at_install') |
| 7 |
class TestL10nSaInvoice(TestSaEdiCommon): |
| 8 |
|
| 9 |
def test_invoice_section_lines_rendering(self): |
| 10 |
invoice = self.env['account.move'].create([{ |
| 11 |
'move_type': 'out_invoice', |
| 12 |
'partner_id': self.partner_sa_simplified.id, |
| 13 |
'invoice_line_ids': [ |
| 14 |
Command.create({ |
| 15 |
'product_id': self.product_a.id, |
| 16 |
'tax_ids': self.tax_15.ids, |
| 17 |
'price_unit': 100.0, |
| 18 |
}), |
| 19 |
Command.create({ |
| 20 |
'display_type': 'line_section', |
| 21 |
'name': 'section line', |
| 22 |
}), |
| 23 |
Command.create({ |
| 24 |
'product_id': self.product_b.id, |
| 25 |
'tax_ids': self.tax_15.ids, |
| 26 |
'price_unit': 200.0, |
| 27 |
}) |
| 28 |
] |
| 29 |
}]) |
| 30 |
invoice.action_post() |
| 31 |
html = self.env['ir.actions.report']._render_qweb_html('account.report_invoice_with_payments', invoice.ids)[0] |
| 32 |
self.assertTrue(html) |