|
@@ -10,22 +10,25 @@ function pos_customize_product_pack_widget(instance, module){
|
|
|
this.pack_popup.appendTo(this.$el);
|
|
|
this.pack_popup.hide();
|
|
|
this.screen_selector.popup_set['PackList'] = this.pack_popup;
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- module.ClientListScreenWidget.include({
|
|
|
- show: function(){
|
|
|
- var self = this;
|
|
|
- this._super();
|
|
|
|
|
|
- this.$('.select-table').click(function(){
|
|
|
- self.pos_widget.screen_selector.show_popup('PackList');
|
|
|
- $('#floor-cancel').click(function(){
|
|
|
- self.pos_widget.screen_selector.set_current_screen('clientlist');
|
|
|
- });
|
|
|
- });
|
|
|
+ var kitchen_ticket_button = $(QWeb.render('PackModalButton'));
|
|
|
+ kitchen_ticket_button.appendTo(this.$('.control-buttons'));
|
|
|
+ this.$('.control-buttons').removeClass('oe_hidden');
|
|
|
+
|
|
|
+ this.$('.order-pack-modal').click(function(){
|
|
|
+ var check = self.pos.get('selectedOrder').selected_orderline;
|
|
|
+ if(check != undefined){
|
|
|
+ if(check.product.pack_line_ids.length > 0){
|
|
|
+ self.pos_widget.screen_selector.show_popup('PackList');
|
|
|
+ $('#floor-cancel').click(function(){
|
|
|
+ self.pos_widget.screen_selector.set_current_screen('products');
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ });
|
|
|
}
|
|
|
- });
|
|
|
+ });
|
|
|
|
|
|
module.PackPopUp = module.PopUpWidget.extend({
|
|
|
template:'PackPopupWidget',
|
|
@@ -38,8 +41,8 @@ function pos_customize_product_pack_widget(instance, module){
|
|
|
|
|
|
show: function(){
|
|
|
this._super();
|
|
|
- var self = this;
|
|
|
- this.floor_list_widget.replace($('.placeholder-PackListScreenWidget'));
|
|
|
+ var self = this;
|
|
|
+ this.floor_list_widget.replace($('.placeholder-PackListScreenWidget'));
|
|
|
},
|
|
|
|
|
|
});
|
|
@@ -59,17 +62,32 @@ function pos_customize_product_pack_widget(instance, module){
|
|
|
renderElement: function() {
|
|
|
this._super();
|
|
|
var self = this;
|
|
|
+
|
|
|
+ var product = self.pos.get('selectedOrder').selected_orderline.product;
|
|
|
+
|
|
|
+ var product_pack = product.pack_line_ids;
|
|
|
+
|
|
|
var pack_lines = this.pos.product_pack_lines || [];
|
|
|
- for(var i = 0; i < pack_lines.length; i++ ){
|
|
|
+
|
|
|
+ for(var i = 0; i < product_pack.length; i++ ){
|
|
|
+
|
|
|
+ var product = _.filter(pack_lines,function (inv) {
|
|
|
+ return inv.id === product_pack[i];
|
|
|
+ });
|
|
|
+
|
|
|
var data = [];
|
|
|
+
|
|
|
data.push({
|
|
|
- id:pack_lines[i].id,
|
|
|
- name:pack_lines[i].product_id[1],
|
|
|
+ id: product[0].id,
|
|
|
+ name: product[0].product_id[1],
|
|
|
});
|
|
|
+
|
|
|
data = data.shift();
|
|
|
+
|
|
|
var product = new module.PackListWidget(this, {
|
|
|
model_floor: data,
|
|
|
});
|
|
|
+
|
|
|
product.appendTo(this.$('.product_list'));
|
|
|
}
|
|
|
},
|