[FIX] pos_cache: Adapt JS code to ac89783d2f.
Otherwise, when rendering the 'Product' template it crashes when calling the 'get_price' method. Indeed, we need to add products as a Product model instead of as a plain JS object.
This commit is contained in:
@@ -37,8 +37,11 @@ models.PosModel = models.PosModel.extend({
|
||||
args: [self.pos_session.config_id[0], product_fields, product_domain],
|
||||
});
|
||||
self.chrome.loading_message(_t('Loading') + ' product.product', 1);
|
||||
return records.then(function (product) {
|
||||
self.db.add_products(product);
|
||||
return records.then(function (products) {
|
||||
self.db.add_products(_.map(products, function (product) {
|
||||
product.categ = _.findWhere(self.product_categories, {'id': product.categ_id[0]});
|
||||
return new models.Product({}, product);
|
||||
}));
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user