[IMP] account: improve test helper

Creating a test invoice without tax was impossible with this helper, as the default tax got applied when the 'taxes' parameter was None. We change that to allow doing it by simply providing an empty list in it instead of None.

closes odoo/odoo#113541

X-original-commit: f3ae4f7fa91b73be6a5647724697f73fdf77cbdd
Related: odoo/enterprise#37484
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
This commit is contained in:
oco-odoo
2023-02-28 23:49:25 +01:00
parent eaff61793b
commit 1997c0a01d
+2 -2
View File
@@ -379,7 +379,7 @@ class AccountTestInvoicingCommon(TransactionCase):
for product in (products or []):
with move_form.invoice_line_ids.new() as line_form:
line_form.product_id = product
if taxes:
if taxes is not None:
line_form.tax_ids.clear()
for tax in taxes:
line_form.tax_ids.add(tax)
@@ -388,7 +388,7 @@ class AccountTestInvoicingCommon(TransactionCase):
with move_form.invoice_line_ids.new() as line_form:
line_form.name = "test line"
line_form.price_unit = amount
if taxes:
if taxes is not None:
line_form.tax_ids.clear()
for tax in taxes:
line_form.tax_ids.add(tax)