From e6e17cc5d6483afbdd898248858933b85ac422d4 Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Wed, 12 Jul 2017 12:38:52 +0200 Subject: [PATCH] [FIX] product: Error message when adding an item to a quote When a user tries to add a product on an opportunity, the date_order of the order is added into the context. This value can be False. When "_compute_price_rule" is called without "date" arguments (some onchange, compute...) the method method use the context date (in this case the value is False) or the today date. The date value is used in an sql request and raise a value exception. opw-751700 --- addons/product/models/product_pricelist.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/product/models/product_pricelist.py b/addons/product/models/product_pricelist.py index abe09f05fd6..e6c402bc95a 100644 --- a/addons/product/models/product_pricelist.py +++ b/addons/product/models/product_pricelist.py @@ -106,7 +106,7 @@ class Pricelist(models.Model): """ self.ensure_one() if not date: - date = self._context.get('date', fields.Date.today()) + date = self._context.get('date') or fields.Date.today() if not uom_id and self._context.get('uom'): uom_id = self._context['uom'] if uom_id: