From 783402965b9d06391150296ebe777474fc23fb8e Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Wed, 28 Feb 2018 11:49:41 +0000 Subject: [PATCH] [FIX] pos_pricelist: Use lower-version date comparison The removed function was introduced in momentjs in version 2.11.0, but Odoo 10.0 ships 2.8.1, so I'm using a different comparison system here that should yield the same results without exceptions. --- pos_pricelist/__manifest__.py | 2 +- pos_pricelist/static/src/js/models.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pos_pricelist/__manifest__.py b/pos_pricelist/__manifest__.py index b21f2839..46865ed9 100644 --- a/pos_pricelist/__manifest__.py +++ b/pos_pricelist/__manifest__.py @@ -4,7 +4,7 @@ { 'name': 'POS Pricelist', - 'version': '10.0.1.0.0', + 'version': '10.0.1.0.1', 'category': 'Point Of Sale', 'author': "Tecnativa, " "Odoo SA, " diff --git a/pos_pricelist/static/src/js/models.js b/pos_pricelist/static/src/js/models.js index b64834da..e532455d 100644 --- a/pos_pricelist/static/src/js/models.js +++ b/pos_pricelist/static/src/js/models.js @@ -145,8 +145,8 @@ odoo.define("pos_pricelist.models", function (require) { return (! item.product_tmpl_id || item.product_tmpl_id[0] === self.product_tmpl_id) && (! item.product_id || item.product_id[0] === self.id) && (! item.categ_id || _.contains(category_ids, item.categ_id[0])) && - (! item.date_start || moment(item.date_start).isSameOrBefore(date)) && - (! item.date_end || moment(item.date_end).isSameOrAfter(date)); + (! item.date_start || moment(item.date_start) <= date) && + (! item.date_end || moment(item.date_end) >= date); }); var price = self.lst_price;