summaryrefslogtreecommitdiff
path: root/addons/pos_cache
diff options
context:
space:
mode:
authorAdrien Widart <awt@odoo.com>2021-01-12 08:52:15 +0000
committerAdrien Widart <awt@odoo.com>2021-01-12 09:10:03 +0000
commitcc2bd6717df379e87c9dfc485aa51f8dd33f6b76 (patch)
treeb0537c87470928bd527676f77ea87d54bec2b4ce /addons/pos_cache
parent802ee59a8d458ffb85455c547ceb89c185a5fb64 (diff)
[FIX] pos_cache: add pos to product
When adding a product to the order, the total will be updated but the orderline will not be displayed To reproduce the error: 1. Go to Point Of Sale 2. New Session 3. Click on a product so it will be added to the order Err: The order's total is correctly updated but the line is not displayed. When displaying an orderline, the system wants to use the product's unit name (`t-esc="props.line.get_unit().name"`). To do so, it uses one specific variable of the current product, `pos`: https://github.com/odoo/odoo/blob/abff1ca94bcc829250b63fd9677890988b796819/addons/point_of_sale/static/src/js/models.js#L1518-L1528 When using the standard Point of Sale, this variable is added on products loading (L446) : https://github.com/odoo/odoo/blob/abff1ca94bcc829250b63fd9677890988b796819/addons/point_of_sale/static/src/js/models.js#L438-L448 However, this variable is not set when using the pos_cache module. OPW-2431221 closes odoo/odoo#64380 Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Diffstat (limited to 'addons/pos_cache')
-rw-r--r--addons/pos_cache/static/src/js/pos_cache.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/addons/pos_cache/static/src/js/pos_cache.js b/addons/pos_cache/static/src/js/pos_cache.js
index 9f6bf6961ea..4f840082fb1 100644
--- a/addons/pos_cache/static/src/js/pos_cache.js
+++ b/addons/pos_cache/static/src/js/pos_cache.js
@@ -40,6 +40,7 @@ models.PosModel = models.PosModel.extend({
return records.then(function (products) {
self.db.add_products(_.map(products, function (product) {
product.categ = _.findWhere(self.product_categories, {'id': product.categ_id[0]});
+ product.pos = self;
return new models.Product({}, product);
}));
});