Click to start the point of sale interface. It runs on tablets, laptops, or industrial hardware.
Once the session launched, the system continues to run without an internet connection.
"), + position: "bottom" + }, { + content: "Switch to table or make dummy action", + trigger: '.table:not(.oe_invisible .neworder-button), .order-button.selected', + position: "bottom", + timeout: 20000, + }]; + } + function create_new_order() { + return [{ + content: 'Create new order', + trigger: '.order-button.neworder-button', + }]; + } + function add_product_to_order(product_name) { + return [{ + content: 'buy ' + product_name, + trigger: '.product-list .product-name:contains("' + product_name + '")', + }, { + content: 'the ' + product_name + ' have been added to the order', + trigger: '.order .product-name:contains("' + product_name + '")', + }]; + } + function switch_table() { + return [{ + content: "Switch to table or make dummy action", + trigger: '.table:not(.oe_invisible .neworder-button), .order-button.selected', + position: "bottom", + }]; + } + function set_customer(name) { + return [{ + trigger: '.button.js_set_customer', + content: _t("Open the customer screen"), + }, { + trigger: 'td:contains(' + name + ')', + content: _t("Click the customer"), + }, { + extra_trigger: '.button.next.highlight:contains("Set Customer")', + trigger: '.button.next.highlight:contains("Set Customer")', + content: 'Set Customer', + }]; + } + function click_to_payment() { + return [{ + content: "Make a dummy action", + trigger: '.order-button.selected', + }, { + trigger: '.button.pay', + content: _t("Open the payment screen"), + }, { + content: "Choose Administrator like a cashier or make a dummy action", + trigger: '.modal-dialog.cashier:not(.oe_hidden) .cashier .selection-item:contains("Administrator"), .payment-screen:not(.oe_hidden) h1:contains("Payment")', + }]; + } + function debt_method_paying(pay_method) { + return [{ + extra_trigger: '.button.paymentmethod:contains("' + pay_method +'")', + trigger: '.button.paymentmethod:contains("' + pay_method +'")', + content: _t("Click the payment method"), + }]; + } + function validate_order() { + return [{ + extra_trigger: '.button.next.highlight:contains("Validate")', + trigger: '.button.next.highlight:contains("Validate")', + content: 'Validate payment', + }]; + } + function click_numpad_input(char) { + return [{ + trigger: '.input-button:contains("' + char +'")', + content: _t("Click input on numpad"), + }]; + } + function next_order(){ + return [{ + trigger: '.button.next', + content: _t("Next order"), + }]; + } + function set_numpad_value(value) { + var steps = []; + for (var i = 0; i < value.length; i++) { + steps = steps.concat(click_numpad_input(value.charAt(i))); + } + return steps; + } + /* -----Scenarios----- */ + // Initial Test "Pay with all credit-journal" + function initial_scene(steps, client) { + return steps.concat( + create_new_order(), + add_product_to_order('Lemon'), + click_to_payment(), + set_customer(client), + debt_method_paying('Credits (USD)'), + set_numpad_value("1"), + debt_method_paying('Credits (Fruits & Vegetables only) (USD)'), + set_numpad_value("1"), + debt_method_paying('Credits (via discounts) (USD)'), + validate_order(), + next_order(), + switch_table() + ); + } + var steps = []; + var client = "Agrolait"; + steps = steps.concat(open_pos_neworder()); + steps = initial_scene(steps, client); + + tour.register('tour_pos_debt_notebook_sync', { test: true, url: '/web' }, steps); + +}); diff --git a/pos_debt_notebook_sync/tests/__init__.py b/pos_debt_notebook_sync/tests/__init__.py index 2b5a89e2b1..5895ad7c36 100644 --- a/pos_debt_notebook_sync/tests/__init__.py +++ b/pos_debt_notebook_sync/tests/__init__.py @@ -1,2 +1,4 @@ # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). from . import test_debt_sync +from . import test_pos_debt_sync + diff --git a/pos_debt_notebook_sync/tests/test_debt_sync.py b/pos_debt_notebook_sync/tests/test_debt_sync.py index 88d296b41e..02dbb93031 100644 --- a/pos_debt_notebook_sync/tests/test_debt_sync.py +++ b/pos_debt_notebook_sync/tests/test_debt_sync.py @@ -16,11 +16,11 @@ def test_pos_debt(self): # this you end up with js, css but no qweb. cr = self.registry.cursor() env = Environment(cr, self.uid, {}) - env['ir.module.module'].search([('name', '=', 'pos_debt_notebook')], limit=1).state = 'installed' + env['ir.module.module'].search([('name', '=', 'pos_debt_notebook_sync')], limit=1).state = 'installed' cr.release() # without a delay there might be problems caused by a not yet loaded button's action self.phantom_js("/web", - "odoo.__DEBUG__.services['web_tour.tour'].run('tour_pos_debt_notebook', 1000)", - "odoo.__DEBUG__.services['web_tour.tour'].tours.tour_pos_debt_notebook.ready", + "odoo.__DEBUG__.services['web_tour.tour'].run('tour_pos_debt_notebook_sync', 1000)", + "odoo.__DEBUG__.services['web_tour.tour'].tours.tour_pos_debt_notebook_sync.ready", login="admin", timeout=140) diff --git a/pos_debt_notebook_sync/views/assets.xml b/pos_debt_notebook_sync/views/assets.xml new file mode 100644 index 0000000000..c9ff2e0e9c --- /dev/null +++ b/pos_debt_notebook_sync/views/assets.xml @@ -0,0 +1,12 @@ + + +