From 87891a63bf8e02d4b3a20e4a4c608bf094dbd9b8 Mon Sep 17 00:00:00 2001 From: PabloCM Date: Thu, 16 Jul 2015 14:19:10 +0200 Subject: [PATCH] [IMP] The pricelist in the current pos.config is used as default instead of the sistem-wide default --- pos_pricelist/static/src/js/db.js | 6 ------ pos_pricelist/static/src/js/models.js | 15 +-------------- 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/pos_pricelist/static/src/js/db.js b/pos_pricelist/static/src/js/db.js index fea397f4..d67950df 100644 --- a/pos_pricelist/static/src/js/db.js +++ b/pos_pricelist/static/src/js/db.js @@ -21,7 +21,6 @@ function pos_pricelist_db(instance, module) { init: function (options) { options = options || {}; this._super(options); - this.default_pricelist_id = 0; this.pricelist_by_id = {}; this.pricelist_version_by_id = {}; this.pricelist_item_by_id = {}; @@ -63,11 +62,6 @@ function pos_pricelist_db(instance, module) { this.supplierinfo_by_id[supplier_info.id] = supplier_info; } }, - add_default_pricelist: function (res_id) { - if (res_id && res_id.length) { - this.default_pricelist_id = res_id[0].res_id; - } - }, add_pricelists: function (pricelists) { if (!(pricelists instanceof Array)) { pricelists = [pricelists]; diff --git a/pos_pricelist/static/src/js/models.js b/pos_pricelist/static/src/js/models.js index 3036669e..f6ff413b 100644 --- a/pos_pricelist/static/src/js/models.js +++ b/pos_pricelist/static/src/js/models.js @@ -338,7 +338,7 @@ function pos_pricelist_models(instance, module) { if (partner && partner.property_product_pricelist) { price_list_id = partner.property_product_pricelist[0]; } else { - price_list_id = db.default_pricelist_id; + price_list_id = this.pos.config.pricelist_id[0]; } return this.compute_price( db, product, partner, qty, parseInt(price_list_id) @@ -698,19 +698,6 @@ function pos_pricelist_models(instance, module) { } }, - { - model: 'ir.model.data', - fields: ['res_id'], - domain: function () { - return [ - ['module', '=', 'product'], - ['name', '=', 'property_product_pricelist'] - ] - }, - loaded: function (self, res) { - self.db.add_default_pricelist(res); - } - }, { model: 'product.pricelist', fields: ['display_name',