From 547e6e37f423e2ef920833de30394ee9bf3062b2 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Fri, 15 Mar 2019 09:32:34 +0000 Subject: [PATCH] [FIX] purchase: canceled bill in suggestion - Install `account_cancel` - Create a vendor bill for Partner A, cancel it - Create a new vendor bill for A The 'Auto-Complete' suggest a bill with an empty name, and only an amount. It corresponds to the canceled bill. On a canceled bill, the `number` field is empty, and consequently the `name` is empty as well. Whatever is the state of the bill, displaying a bill is useless is only the amount is shown. Therefore, we make sure to only display the bills with a number set. opw-1950846 closes odoo/odoo#31863 Signed-off-by: Nicolas Martinelli (nim) --- addons/purchase/report/purchase_bill.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/purchase/report/purchase_bill.py b/addons/purchase/report/purchase_bill.py index a16ff44b60c..036309e8e29 100644 --- a/addons/purchase/report/purchase_bill.py +++ b/addons/purchase/report/purchase_bill.py @@ -30,7 +30,7 @@ class PurchaseBillUnion(models.Model): id as vendor_bill_id, NULL as purchase_order_id FROM account_invoice WHERE - type='in_invoice' and state in ('open','in_payment','paid','cancel') + type='in_invoice' and COALESCE(number, '') != '' UNION SELECT -id, name, partner_ref, partner_id, date_order::date as date, amount_untaxed as amount, currency_id, company_id,