diff --git a/pos_order_merge/__manifest__.py b/pos_order_merge/__manifest__.py index 31f15e7f88..5cf509ca4c 100644 --- a/pos_order_merge/__manifest__.py +++ b/pos_order_merge/__manifest__.py @@ -19,5 +19,5 @@ "post_init_hook": None, "uninstall_hook": None, "auto_install": False, - "installable": False, + "installable": True, } diff --git a/pos_order_merge/doc/index.rst b/pos_order_merge/doc/index.rst index 24306ecf22..89f6e90805 100644 --- a/pos_order_merge/doc/index.rst +++ b/pos_order_merge/doc/index.rst @@ -14,7 +14,7 @@ Configuration * Open POS configuration form * Click on ``[Edit]`` - * Check **[x] Order Merge** box under ``Bar & Restaurant`` section + * Check **[x] Order Merge** box under ``Order Interface`` section Usage ===== diff --git a/pos_order_merge/static/src/img/svg/floor.svg b/pos_order_merge/static/src/img/svg/floor.svg index 8f64e6df5c..26366b17a3 100644 --- a/pos_order_merge/static/src/img/svg/floor.svg +++ b/pos_order_merge/static/src/img/svg/floor.svg @@ -1,36 +1,67 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pos_order_merge/static/src/img/svg/table.svg b/pos_order_merge/static/src/img/svg/table.svg index b502ca3298..b6f58c4f10 100644 --- a/pos_order_merge/static/src/img/svg/table.svg +++ b/pos_order_merge/static/src/img/svg/table.svg @@ -1,37 +1,67 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pos_order_merge/static/src/js/merge.js b/pos_order_merge/static/src/js/merge.js index 938b3849a8..ead5446a4f 100644 --- a/pos_order_merge/static/src/js/merge.js +++ b/pos_order_merge/static/src/js/merge.js @@ -1,4 +1,4 @@ -odoo.define("pos_order_merge.merge", function(require) { +odoo.define("pos_order_merge.merge", function (require) { "use strict"; var gui = require("point_of_sale.gui"); @@ -11,12 +11,12 @@ odoo.define("pos_order_merge.merge", function(require) { var _super_posmodel = models.PosModel.prototype; models.PosModel = models.PosModel.extend({ - order_merge: function() { + order_merge: function () { this.order_merge_status = true; this.set_table(null); }, // Changes the current table. - set_table: function(table) { + set_table: function (table) { if (!table) { // No table ? go back to the floor plan, see ScreenSelector this.set_order(null); @@ -36,7 +36,7 @@ odoo.define("pos_order_merge.merge", function(require) { } }, // This is called when an order is removed from the order collection. - on_removed_order: function(removed_order, index, reason) { + on_removed_order: function (removed_order, index, reason) { if (this.order_merge_status) { return; } @@ -49,7 +49,7 @@ odoo.define("pos_order_merge.merge", function(require) { previous_screen: "floors", - renderElement: function() { + renderElement: function () { var self = this; this._super(); @@ -73,12 +73,12 @@ odoo.define("pos_order_merge.merge", function(require) { } // Change the table for merge - this.$(".change_table").click(function() { + this.$(".change_table").click(function () { self.gui.show_screen(self.previous_screen); }); // Back to current order - this.$(".back").click(function() { + this.$(".back").click(function () { self.pos.order_merge_status = false; var current_order = self.get_order_by_uid(self.pos.main_order_uid); if (current_order) { @@ -87,13 +87,13 @@ odoo.define("pos_order_merge.merge", function(require) { } }); }, - order_was_selected: function(uid) { - var res = _.find(this.mergeorders, function(id) { + order_was_selected: function (uid) { + var res = _.find(this.mergeorders, function (id) { return id === uid; }); return res || false; }, - orderselect: function($el, uid) { + orderselect: function ($el, uid) { var merge = this.order_was_selected(uid); var selected = true; if (merge) { @@ -117,7 +117,7 @@ odoo.define("pos_order_merge.merge", function(require) { ); this.change_button(); }, - show: function() { + show: function () { var self = this; this._super(); this.renderElement(); @@ -128,7 +128,7 @@ odoo.define("pos_order_merge.merge", function(require) { $mergemethods.children().hide(); var $merge_buttons = $mergemethods.find(".button"); - this.$(".merge-orders").on("click", ".order", function() { + this.$(".merge-orders").on("click", ".order", function () { var uid = $(this).data("uid"); var $el = $(this); self.orderselect($el, uid); @@ -139,22 +139,22 @@ odoo.define("pos_order_merge.merge", function(require) { } }); - $merge_buttons.click(function() { + $merge_buttons.click(function () { self.merge(); }); }, - merge: function() { + merge: function () { var self = this; var main_order = this.get_order_by_uid(this.pos.main_order_uid); this.gui.show_screen("products"); this.pos.set_order(main_order); - this.mergeorders.forEach(function(uid) { + this.mergeorders.forEach(function (uid) { var order = self.get_order_by_uid(uid); var orderlines = order.get_orderlines(); if (orderlines && orderlines.length) { - orderlines.forEach(function(line) { + orderlines.forEach(function (line) { var temp_line = line.export_as_JSON(); main_order.add_orderline( new models.Orderline( @@ -171,7 +171,7 @@ odoo.define("pos_order_merge.merge", function(require) { this.pos.order_merge_status = false; }, - get_order_by_uid: function(uid) { + get_order_by_uid: function (uid) { var orders = this.pos.get("orders").models; for (var i = 0; i < orders.length; i++) { if (orders[i].uid === uid) { @@ -180,7 +180,7 @@ odoo.define("pos_order_merge.merge", function(require) { } return false; }, - change_button: function() { + change_button: function () { if (this.mergeorders.length) { this.$(".mergemethods .button").addClass("highlight"); } else { @@ -192,14 +192,14 @@ odoo.define("pos_order_merge.merge", function(require) { gui.define_screen({ name: "order_merge", widget: OrderMergeScreenWidget, - condition: function() { + condition: function () { return this.pos.config.iface_order_merge; }, }); var OrderMergeButton = screens.ActionButtonWidget.extend({ template: "OrderMergeButton", - button_click: function() { + button_click: function () { if (this.pos.get("orders").models.length > 1) { // The main order where other orders will be merged this.pos.main_order_uid = this.pos.get_order().uid; @@ -212,7 +212,7 @@ odoo.define("pos_order_merge.merge", function(require) { screens.define_action_button({ name: "order_merge", widget: OrderMergeButton, - condition: function() { + condition: function () { return this.pos.config.iface_order_merge; }, }); diff --git a/pos_order_merge/static/src/js/tour.js b/pos_order_merge/static/src/js/tour.js index 93d3660e03..fc58721e68 100644 --- a/pos_order_merge/static/src/js/tour.js +++ b/pos_order_merge/static/src/js/tour.js @@ -1,4 +1,4 @@ -odoo.define("pos_order_merge.tour", function(require) { +odoo.define("pos_order_merge.tour", function (require) { "use strict"; var tour = require("web_tour.tour"); @@ -12,7 +12,7 @@ odoo.define("pos_order_merge.tour", function(require) { { trigger: '.order .product-name:contains("' + product_name + '")', content: "the " + product_name + " have been added to the order", - run: function() { + run: function () { // It's a check }, }, @@ -101,7 +101,7 @@ odoo.define("pos_order_merge.tour", function(require) { { trigger: ".js_connecting:visible", content: "verify that the order is being sent to the backend", - run: function() { + run: function () { // It's a check }, }, @@ -109,7 +109,7 @@ odoo.define("pos_order_merge.tour", function(require) { trigger: ".js_connected:visible", content: "verify that the order has been succesfully sent to the backend", - run: function() { + run: function () { // It's a check }, }, @@ -138,7 +138,7 @@ odoo.define("pos_order_merge.tour", function(require) { steps = steps.concat({ trigger: ".o_main_content:has(.loader:hidden)", content: "waiting for loading to finish", - run: function() { + run: function () { // It's a check }, }); @@ -178,7 +178,7 @@ odoo.define("pos_order_merge.tour", function(require) { content: "wait until backend is opened", trigger: '.o_app[data-menu-xmlid="point_of_sale.menu_point_root"], .oe_menu_toggler[data-menu-xmlid="point_of_sale.menu_point_root"]', - run: function() { + run: function () { // No need to click on trigger }, }, diff --git a/pos_order_merge/static/src/xml/merge.xml b/pos_order_merge/static/src/xml/merge.xml index 99ef8d31a4..9e5c0ad24a 100644 --- a/pos_order_merge/static/src/xml/merge.xml +++ b/pos_order_merge/static/src/xml/merge.xml @@ -62,13 +62,15 @@
- Join + + Join
diff --git a/pos_order_merge/views/pos_config_view.xml b/pos_order_merge/views/pos_config_view.xml index cc46425b61..a4e49d3c2c 100644 --- a/pos_order_merge/views/pos_config_view.xml +++ b/pos_order_merge/views/pos_config_view.xml @@ -3,10 +3,25 @@ pos.config.form.view.inherit pos.config - + - - + +
+
+ +
+
+
+
diff --git a/pos_order_merge/views/pos_order_merge_template.xml b/pos_order_merge/views/pos_order_merge_template.xml index 3b795ce7a6..9d6a24494f 100644 --- a/pos_order_merge/views/pos_order_merge_template.xml +++ b/pos_order_merge/views/pos_order_merge_template.xml @@ -1,33 +1,28 @@ - - -