From 1997c0a01d2e70a271ff7207689edf1147c4943b Mon Sep 17 00:00:00 2001 From: oco-odoo Date: Wed, 14 Dec 2022 14:02:49 +0000 Subject: [PATCH] [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 Signed-off-by: Olivier Colson (oco) --- addons/account/tests/common.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account/tests/common.py b/addons/account/tests/common.py index 7ecfbeda403..50743012fc5 100644 --- a/addons/account/tests/common.py +++ b/addons/account/tests/common.py @@ -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)