|
@ -63,7 +63,10 @@ odoo.define('pos_order_mgmt.widgets', function (require) { |
|
|
|
|
|
|
|
|
show: function () { |
|
|
show: function () { |
|
|
var self = this; |
|
|
var self = this; |
|
|
var previous_screen = this.pos.get_order().get_screen_data('previous-screen'); |
|
|
|
|
|
|
|
|
var previous_screen; |
|
|
|
|
|
if (this.pos.get_order()) { |
|
|
|
|
|
previous_screen = this.pos.get_order().get_screen_data('previous-screen'); |
|
|
|
|
|
} |
|
|
if (previous_screen === 'receipt') { |
|
|
if (previous_screen === 'receipt') { |
|
|
this.gui.screen_instances.receipt.click_next(); |
|
|
this.gui.screen_instances.receipt.click_next(); |
|
|
this.gui.show_screen('orderlist'); |
|
|
this.gui.show_screen('orderlist'); |
|
@ -72,7 +75,11 @@ odoo.define('pos_order_mgmt.widgets', function (require) { |
|
|
this.renderElement(); |
|
|
this.renderElement(); |
|
|
this.old_order = this.pos.get_order(); |
|
|
this.old_order = this.pos.get_order(); |
|
|
this.$('.back').click(function () { |
|
|
this.$('.back').click(function () { |
|
|
|
|
|
if (self.old_order !== null) { |
|
|
|
|
|
self.gui.back(); |
|
|
|
|
|
} else { |
|
|
return self.gui.show_screen(self.gui.startup_screen); |
|
|
return self.gui.show_screen(self.gui.startup_screen); |
|
|
|
|
|
} |
|
|
}); |
|
|
}); |
|
|
if (self.orders.length === 0) { |
|
|
if (self.orders.length === 0) { |
|
|
this.search_done_orders(); |
|
|
this.search_done_orders(); |
|
@ -267,7 +274,9 @@ odoo.define('pos_order_mgmt.widgets', function (require) { |
|
|
method: 'load_done_order_for_pos', |
|
|
method: 'load_done_order_for_pos', |
|
|
args: [order_id], |
|
|
args: [order_id], |
|
|
}).then(function (order_data) { |
|
|
}).then(function (order_data) { |
|
|
self.gui.back(); |
|
|
|
|
|
|
|
|
if (self.old_order !== null) { |
|
|
|
|
|
self.gui.back(); |
|
|
|
|
|
} |
|
|
var correct_order_print = true; |
|
|
var correct_order_print = true; |
|
|
if (action === 'return') { |
|
|
if (action === 'return') { |
|
|
order_data.return = true; |
|
|
order_data.return = true; |
|
|