Browse Source

[IMP] The pricelist in the current pos.config is used as default instead of the sistem-wide default

pull/39/head
PabloCM 9 years ago
parent
commit
87891a63bf
  1. 6
      pos_pricelist/static/src/js/db.js
  2. 15
      pos_pricelist/static/src/js/models.js

6
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];

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

Loading…
Cancel
Save