Skip to content
Permalink
Browse files

🛡 touring by checking-clicking all products in set, Fixed pos_config_…

…view according to odoo(11 ver.)
  • Loading branch information...
fedoranvar committed Jul 29, 2019
1 parent eebacab commit b49a06cab3dc99e8e091e53e589d94abff1ed1a7
Showing with 62 additions and 22 deletions.
  1. +3 −3 pos_menu/README.rst
  2. +47 −15 pos_menu/static/src/js/tour.js
  3. +12 −4 pos_menu/views/pos_config_view.xml
@@ -9,8 +9,8 @@ Credits

Contributors
------------
* `Gabbasov Dinar <https://it-projects.info/team/GabbasovDinar>`_
* `Kildebekov Anvar <https://it-projects.info/team/kildebekov>`__
* `Dinar Gabbasov <https://it-projects.info/team/GabbasovDinar>`__
* `Anvar Kildebekov <https://it-projects.info/team/kildebekov>`__

Sponsors
--------
@@ -37,4 +37,4 @@ Usage instructions: `<doc/index.rst>`_

Changelog: `<doc/changelog.rst>`_

Tested on Odoo 11.0 0351677a00df8bd76fa207a38dc2ecdefdc6940a
Tested on Odoo 11.0 565148591f81b6685d89fd9c790c990d46d71513
@@ -6,31 +6,63 @@ odoo.define('pos_menu.tour', function(require) {

var _t = core._t;

tour.register('pos_menu_tour', {
url: "/web",
test: true,
}, [{
function pos_opening(){
return [{
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: _t("Ready to launch your <b>point of sale</b>? <i>Click here</i>."),
position: 'bottom',
}, {
}, {
trigger: ".o_pos_kanban .o_kanban_record:not(:first) button.oe_kanban_action_button",
content: _t("<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"
}, {
}, {
trigger: '.o_main_content:has(.loader:hidden)',
content: 'Wait for loading is finished',
timeout: 20000,
run: function () {
// it's a check
},
}];
}

function check_menu(menu){
return [{
content: "Switch to table or make dummy action",
trigger: '.table:not(.oe_invisible .neworder-button), .order-button.selected',
position: "bottom"
}, {
trigger: '.product-list .product-name:contains()',
content: "Add products",
position: "top",
run: function(){
for (var i = 0; i < menu.length; i++) {
$('.product-list .product-name:contains(' + menu[i] + ')').click();
}
},
}];
}
}, {
content: "Switch to table or make dummy action",
trigger: '.table:not(.oe_invisible .neworder-button), .order-button.selected',
position: "bottom"
}, {
trigger: '.product-list .product-name:contains("Boni Oranges")',
content: "Add the product",
position: "top"
}]);

function pos_closing(){
return [{
trigger: ".header-button",
content: "close the Point of Sale frontend",
}, {
trigger: ".header-button.confirm",
content: "confirm closing the frontend",
}, {
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 () {
// no need to click on trigger
},
}];
}

var steps = [];
var menu = ["Boni Oranges", "Black Grapes", "Carrots", "Conference pears"];
steps = steps.concat(pos_opening());
steps = steps.concat(check_menu(menu));
steps = steps.concat(pos_closing());

tour.register('pos_menu_tour', {url: '/web', test: true,}, steps);
});
@@ -5,10 +5,18 @@
<field name="model">pos.config</field>
<field name="inherit_id" ref="point_of_sale.pos_config_view_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='iface_print_skip_screen']" position="after">
<field name="current_session_state" invisible="1"/>
<field name="tag_ids" widget="many2many_tags" attrs="{'readonly':[('current_session_state', '=', 'opened')]}"/>
<p class="oe_edit_only" attrs="{'invisible':[('current_session_state', '!=', 'opened')]}"> You need to close current session to be able to modify Product Sets </p>
<xpath expr="//h2[@name='order']/following-sibling::div[1]/div[4]" position="after">
<div class="col-xs-12 col-md-6 o_setting_box" >
<div class="o_setting_right_pane">
<label for="tag_ids"/>
<div class="text-muted">
Selected menu for POS
</div>
<field name="current_session_state" invisible="1"/>
<field name="tag_ids" widget="many2many_tags" attrs="{'readonly':[('current_session_state', '=', 'opened')]}"/>
<p class="oe_edit_only" attrs="{'invisible':[('current_session_state', '!=', 'opened')]}"> You need to close current session to be able to modify Product Sets </p>
</div>
</div>
</xpath>
</field>
</record>

0 comments on commit b49a06c

Please sign in to comment.
You can’t perform that action at this time.