From 6327ddf5be7563b66d16f250948ca16e8ba4e289 Mon Sep 17 00:00:00 2001 From: Mitchell Admin Date: Wed, 17 Mar 2021 06:41:33 +0000 Subject: [PATCH 1/3] :arrow_up::one::two: OCA/odoo-module-migrator close #1358 > Made via .github/workflows/DINAR-PORT.yml --- pos_order_merge/__manifest__.py | 2 +- pos_order_merge/views/pos_order_merge_template.xml | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) 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/views/pos_order_merge_template.xml b/pos_order_merge/views/pos_order_merge_template.xml index 3b795ce7a6..b8879f76f9 100644 --- a/pos_order_merge/views/pos_order_merge_template.xml +++ b/pos_order_merge/views/pos_order_merge_template.xml @@ -1,6 +1,5 @@ - - + - - + From df0dba5ab3fc56e1c57f070c6e30d6c67c002e4f Mon Sep 17 00:00:00 2001 From: Mitchell Admin Date: Wed, 17 Mar 2021 06:42:45 +0000 Subject: [PATCH 2/3] :rainbow: pre-commit > Made via .github/workflows/DINAR-PORT.yml --- pos_order_merge/static/src/img/svg/floor.svg | 99 +++++++++++------ pos_order_merge/static/src/img/svg/table.svg | 100 ++++++++++++------ pos_order_merge/static/src/js/merge.js | 42 ++++---- pos_order_merge/static/src/js/tour.js | 12 +-- pos_order_merge/static/src/xml/merge.xml | 4 +- .../views/pos_order_merge_template.xml | 53 +++++----- 6 files changed, 185 insertions(+), 125 deletions(-) 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_order_merge_template.xml b/pos_order_merge/views/pos_order_merge_template.xml index b8879f76f9..9d6a24494f 100644 --- a/pos_order_merge/views/pos_order_merge_template.xml +++ b/pos_order_merge/views/pos_order_merge_template.xml @@ -1,31 +1,28 @@ -