From 2bacc392763d4828adce47e4e6eef29e9ae55928 Mon Sep 17 00:00:00 2001 From: Jigar Vaghela Date: Wed, 19 Feb 2020 13:07:03 +0000 Subject: [PATCH] [IMP] l10n_in_sale: support null product_id in tax line we add product_id in tax line from saas-12.1 from this commit https://github.com/odoo/odoo/commit/451fd6cc90aaa14816376a0285334678df9ce484?diff=unified#diff-cc1fa4f0d598f9e02993620519146532R68 so when user is migrated from old version then product_id is null in tax line so in this commit we support null in product_id closes odoo/odoo#48241 X-original-commit: f7da145a9a453dcf9057c3dbe719ae6c02804c04 Signed-off-by: Josse Colpaert --- addons/l10n_in_sale/report/account_invoice_report.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/l10n_in_sale/report/account_invoice_report.py b/addons/l10n_in_sale/report/account_invoice_report.py index 92894cecec9..16834b44fe0 100644 --- a/addons/l10n_in_sale/report/account_invoice_report.py +++ b/addons/l10n_in_sale/report/account_invoice_report.py @@ -9,7 +9,7 @@ class L10nInAccountInvoiceReport(models.Model): def _where(self): where_str = super(L10nInAccountInvoiceReport, self)._where() - where_str += """ AND aml.product_id != COALESCE( - (SELECT value from ir_config_parameter where key = 'sale.default_deposit_product_id'), '0')::int + where_str += """ AND (aml.product_id IS NULL or aml.product_id != COALESCE( + (SELECT value from ir_config_parameter where key = 'sale.default_deposit_product_id'), '0')::int) """ return where_str