From 22ab5036d6c987c615ec27a3f714d6d84d9ab207 Mon Sep 17 00:00:00 2001 From: Joren Van Onder Date: Mon, 17 Apr 2017 15:47:23 -0700 Subject: [PATCH] [FIX] point_of_sale: apply domain and fields for search_read Before this all domains in the POS were ignored. Introduced by e5740270568404d71a3bc093074a085c9c2eded8. When the specified method is search_read buildQuery rewrites args using the domain and fields properties. This ensures that in that case they are set. --- addons/point_of_sale/static/src/js/models.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js index f5c995a612e..20e0b1a0129 100644 --- a/addons/point_of_sale/static/src/js/models.js +++ b/addons/point_of_sale/static/src/js/models.js @@ -497,17 +497,21 @@ exports.PosModel = Backbone.Model.extend({ progress += progress_step; if( model.model ){ - var method = model.ids ? 'read' : 'search_read'; - var args = model.ids ? [ids, fields] : [domain, fields]; var params = { model: model.model, - method: method, - args: args, context: context, }; - if (method === 'search_read') { + + if (model.ids) { + params.method = 'read'; + params.args = [ids, fields]; + } else { + params.method = 'search_read'; + params.domain = domain; + params.fields = fields; params.orderBy = order; } + rpc.query(params).then(function(result){ try{ // catching exceptions in model.loaded(...) $.when(model.loaded(self,result,tmp))