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',