From 97d439ae9cc3f900648357f86aa8a4f0284604d2 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Mon, 25 May 2020 12:26:16 +0000 Subject: [PATCH] [FIX] purchase: use fully qualified column named to avoid ambiguities closes odoo/odoo#51819 X-original-commit: c79dc7b24c5892c714ccb78cec808edbe0574ce6 Signed-off-by: Christophe Simonis --- addons/purchase/models/purchase.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/purchase/models/purchase.py b/addons/purchase/models/purchase.py index f6bcda77d18..5fbb236777e 100644 --- a/addons/purchase/models/purchase.py +++ b/addons/purchase/models/purchase.py @@ -602,8 +602,8 @@ class PurchaseOrder(models.Model): FROM purchase_order po JOIN res_company comp ON (po.company_id = comp.id) JOIN res_currency curr ON (comp.currency_id = curr.id) - WHERE state in ('purchase', 'done') - AND company_id = %s; + WHERE po.state in ('purchase', 'done') + AND po.company_id = %s """ self._cr.execute(query, (one_week_ago, self.env.company.id)) res = self.env.cr.fetchone()