|
@ -15,17 +15,32 @@ |
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
*****************************************************************************/ |
|
|
*****************************************************************************/ |
|
|
|
|
|
|
|
|
openerp.pos_order_load = function(instance, local) { |
|
|
|
|
|
module = instance.point_of_sale; |
|
|
|
|
|
var QWeb = instance.web.qweb; |
|
|
|
|
|
var _t = instance.web._t; |
|
|
|
|
|
var round_pr = instance.web.round_precision; |
|
|
|
|
|
|
|
|
odoo.define('pos_order_load', function (require) { |
|
|
|
|
|
"use strict"; |
|
|
|
|
|
|
|
|
|
|
|
var PosBaseWidget = require('point_of_sale.BaseWidget'); |
|
|
|
|
|
var chrome = require('point_of_sale.chrome'); |
|
|
|
|
|
var gui = require('point_of_sale.gui'); |
|
|
|
|
|
var models = require('point_of_sale.models'); |
|
|
|
|
|
var screens = require('point_of_sale.screens'); |
|
|
|
|
|
var Model = require('web.DataModel'); |
|
|
|
|
|
|
|
|
|
|
|
var utils = require('web.utils'); |
|
|
|
|
|
var round_pr = utils.round_precision; |
|
|
|
|
|
|
|
|
|
|
|
var core = require('web.core'); |
|
|
|
|
|
var QWeb = core.qweb; |
|
|
|
|
|
var _t = core._t; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/************************************************************************* |
|
|
/************************************************************************* |
|
|
Extend Model Order: |
|
|
Extend Model Order: |
|
|
* Add getter and setter function for field 'order_id'; |
|
|
|
|
|
*/ |
|
|
|
|
|
module.Order = module.Order.extend({ |
|
|
|
|
|
|
|
|
* Add getter and setter function for field 'order_id'; |
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
var _super_order = models.Order.prototype; |
|
|
|
|
|
models.Order = models.Order.extend({ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
set_order_id: function(id) { |
|
|
set_order_id: function(id) { |
|
|
this.set({ |
|
|
this.set({ |
|
@ -41,33 +56,32 @@ openerp.pos_order_load = function(instance, local) { |
|
|
|
|
|
|
|
|
/************************************************************************* |
|
|
/************************************************************************* |
|
|
New Widget LoadButtonWidget: |
|
|
New Widget LoadButtonWidget: |
|
|
* On click, display a new screen to select draft orders; |
|
|
|
|
|
*/ |
|
|
|
|
|
module.LoadButtonWidget = module.PosBaseWidget.extend({ |
|
|
|
|
|
|
|
|
* On click, display a new screen to select draft orders; |
|
|
|
|
|
*/ |
|
|
|
|
|
var LoadButtonWidget = PosBaseWidget.extend({ |
|
|
template: 'LoadButtonWidget', |
|
|
template: 'LoadButtonWidget', |
|
|
|
|
|
|
|
|
renderElement: function() { |
|
|
renderElement: function() { |
|
|
var self = this; |
|
|
var self = this; |
|
|
this._super(); |
|
|
this._super(); |
|
|
this.$el.click(function(){ |
|
|
this.$el.click(function(){ |
|
|
var ss = self.pos.pos_widget.screen_selector; |
|
|
|
|
|
ss.set_current_screen('orderlist'); |
|
|
|
|
|
|
|
|
self.gui.show_screen('orderlist'); |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
/************************************************************************* |
|
|
/************************************************************************* |
|
|
New Widget SaveButtonWidget: |
|
|
New Widget SaveButtonWidget: |
|
|
* On click, save the current draft order; |
|
|
|
|
|
*/ |
|
|
|
|
|
module.SaveButtonWidget = module.PosBaseWidget.extend({ |
|
|
|
|
|
|
|
|
* On click, save the current draft order; |
|
|
|
|
|
*/ |
|
|
|
|
|
var SaveButtonWidget = PosBaseWidget.extend({ |
|
|
template: 'SaveButtonWidget', |
|
|
template: 'SaveButtonWidget', |
|
|
|
|
|
|
|
|
renderElement: function() { |
|
|
renderElement: function() { |
|
|
var self = this; |
|
|
var self = this; |
|
|
this._super(); |
|
|
this._super(); |
|
|
this.$el.click(function(){ |
|
|
this.$el.click(function(){ |
|
|
self.pos.pos_widget.screen_selector.show_popup('confirm',{ |
|
|
|
|
|
|
|
|
self.gui.show_popup('confirm',{ |
|
|
message: _t('Save The current Order ?'), |
|
|
message: _t('Save The current Order ?'), |
|
|
comment: _t('This operation will save the current order in a draft state. You\'ll have to mark it as paid after.'), |
|
|
comment: _t('This operation will save the current order in a draft state. You\'ll have to mark it as paid after.'), |
|
|
confirm: function(){ |
|
|
confirm: function(){ |
|
@ -83,57 +97,52 @@ openerp.pos_order_load = function(instance, local) { |
|
|
|
|
|
|
|
|
/************************************************************************* |
|
|
/************************************************************************* |
|
|
Extend PosWidget: |
|
|
Extend PosWidget: |
|
|
* Create new screen; |
|
|
|
|
|
* Add load and save button; |
|
|
|
|
|
*/ |
|
|
|
|
|
module.PosWidget = module.PosWidget.extend({ |
|
|
|
|
|
|
|
|
* Create new screen; |
|
|
|
|
|
* Add load and save button; |
|
|
|
|
|
*/ |
|
|
|
|
|
chrome.Chrome.include({ |
|
|
build_widgets: function() { |
|
|
build_widgets: function() { |
|
|
this._super(); |
|
|
this._super(); |
|
|
|
|
|
|
|
|
// New Screen to select Draft Orders
|
|
|
|
|
|
this.orderlist_screen = new module.OrderListScreenWidget(this, {}); |
|
|
|
|
|
this.orderlist_screen.appendTo(this.$('.screens')); |
|
|
|
|
|
this.orderlist_screen.hide(); |
|
|
|
|
|
|
|
|
this.load_button = new LoadButtonWidget(this, {}); |
|
|
|
|
|
this.load_button.appendTo(this.$('div.order-empty')); |
|
|
|
|
|
|
|
|
this.screen_selector.screen_set.orderlist = this.orderlist_screen; |
|
|
|
|
|
|
|
|
|
|
|
// Add buttons
|
|
|
|
|
|
this.load_button = new module.LoadButtonWidget(this,{}); |
|
|
|
|
|
this.load_button.appendTo(this.pos_widget.$('li.orderline.empty')); |
|
|
|
|
|
|
|
|
|
|
|
this.save_button = new module.SaveButtonWidget(this,{}); |
|
|
|
|
|
|
|
|
this.save_button = new SaveButtonWidget(this, {}); |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/************************************************************************* |
|
|
/************************************************************************* |
|
|
Extend OrderWidget: |
|
|
|
|
|
*/ |
|
|
|
|
|
module.OrderWidget = module.OrderWidget.extend({ |
|
|
|
|
|
|
|
|
* Extend OrderWidget: |
|
|
|
|
|
*/ |
|
|
|
|
|
screens.OrderWidget.include({ |
|
|
renderElement: function(scrollbottom){ |
|
|
renderElement: function(scrollbottom){ |
|
|
this._super(scrollbottom); |
|
|
this._super(scrollbottom); |
|
|
if (this.pos_widget.load_button) { |
|
|
|
|
|
this.pos_widget.load_button.appendTo( |
|
|
|
|
|
this.pos_widget.$('li.orderline.empty') |
|
|
|
|
|
|
|
|
if (this.chrome.load_button) { |
|
|
|
|
|
this.chrome.load_button.appendTo( |
|
|
|
|
|
this.chrome.$('div.order-empty') |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
if (this.pos_widget.save_button && (this.pos.get('selectedOrder').get('orderLines').length > 0)) { |
|
|
|
|
|
this.pos_widget.save_button.appendTo( |
|
|
|
|
|
this.pos_widget.$('div.summary') |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
if (this.pos.get_order()) { |
|
|
|
|
|
if (this.chrome.save_button && (this.pos.get_order().get_orderlines().length > 0)) { |
|
|
|
|
|
this.chrome.save_button.appendTo( |
|
|
|
|
|
this.chrome.$('div.summary') |
|
|
|
|
|
); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
/************************************************************************* |
|
|
/************************************************************************* |
|
|
New ScreenWidget OrderListScreenWidget: |
|
|
|
|
|
* On show, display all draft orders; |
|
|
|
|
|
* on click on an order, display the content; |
|
|
|
|
|
* on click on 'validate', allow to use this POS Order; |
|
|
|
|
|
* on click on 'cancel', display the preview screen; |
|
|
|
|
|
*/ |
|
|
|
|
|
module.OrderListScreenWidget = module.ScreenWidget.extend({ |
|
|
|
|
|
|
|
|
* New ScreenWidget OrderListScreenWidget: |
|
|
|
|
|
* On show, display all draft orders; |
|
|
|
|
|
* on click on an order, display the content; |
|
|
|
|
|
* on click on 'validate', allow to use this POS Order; |
|
|
|
|
|
* on click on 'cancel', display the preview screen; |
|
|
|
|
|
*/ |
|
|
|
|
|
//
|
|
|
|
|
|
var OrderListScreenWidget = screens.ScreenWidget.extend({ |
|
|
template: 'OrderListScreenWidget', |
|
|
template: 'OrderListScreenWidget', |
|
|
show_leftpane: true, |
|
|
show_leftpane: true, |
|
|
model: 'pos.order', |
|
|
model: 'pos.order', |
|
@ -146,7 +155,7 @@ openerp.pos_order_load = function(instance, local) { |
|
|
reset_order: function(order) { |
|
|
reset_order: function(order) { |
|
|
order.set_client(undefined); |
|
|
order.set_client(undefined); |
|
|
order.set_order_id(undefined); |
|
|
order.set_order_id(undefined); |
|
|
order.get('orderLines').reset(); |
|
|
|
|
|
|
|
|
order.orderlines.reset(); |
|
|
return order; |
|
|
return order; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
@ -154,35 +163,33 @@ openerp.pos_order_load = function(instance, local) { |
|
|
var self = this; |
|
|
var self = this; |
|
|
this._super(); |
|
|
this._super(); |
|
|
this.$el.find('span.button.back').click(function(){ |
|
|
this.$el.find('span.button.back').click(function(){ |
|
|
order = self.pos.get('selectedOrder'); |
|
|
|
|
|
|
|
|
var order = self.pos.get('selectedOrder'); |
|
|
self.reset_order(order); |
|
|
self.reset_order(order); |
|
|
self.pos_widget.order_widget.change_selected_order(); |
|
|
|
|
|
var ss = self.pos.pos_widget.screen_selector; |
|
|
|
|
|
ss.set_current_screen('products'); |
|
|
|
|
|
|
|
|
self.chrome.screens.products.order_widget.change_selected_order(); |
|
|
|
|
|
self.gui.show_screen('products'); |
|
|
}); |
|
|
}); |
|
|
this.$el.find('span.button.validate').click(function(){ |
|
|
this.$el.find('span.button.validate').click(function(){ |
|
|
var orderModel = new instance.web.Model('pos.order'); |
|
|
|
|
|
|
|
|
var orderModel = new Model('pos.order'); |
|
|
return orderModel.call('unlink', [[self.current_order_id]]) |
|
|
return orderModel.call('unlink', [[self.current_order_id]]) |
|
|
.then(function (result) { |
|
|
|
|
|
var ss = self.pos.pos_widget.screen_selector; |
|
|
|
|
|
ss.set_current_screen('products'); |
|
|
|
|
|
}).fail(function (error, event){ |
|
|
|
|
|
if (parseInt(error.code) === 200) { |
|
|
|
|
|
// Business Logic Error, not a connection problem
|
|
|
|
|
|
self.pos_widget.screen_selector.show_popup( |
|
|
|
|
|
'error-traceback', { |
|
|
|
|
|
message: error.data.message, |
|
|
|
|
|
comment: error.data.debug |
|
|
|
|
|
|
|
|
.then(function (result) { |
|
|
|
|
|
self.gui.show_screen('products'); |
|
|
|
|
|
}).fail(function (error, event){ |
|
|
|
|
|
if (parseInt(error.code) === 200) { |
|
|
|
|
|
// Business Logic Error, not a connection problem
|
|
|
|
|
|
self.gui.show_popup( |
|
|
|
|
|
'error-traceback', { |
|
|
|
|
|
message: error.data.message, |
|
|
|
|
|
comment: error.data.debug |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
else{ |
|
|
|
|
|
self.gui.show_popup('error',{ |
|
|
|
|
|
message: _t('Connection error'), |
|
|
|
|
|
comment: _t('Can not load the Selected Order because the POS is currently offline'), |
|
|
}); |
|
|
}); |
|
|
} |
|
|
|
|
|
else{ |
|
|
|
|
|
self.pos_widget.screen_selector.show_popup('error',{ |
|
|
|
|
|
message: _t('Connection error'), |
|
|
|
|
|
comment: _t('Can not load the Selected Order because the POS is currently offline'), |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
event.preventDefault(); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
event.preventDefault(); |
|
|
|
|
|
}); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
var search_timeout = null; |
|
|
var search_timeout = null; |
|
@ -227,109 +234,110 @@ openerp.pos_order_load = function(instance, local) { |
|
|
|
|
|
|
|
|
load_order: function(order_id) { |
|
|
load_order: function(order_id) { |
|
|
var self = this; |
|
|
var self = this; |
|
|
var orderModel = new instance.web.Model(this.model); |
|
|
|
|
|
|
|
|
var orderModel = new Model(this.model); |
|
|
return orderModel.call('load_order', [order_id]) |
|
|
return orderModel.call('load_order', [order_id]) |
|
|
.then(function (result) { |
|
|
|
|
|
var order = self.pos.get('selectedOrder'); |
|
|
|
|
|
order = self.load_order_fields(order, result); |
|
|
|
|
|
order.get('orderLines').reset(); |
|
|
|
|
|
var orderlines = result.orderlines || []; |
|
|
|
|
|
var unknown_products = []; |
|
|
|
|
|
for (var i=0, len=orderlines.length; i<len; i++) { |
|
|
|
|
|
var orderline = orderlines[i]; |
|
|
|
|
|
var product_id = orderline.product_id[0]; |
|
|
|
|
|
var product_name = orderline.product_id[1]; |
|
|
|
|
|
var product = self.pos.db.get_product_by_id(product_id); |
|
|
|
|
|
if (_.isUndefined(product)) { |
|
|
|
|
|
unknown_products.push(product_name); |
|
|
|
|
|
continue; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
.then(function (result) { |
|
|
|
|
|
var order = self.pos.get('selectedOrder'); |
|
|
|
|
|
order = self.load_order_fields(order, result); |
|
|
|
|
|
order.orderlines.reset(); |
|
|
|
|
|
var orderlines = result.orderlines || []; |
|
|
|
|
|
var unknown_products = []; |
|
|
|
|
|
for (var i=0, len=orderlines.length; i<len; i++) { |
|
|
|
|
|
var orderline = orderlines[i]; |
|
|
|
|
|
var product_id = orderline.product_id[0]; |
|
|
|
|
|
var product_name = orderline.product_id[1]; |
|
|
|
|
|
var product = self.pos.db.get_product_by_id(product_id); |
|
|
|
|
|
if (_.isUndefined(product)) { |
|
|
|
|
|
unknown_products.push(product_name); |
|
|
|
|
|
continue; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
for (var key in orderline) { |
|
|
|
|
|
if (!key.indexOf('product__')) { |
|
|
|
|
|
product = self.add_product_attribute( |
|
|
|
|
|
|
|
|
for (var key in orderline) { |
|
|
|
|
|
if (!key.indexOf('product__')) { |
|
|
|
|
|
product = self.add_product_attribute( |
|
|
product, key, orderline |
|
|
product, key, orderline |
|
|
); |
|
|
|
|
|
|
|
|
); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
order.addProduct(product, |
|
|
|
|
|
self.prepare_orderline_options(orderline) |
|
|
|
|
|
); |
|
|
|
|
|
last_orderline = order.getLastOrderline(); |
|
|
|
|
|
last_orderline = jQuery.extend(last_orderline, orderline); |
|
|
|
|
|
} |
|
|
|
|
|
// Forbid POS Order loading if some products are unknown
|
|
|
|
|
|
if (unknown_products.length > 0){ |
|
|
|
|
|
self.pos_widget.screen_selector.show_popup( |
|
|
|
|
|
'error-traceback', { |
|
|
|
|
|
message: _t('Unknown Products'), |
|
|
|
|
|
comment: _t('Unable to load some order lines because the ' + |
|
|
|
|
|
|
|
|
order.add_product(product, |
|
|
|
|
|
self.prepare_orderline_options(orderline) |
|
|
|
|
|
); |
|
|
|
|
|
var last_orderline = order.get_last_orderline(); |
|
|
|
|
|
last_orderline = jQuery.extend(last_orderline, orderline); |
|
|
|
|
|
} |
|
|
|
|
|
// Forbid POS Order loading if some products are unknown
|
|
|
|
|
|
if (unknown_products.length > 0){ |
|
|
|
|
|
self.gui.show_popup( |
|
|
|
|
|
'error-traceback', { |
|
|
|
|
|
message: _t('Unknown Products'), |
|
|
|
|
|
comment: _t('Unable to load some order lines because the ' + |
|
|
'products are not available in the POS cache.\n\n' + |
|
|
'products are not available in the POS cache.\n\n' + |
|
|
'Please check that lines :\n\n * ') + unknown_products.join("; \n *") |
|
|
'Please check that lines :\n\n * ') + unknown_products.join("; \n *") |
|
|
}); |
|
|
|
|
|
self.$el.find('span.button.validate').hide(); |
|
|
|
|
|
} |
|
|
|
|
|
else{ |
|
|
|
|
|
self.$el.find('span.button.validate').show(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
self.$el.find('span.button.validate').hide(); |
|
|
|
|
|
} |
|
|
|
|
|
else{ |
|
|
|
|
|
self.$el.find('span.button.validate').show(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
}).fail(function (error, event){ |
|
|
|
|
|
if (parseInt(error.code) === 200) { |
|
|
|
|
|
// Business Logic Error, not a connection problem
|
|
|
|
|
|
self.pos_widget.screen_selector.show_popup( |
|
|
|
|
|
'error-traceback', { |
|
|
|
|
|
message: error.data.message, |
|
|
|
|
|
comment: error.data.debug |
|
|
|
|
|
|
|
|
}).fail(function (error, event){ |
|
|
|
|
|
if (parseInt(error.code) === 200) { |
|
|
|
|
|
// Business Logic Error, not a connection problem
|
|
|
|
|
|
self.gui.show_popup( |
|
|
|
|
|
'error-traceback', { |
|
|
|
|
|
message: error.data.message, |
|
|
|
|
|
comment: error.data.debug |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
else{ |
|
|
|
|
|
self.gui.show_popup('error',{ |
|
|
|
|
|
message: _t('Connection error'), |
|
|
|
|
|
comment: _t('Can not execute this action because the POS is currently offline'), |
|
|
}); |
|
|
}); |
|
|
} |
|
|
|
|
|
else{ |
|
|
|
|
|
self.pos_widget.screen_selector.show_popup('error',{ |
|
|
|
|
|
message: _t('Connection error'), |
|
|
|
|
|
comment: _t('Can not execute this action because the POS is currently offline'), |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
event.preventDefault(); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
event.preventDefault(); |
|
|
|
|
|
}); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
load_orders: function(query) { |
|
|
load_orders: function(query) { |
|
|
var self = this; |
|
|
var self = this; |
|
|
var orderModel = new instance.web.Model(this.model); |
|
|
|
|
|
|
|
|
var orderModel = new Model(this.model); |
|
|
return orderModel.call('search_read_orders', [query || '']) |
|
|
return orderModel.call('search_read_orders', [query || '']) |
|
|
.then(function (result) { |
|
|
|
|
|
self.render_list(result); |
|
|
|
|
|
}).fail(function (error, event){ |
|
|
|
|
|
if (parseInt(error.code) === 200) { |
|
|
|
|
|
// Business Logic Error, not a connection problem
|
|
|
|
|
|
self.pos_widget.screen_selector.show_popup( |
|
|
|
|
|
'error-traceback', { |
|
|
|
|
|
message: error.data.message, |
|
|
|
|
|
comment: error.data.debug |
|
|
|
|
|
} |
|
|
|
|
|
); |
|
|
|
|
|
} |
|
|
|
|
|
else{ |
|
|
|
|
|
self.pos_widget.screen_selector.show_popup('error',{ |
|
|
|
|
|
message: _t('Connection error'), |
|
|
|
|
|
comment: _t('Can not execute this action because the POS is currently offline'), |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
event.preventDefault(); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
.then(function (result) { |
|
|
|
|
|
self.render_list(result); |
|
|
|
|
|
}).fail(function (error, event){ |
|
|
|
|
|
if (parseInt(error.code) === 200) { |
|
|
|
|
|
// Business Logic Error, not a connection problem
|
|
|
|
|
|
self.gui.show_popup( |
|
|
|
|
|
'error-traceback', { |
|
|
|
|
|
message: error.data.message, |
|
|
|
|
|
comment: error.data.debug |
|
|
|
|
|
} |
|
|
|
|
|
); |
|
|
|
|
|
} |
|
|
|
|
|
else{ |
|
|
|
|
|
self.gui.show_popup('error',{ |
|
|
|
|
|
message: _t('Connection error'), |
|
|
|
|
|
comment: _t('Can not execute this action because the POS is currently offline'), |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
event.preventDefault(); |
|
|
|
|
|
}); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
show: function() { |
|
|
show: function() { |
|
|
this._super(); |
|
|
this._super(); |
|
|
var ss = this.pos.pos_widget.screen_selector; |
|
|
|
|
|
if (ss.get_current_screen() == 'orderlist') { |
|
|
|
|
|
|
|
|
if (this.gui.get_current_screen() == 'orderlist') { |
|
|
this.load_orders(); |
|
|
this.load_orders(); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
on_click_draft_order: function(event){ |
|
|
on_click_draft_order: function(event){ |
|
|
|
|
|
this.$('.order-list .highlight').removeClass('highlight'); |
|
|
this.current_order_id = parseInt(event.target.parentNode.dataset.orderId); |
|
|
this.current_order_id = parseInt(event.target.parentNode.dataset.orderId); |
|
|
this.load_order(this.current_order_id); |
|
|
this.load_order(this.current_order_id); |
|
|
|
|
|
$(event.target.parentNode).addClass('highlight'); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
render_list: function(orders){ |
|
|
render_list: function(orders){ |
|
@ -359,5 +367,10 @@ openerp.pos_order_load = function(instance, local) { |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
gui.define_screen({'name': 'orderlist', 'widget': OrderListScreenWidget}); |
|
|
|
|
|
return { |
|
|
|
|
|
LoadButtonButton: LoadButtonWidget, |
|
|
|
|
|
SaveButtonButton: SaveButtonWidget, |
|
|
|
|
|
OrderListScreenWidget: OrderListScreenWidget, |
|
|
}; |
|
|
}; |
|
|
|
|
|
}); |