[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
This commit is contained in:
Christophe Matthieu
2017-07-12 13:39:29 +02:00
parent 566968bf99
commit e6e17cc5d6
+1 -1
View File
@@ -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: