diff options
| author | Géry Debongnie <ged@odoo.com> | 2017-03-20 15:23:19 +0100 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2017-04-11 19:44:38 +0200 |
| commit | 2106e3dd2ecd61096d7c7531c2f18b00fb30aeea (patch) | |
| tree | 1e41a2e698ba993d9d74b6fddd699adb15642001 /addons/pos_cache/static/src | |
| parent | 749d10e8b55dce94828290d7e4d6b2b6f741e9bd (diff) | |
[REF] web, *: simplify our RPC system (in JS)
The RPC system was not completely satisfactory, we decided to prepare
the future and do it properly. This commit introduces the new rpc
system, which replace the previous new one. We now simply have a
method, this._rpc, which takes a dictionary of parameters. The idea is
that depending on the parameters, it is able to add correct default
value when necessary.
For situations where we don't have the this._rpc method, we can use the
rpc.query method, which takes the same arguments, but directly calls
ajax.rpc instead of triggering up some events.
Diffstat (limited to 'addons/pos_cache/static/src')
| -rw-r--r-- | addons/pos_cache/static/src/js/pos_cache.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/addons/pos_cache/static/src/js/pos_cache.js b/addons/pos_cache/static/src/js/pos_cache.js index 6598ab9a8c2..705bd1e66fb 100644 --- a/addons/pos_cache/static/src/js/pos_cache.js +++ b/addons/pos_cache/static/src/js/pos_cache.js @@ -31,9 +31,11 @@ models.PosModel = models.PosModel.extend({ } return posmodel_super.load_server_data.apply(this, arguments).then(function () { - var records = rpc.query({model: 'pos.config', method: 'get_products_from_cache'}) - .args([self.pos_session.config_id[0], product_fields, product_domain]) - .exec({type: "ajax"}); + var records = rpc.query({ + model: 'pos.config', + method: 'get_products_from_cache', + 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); |
