[FIX] point_of_sale: get rid of support for barcodes on packagings

This was removed in the backend in
ffd76df007. The POS however still had some
leftover code that referenced it, causing ORM warnings.
This commit is contained in:
Joren Van Onder
2016-04-28 10:26:09 +02:00
parent 1b765ab1b7
commit 5dc6828631
2 changed files with 2 additions and 32 deletions
+2 -25
View File
@@ -39,9 +39,6 @@ var PosDB = core.Class.extend({
this.category_childs = {};
this.category_parent = {};
this.category_search_string = {};
this.packagings_by_id = {};
this.packagings_by_product_tmpl_id = {};
this.packagings_by_barcode = {};
},
/*
@@ -167,10 +164,6 @@ var PosDB = core.Class.extend({
if (product.description_sale) {
str += '|' + product.description_sale;
}
var packagings = this.packagings_by_product_tmpl_id[product.product_tmpl_id] || [];
for (var i = 0; i < packagings.length; i++) {
str += '|' + packagings[i].barcode;
}
str = product.id + ':' + str.replace(/:/g,'') + '\n';
return str;
},
@@ -215,19 +208,6 @@ var PosDB = core.Class.extend({
}
}
},
add_packagings: function(packagings){
for(var i = 0, len = packagings.length; i < len; i++){
var pack = packagings[i];
this.packagings_by_id[pack.id] = pack;
if(!this.packagings_by_product_tmpl_id[pack.product_tmpl_id[0]]){
this.packagings_by_product_tmpl_id[pack.product_tmpl_id[0]] = [];
}
this.packagings_by_product_tmpl_id[pack.product_tmpl_id[0]].push(pack);
if(pack.barcode){
this.packagings_by_barcode[pack.barcode] = pack;
}
}
},
_partner_search_string: function(partner){
var str = partner.name;
if(partner.barcode){
@@ -358,12 +338,9 @@ var PosDB = core.Class.extend({
get_product_by_barcode: function(barcode){
if(this.product_by_barcode[barcode]){
return this.product_by_barcode[barcode];
} else {
return undefined;
}
var pack = this.packagings_by_barcode[barcode];
if(pack){
return this.product_by_id[pack.product_tmpl_id[0]];
}
return undefined;
},
get_product_by_category: function(category_id){
var product_ids = this.product_by_category_id[category_id];
@@ -298,13 +298,6 @@ exports.PosModel = Backbone.Model.extend({
}
},
},{
model: 'product.packaging',
fields: ['barcode','product_tmpl_id'],
domain: null,
loaded: function(self, packagings){
self.db.add_packagings(packagings);
},
},{
model: 'pos.category',
fields: ['id','name','parent_id','child_id','image'],