[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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user