Browse Source

[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.
pull/251/head
Jairo Llopis 7 years ago
parent
commit
783402965b
  1. 2
      pos_pricelist/__manifest__.py
  2. 4
      pos_pricelist/static/src/js/models.js

2
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, "

4
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;

Loading…
Cancel
Save