Skip to content

Commit

Permalink
📖 pos_disable_payment_restaurant (it-projects-llc/addons-dev#593)
Browse files Browse the repository at this point in the history
* [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
ilmir-k committed Apr 5, 2019
1 parent 3c44df4 commit ae7326e
Show file tree
Hide file tree
Showing 12 changed files with 135 additions and 13 deletions.
4 changes: 2 additions & 2 deletions pos_disable_payment_restaurant/README.rst
Expand Up @@ -8,11 +8,11 @@

Control access to POS Restaurant options

The mdoule adds new options on user form (``Point of Sale`` tab):
The module adds new options on user form (``Point of Sale`` tab):

* ``Allow change Qty for kitchen orders``
* ``Allow remove kitchen order line``

Credits
=======

Expand Down
21 changes: 17 additions & 4 deletions pos_disable_payment_restaurant/__manifest__.py
@@ -1,20 +1,21 @@
# -*- coding: utf-8 -*-
# Copyright 2018 Dinar Gabbasov <https://it-projects.info/team/GabbasovDinar>
# Copyright 2018 Ilmir Karamov <https://it-projects.info/team/ilmir-k>
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
{
"name": """Disable options in POS (restaurant extension)""",
"summary": """Control access to POS restaurant options""",
"category": "Point of Sale",
# "live_test_url": "",
"images": [],
"live_test_url": "http://apps.it-projects.info/shop/product/pos-disable-payment-restaurant?version=10.0",
"images": ['images/pos_disable_payment_restaurant.jpg'],
"version": "10.0.1.0.0",
"application": False,

"author": "IT-Projects LLC, Dinar Gabbasov",
"support": "apps@it-projects.info",
"support": "pos@it-projects.info",
"website": "https://it-projects.info/team/GabbasovDinar",
"license": "LGPL-3",
"price": 9.00,
"price": 29.00,
"currency": "EUR",

"depends": [
Expand All @@ -25,6 +26,7 @@
"data": [
"views/template.xml",
"views/view.xml",
"views/assets_demo.xml",
],
"qweb": [
],
Expand All @@ -38,4 +40,15 @@

"auto_install": False,
"installable": True,

"demo_title": "Disable options in POS (restaurant extension)",
"demo_addons": [
],
"demo_addons_hidden": [
],
"demo_url": "pos-disable-payment-restaurant",
"demo_summary": "Control access to POS restaurant options",
"demo_images": [
"images/pos_disable_payment_restaurant.jpg",
]
}
2 changes: 1 addition & 1 deletion pos_disable_payment_restaurant/doc/index.rst
Expand Up @@ -26,4 +26,4 @@ Usage
* RESULT: Disabled ``Qty`` button
* Then set product quantity to ``0`` using ``Backspace`` button
* RESULT: Once the qty equals to 0, ``Backspace`` button is disabled

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 10 additions & 6 deletions pos_disable_payment_restaurant/static/description/index.html
Expand Up @@ -18,7 +18,7 @@ <h3 class="oe_slogan">How It Works</h3>
</p>
</div>
<div class="oe_screenshot" align="center">
<img style="max-width: 80%" src=".png"/>
<img style="max-width: 80%" src="restaurant_options.png"/>
</div>
</div>
</section>
Expand All @@ -30,12 +30,13 @@ <h3 class="oe_slogan">How It Works</h3>
<div class="oe_span12 text-center">
<p class="oe_mt32">
<font style="font-size: 120%;">
<b>Disallow change Qty for kitchen orders</b> <br/>
Open POS session. Add products allowed to be sent to kitchen and click <b>Order</b> button. As a result, <b>Qty</b> button is disabled.
</font>
</p>
</div>
<div class="oe_screenshot" align="center">
<img style="max-width: 80%" src=".png"/>
<img style="max-width: 80%" src="disable_qty_button.png"/>
</div>
</div>
</section>
Expand All @@ -46,11 +47,14 @@ <h3 class="oe_slogan">How It Works</h3>
<div class="oe_row oe_spaced">
<div class="oe_span12 text-center">
<p class="oe_mt32">
<font style="font-size: 120%;">Then if you set orderline quantity to 0, <b>Backspace</b> button is disabled too</font>
<font style="font-size: 120%;">
<b>Disallow remove kitchen order line</b> </br>
Then if you set orderline quantity to 0, <b>Backspace</b> button is disabled too
</font>
</p>
</div>
<div class="oe_screenshot" align="center">
<img style="max-width: 80%" src=".png"/>
<img style="max-width: 80%" src="disable_backspace_button.png"/>
</div>
</div>
</section>
Expand All @@ -61,9 +65,9 @@ <h3 class="oe_slogan">How It Works</h3>
<div class="oe_row oe_spaced">
<div class="oe_span8">
<h2>Need our service?</h2>
<p class="oe_mt32">Contact us by <a href="mailto:apps@it-projects.info">email</a> or fill out <a href="https://www.it-projects.info/page/website.contactus " target="_blank">request form</a></p>
<p class="oe_mt32">Contact us by <a href="mailto:pos@it-projects.info">email</a> or fill out <a href="https://www.it-projects.info/page/website.contactus " target="_blank">request form</a></p>
<ul>
<li><a href="mailto:apps@it-projects.info">apps@it-projects.info <i class="fa fa-envelope-o"></i></a></li>
<li><a href="mailto:apps@it-projects.info">pos@it-projects.info <i class="fa fa-envelope-o"></i></a></li>
<li><a href="https://www.it-projects.info/page/website.contactus " target="_blank">https://www.it-projects.info/page/website.contactus <i class="fa fa-list-alt"></i></a></li>
</ul>
</div>
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -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");
}
}
}

]);

});
1 change: 1 addition & 0 deletions pos_disable_payment_restaurant/tests/__init__.py
@@ -0,0 +1 @@
from . import test_default
21 changes: 21 additions & 0 deletions pos_disable_payment_restaurant/tests/test_default.py
@@ -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,
)
10 changes: 10 additions & 0 deletions pos_disable_payment_restaurant/views/assets_demo.xml
@@ -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>

0 comments on commit ae7326e

Please sign in to comment.