|
@@ -44,7 +44,6 @@ function pos_customize_product_pack_widget(instance, module){
|
|
|
var self = this;
|
|
|
this.product_list_widget.replace($('.placeholder-PackListScreenWidget'));
|
|
|
},
|
|
|
-
|
|
|
});
|
|
|
|
|
|
module.PackListScreenWidget = module.ScreenWidget.extend({
|
|
@@ -124,17 +123,40 @@ function pos_customize_product_pack_widget(instance, module){
|
|
|
if(product.description == false){
|
|
|
var ProductPackList = [];
|
|
|
ProductPackList.push({
|
|
|
+ order : selectedline.order.uid,
|
|
|
+ line_id : selectedline.id,
|
|
|
product_parent_id : product.id,
|
|
|
product_id : self.model_product.id,
|
|
|
- product_name : ' ■ Sin ' + self.model_product.name,
|
|
|
+ product_name : ' ■ Sin ---> ' + self.model_product.name,
|
|
|
});
|
|
|
}else{
|
|
|
+
|
|
|
+ // function eliminarObjetosDuplicados(arr, prop) {
|
|
|
+ // var nuevoArray = [];
|
|
|
+ // var lookup = {};
|
|
|
+
|
|
|
+ // for (var i in arr) {
|
|
|
+ // lookup[arr[i][prop]] = arr[i];
|
|
|
+ // }
|
|
|
+
|
|
|
+ // for (i in lookup) {
|
|
|
+ // nuevoArray.push(lookup[i]);
|
|
|
+ // }
|
|
|
+
|
|
|
+ // return nuevoArray;
|
|
|
+ // }
|
|
|
+
|
|
|
var ProductPackList = product.description;
|
|
|
ProductPackList.push({
|
|
|
+ order : selectedline.order.uid,
|
|
|
+ line_id : selectedline.id,
|
|
|
product_parent_id : product.id,
|
|
|
product_id : self.model_product.id,
|
|
|
- product_name : ' ■ Sin ' + self.model_product.name,
|
|
|
+ product_name : ' ■ Sin ---> ' + self.model_product.name,
|
|
|
});
|
|
|
+
|
|
|
+ // ProductPackList = eliminarObjetosDuplicados(ProductPackList, 'product_id');
|
|
|
+
|
|
|
}
|
|
|
product.description = ProductPackList;
|
|
|
self.pos_widget.screen_selector.set_current_screen('products');
|
|
@@ -146,7 +168,6 @@ function pos_customize_product_pack_widget(instance, module){
|
|
|
|
|
|
// **************************************************************************
|
|
|
|
|
|
- var OrderWidgetSuper = module.OrderWidget;
|
|
|
module.OrderWidget = module.PosBaseWidget.extend({
|
|
|
template:'OrderWidget',
|
|
|
init: function(parent, options) {
|
|
@@ -230,9 +251,7 @@ function pos_customize_product_pack_widget(instance, module){
|
|
|
},this);
|
|
|
},
|
|
|
render_orderline: function(orderline){
|
|
|
- console.log(orderline);
|
|
|
- var prueba = [{id:'algo',name:'algo1'}];
|
|
|
- var el_str = openerp.qweb.render('Orderline',{widget:this, line:orderline, list:prueba});
|
|
|
+ var el_str = openerp.qweb.render('Orderline',{widget:this, line:orderline});
|
|
|
var el_node = document.createElement('div');
|
|
|
el_node.innerHTML = _.str.trim(el_str);
|
|
|
el_node = el_node.childNodes[0];
|