forked from itpp-labs/pos-addons
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
📖 pos_disable_payment_restaurant (it-projects-llc/addons-dev#593)
* [10.0][NEW] pos_disable_payment_restaurant module (it-projects-llc/addons-dev#394) * [REF] remove old code * [10.0][NEW] Disable payments in Restaurant * [DOC] pos_disable_payment_restaurant description * [10.0][FIX] pos_disable_payment_restaurant: line is undefined (it-projects-llc/addons-dev#404) * 📖 pos_disable_payment_restaurant module * 📖 pos_disable_payment_restaurant: update for the docs * 🛡️ added ci tests * 🛡️ fix tests
- Loading branch information
Showing
12 changed files
with
135 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+154 KB
pos_disable_payment_restaurant/images/pos_disable_payment_restaurant.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+283 KB
pos_disable_payment_restaurant/static/description/disable_backspace_button.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+285 KB
pos_disable_payment_restaurant/static/description/disable_qty_button.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+159 KB
pos_disable_payment_restaurant/static/description/restaurant_options.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
73 changes: 73 additions & 0 deletions
73
pos_disable_payment_restaurant/static/src/js/tour_pos_dis_pay_rest.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
odoo.define('pos_disable_payment_restaurant.tour', function(require) { | ||
"use strict"; | ||
|
||
var core = require('web.core'); | ||
var tour = require('web_tour.tour'); | ||
|
||
tour.register('pos_disable_payment_restaurant_tour', { | ||
test: true, | ||
url: "/web", | ||
}, [{ | ||
trigger: '.o_app[data-menu="4"], .oe_menu_toggler[data-menu="4"]', | ||
content: "Configuration options are available in the Settings app.", | ||
position: "bottom" | ||
}, { | ||
trigger: '.oe_menu_leaf[data-menu=65]', | ||
content: "Open the <b>Users</b> menu", | ||
position: "right" | ||
}, { | ||
trigger: '.o_list_view > tbody > tr', | ||
content: "Click on the item", | ||
position: "bottom" | ||
}, { | ||
trigger: ".o_form_button_edit", | ||
content: "Click to edit user", | ||
position: "bottom" | ||
}, { | ||
trigger: 'a[href="#notebook_page_12"]', | ||
content: "Move on <b>Point of Sale</b> tab", | ||
position: "top" | ||
}, { | ||
trigger: 'label:contains("Allow change Qty for kitchen orders")', | ||
extra_trigger: 'input[name="allow_decrease_kitchen"]:propChecked({disabled: true})', | ||
content: "Uncheck the box <b>Allow change Qty for kitchen orders</b>", | ||
position: "right" | ||
}, { | ||
trigger: ".o_form_button_save", | ||
content: "Save the changes", | ||
position: "bottom" | ||
}, { | ||
trigger: '.o_app[data-menu-xmlid="point_of_sale.menu_point_root"], .oe_menu_toggler[data-menu-xmlid="point_of_sale.menu_point_root"]', | ||
content: "Ready to launch your <b>point of sale</b>? <i>Click here</i>.", | ||
position: 'bottom' | ||
}, { | ||
trigger: ".o_pos_kanban button.oe_kanban_action_button", | ||
content: "<p>Click to start the point of sale interface. It <b>runs on tablets</b>, laptops, or industrial hardware.</p><p>Once the session launched, the system continues to run without an internet connection.</p>", | ||
position: "bottom" | ||
}, { | ||
content: "Switch to table or make dummy action", | ||
trigger: '.table:not(.oe_invisible .neworder-button), .order-button.selected', | ||
position: "bottom" | ||
}, { | ||
trigger: '.product-list .product', | ||
content: "Add the first product", | ||
position: "top" | ||
}, { | ||
trigger: '.control-buttons .order-submit', | ||
content: "Send the order to kitchen", | ||
position: "top" | ||
}, { | ||
content: "Hidden", | ||
trigger: '.pads', | ||
run: function(){ | ||
if ($('.mode-button[data-mode="quantity"]').hasClass("disable")) { | ||
console.log("The option to change Qty for kitchen orders is blocked"); | ||
} else { | ||
console.log("error", "The button is not disabled"); | ||
} | ||
} | ||
} | ||
|
||
]); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import test_default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# -*- coding: utf-8 -*- | ||
import odoo.tests | ||
|
||
|
||
@odoo.tests.common.at_install(False) | ||
@odoo.tests.common.post_install(True) | ||
class TestUi(odoo.tests.HttpCase): | ||
|
||
def test_pos_dis_pay_rest(self): | ||
self.phantom_js( | ||
'/web', | ||
|
||
"odoo.__DEBUG__.services['web_tour.tour']" | ||
".run('pos_disable_payment_restaurant_tour')", | ||
|
||
"odoo.__DEBUG__.services['web_tour.tour']" | ||
".tours.pos_disable_payment_restaurant_tour.ready", | ||
|
||
login="admin", | ||
timeout=240, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<odoo> | ||
|
||
<template id="demo_assets_backend" name="pos_disable_payment_restaurant demo assets" inherit_id="web.assets_backend"> | ||
<xpath expr="." position="inside"> | ||
<script type="text/javascript" src="/pos_disable_payment_restaurant/static/src/js/tour_pos_dis_pay_rest.js"></script> | ||
</xpath> | ||
</template> | ||
|
||
</odoo> |