diff options
| author | Martin Trigaux <mat@odoo.com> | 2019-07-12 13:09:45 +0000 |
|---|---|---|
| committer | Martin Trigaux <mat@odoo.com> | 2019-07-12 13:59:35 +0000 |
| commit | 1f5a4649a67908ecb6acfec37673c8149de0471f (patch) | |
| tree | 2a8ac12942b2e6227459a236309054982a01158f /addons/pos_cache | |
| parent | 6532b8716520d8cddc23a1e42c5c602b0c9c3c88 (diff) | |
| parent | 87fc1554d6a1823ac9061aab089adfd052190d21 (diff) | |
[MERGE] Forward port of saas-12.3 to saas-12.4 up to 87fc1554d6a1823
closes odoo/odoo#34820
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Diffstat (limited to 'addons/pos_cache')
| -rw-r--r-- | addons/pos_cache/static/src/js/pos_cache.js | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/addons/pos_cache/static/src/js/pos_cache.js b/addons/pos_cache/static/src/js/pos_cache.js index 6a26143cc6e..1b59761bc26 100644 --- a/addons/pos_cache/static/src/js/pos_cache.js +++ b/addons/pos_cache/static/src/js/pos_cache.js @@ -15,22 +15,21 @@ models.PosModel = models.PosModel.extend({ return model.model === "product.product"; }); - // Give both the fields and domain to pos_cache in the - // backend. This way we don't have to hardcode these - // values in the backend and they automatically stay in - // sync with whatever is defined (and maybe extended by - // other modules) in js. - var product_model = this.models[product_index]; - var product_fields = product_model.fields; - var product_domain = product_model.domain; + var product_model = self.models[product_index]; // We don't want to load product.product the normal // uncached way, so get rid of it. if (product_index !== -1) { this.models.splice(product_index, 1); } - return posmodel_super.load_server_data.apply(this, arguments).then(function () { + // Give both the fields and domain to pos_cache in the + // backend. This way we don't have to hardcode these + // 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 records = rpc.query({ model: 'pos.config', method: 'get_products_from_cache', |
