1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- function pos_customize_product_pack_widget(instance, module){
- var QWeb = instance.web.qweb;
- _t = instance.web._t;
- module.PosWidget.include({
- build_widgets: function() {
- var self = this;
- this._super();
- this.pack_popup = new module.PackPopUp(this,{});
- 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');
- });
- });
- }
- });
-
- module.PackPopUp = module.PopUpWidget.extend({
- template:'PackPopupWidget',
-
- start: function(){
- this._super();
- var self = this;
- this.floor_list_widget = new module.PackListScreenWidget(this,{});
- },
- show: function(){
- this._super();
- var self = this;
- this.floor_list_widget.replace($('.placeholder-PackListScreenWidget'));
- },
- });
- module.PackListScreenWidget = module.ScreenWidget.extend({
- template:'PackListScreenWidget',
- init: function(parent, options) {
- this._super(parent,options);
- },
- start: function() {
- this._super();
- var self = this;
- },
- renderElement: function() {
- this._super();
- var self = this;
- var pack_lines = this.pos.product_pack_lines || [];
- for(var i = 0; i < pack_lines.length; i++ ){
- var data = [];
- data.push({
- id:pack_lines[i].id,
- name:pack_lines[i].product_id[1],
- });
- data = data.shift();
- var product = new module.PackListWidget(this, {
- model_floor: data,
- });
- product.appendTo(this.$('.product_list'));
- }
- },
- }),
-
- module.PackListWidget = module.PosBaseWidget.extend({
- template: 'PackListWidget',
-
- init: function(parent, options){
- this._super(parent, options);
- this.model_floor = options.model_floor;
- },
- renderElement: function(){
- var self = this;
- this._super();
- }
- });
- };
|