diff --git a/addons/product/models/product_pricelist.py b/addons/product/models/product_pricelist.py index fab35f27692..bd9b97f20e3 100644 --- a/addons/product/models/product_pricelist.py +++ b/addons/product/models/product_pricelist.py @@ -103,7 +103,7 @@ class Pricelist(models.Model): """ Low-level method - Mono pricelist, multi products Returns: dict{product_id: (price, suitable_rule) for the given pricelist} - If date in context: Date of the pricelist (%Y-%m-%d) + Date in context can be a date, datetime, ... :param products_qty_partner: list of typles products, quantity, partner :param datetime date: validity date @@ -111,8 +111,8 @@ class Pricelist(models.Model): """ self.ensure_one() if not date: - date = self._context.get('date') or fields.Date.context_today(self) - date = fields.Date.to_date(date) # handwritten query below does not work with non-dates (e.g. datetimes) + date = self._context.get('date') or fields.Date.today() + date = fields.Date.to_date(date) # boundary conditions differ if we have a datetime if not uom_id and self._context.get('uom'): uom_id = self._context['uom'] if uom_id: