Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] pos_order_mgmt:compatibility with pos_restaurant #339

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pos_order_mgmt/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
* David Vidal <david.vidal@tecnativa.com>
* Sylvain LE GAL (https://twitter.com/legalsylvain)
* Carlos Martínez <carlos@domatix.com>
* Pierrick Brun <pierrick.brun@akretion.com>
13 changes: 11 additions & 2 deletions pos_order_mgmt/static/src/js/widgets.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ odoo.define('pos_order_mgmt.widgets', function (require) {

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