summaryrefslogtreecommitdiff
path: root/addons/pos_cache/static
diff options
context:
space:
mode:
authorIvan Yelizariev <iel@odoo.com>2020-12-07 12:35:49 +0000
committerIvan Yelizariev <iel@odoo.com>2020-12-07 14:12:51 +0000
commite669ea8a6a79fdf7e309b3191c9648c60179d195 (patch)
tree87ff0e7c62533ab228af75e7c1db3c12f1229ca3 /addons/pos_cache/static
parent61436e861eabada1608529f3f0da09681d09b3e8 (diff)
[FIX] pos_cache: make it compatible with onboarding tool
STEPS: * install pos_cache in clean database without demo * open pos * click OK on popup "Would you like to load demo data" closes odoo/odoo#62955 Before: error, products are not loaded even after refreshing After: no errors, products are loaded Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Diffstat (limited to 'addons/pos_cache/static')
-rw-r--r--addons/pos_cache/static/src/js/pos_cache.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/addons/pos_cache/static/src/js/pos_cache.js b/addons/pos_cache/static/src/js/pos_cache.js
index 44135607b15..9f6bf6961ea 100644
--- a/addons/pos_cache/static/src/js/pos_cache.js
+++ b/addons/pos_cache/static/src/js/pos_cache.js
@@ -21,6 +21,7 @@ models.PosModel = models.PosModel.extend({
// uncached way, so get rid of it.
if (product_index !== -1) {
this.models.splice(product_index, 1);
+ this.product_model = product_model;
}
return posmodel_super.load_server_data.apply(this, arguments).then(function () {
// Give both the fields and domain to pos_cache in the
@@ -28,8 +29,8 @@ models.PosModel = models.PosModel.extend({
// values in the backend and they automatically stay in
// sync with whatever is defined (and maybe extended by
// other modules) in js.
- var product_fields = typeof product_model.fields === 'function' ? product_model.fields(self) : product_model.fields;
- var product_domain = typeof product_model.domain === 'function' ? product_model.domain(self) : product_model.domain;
+ var product_fields = typeof self.product_model.fields === 'function' ? self.product_model.fields(self) : self.product_model.fields;
+ var product_domain = typeof self.product_model.domain === 'function' ? self.product_model.domain(self) : self.product_model.domain;
var records = rpc.query({
model: 'pos.config',
method: 'get_products_from_cache',