diff --git a/pos_product_qty_available/README.rst b/pos_product_qty_available/README.rst new file mode 100644 index 00000000..c0f4e389 --- /dev/null +++ b/pos_product_qty_available/README.rst @@ -0,0 +1,101 @@ +===================================== +Available quantity of products in POS +===================================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--auth-lightgray.png?logo=github + :target: https://github.com/OCA/server-auth/tree/11.0/pos_product_qty_available + :alt: OCA/server-auth +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/server-auth-11-0/server-auth-11-0-pos_product_qty_available + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/251/11.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module allows you to see the available quantity of products in the POS. + +At the *Point of Sale*, the quantity of the product is displayed in the card and in the order panel. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +* Go to *Point of Sale* + +* Now the quantity of the product is shown on the product card and on the order panel + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* IT-Projects LLC +* Ivan Yelizariev + +Contributors +~~~~~~~~~~~~ + +* Ivan Yelizariev (https://it-projects.info/team/yelizariev) + +* Ilmir Karamov (https://it-projects.info/team/ilmir-k) + +* Kolushov Alexandr (https://it-projects.info/team/KolushovAlexandr) + +* gaelTorrecillas (https://github.com/gaelTorrecillas) + +* manawi (https://github.com/manawi) + +Other credits +~~~~~~~~~~~~~ + +The development of this module has been financially supported by: + +* IT-Projects LLC + +Original module: pos_product_available +Repository: https://github.com/it-projects-llc/pos-addons/tree/12.0/ + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +This module is part of the `OCA/server-auth `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/pos_product_qty_available/__init__.py b/pos_product_qty_available/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/pos_product_qty_available/__manifest__.py b/pos_product_qty_available/__manifest__.py new file mode 100644 index 00000000..0f826d7e --- /dev/null +++ b/pos_product_qty_available/__manifest__.py @@ -0,0 +1,29 @@ +# Copyright 2014-2018 Ivan Yelizariev +# Copyright 2017 Gabbasov Dinar +# Copyright 2018 Kolushov Alex +# Copyright 2018 Ildar Nasyrov +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). +{ + "name": """Available quantity of products in POS""", + "summary": """Adds available quantity at products in POS""", + "category": "Point Of Sale", + "images": [], + "version": "12.0.1.0.0", + "application": False, + "author": "IT-Projects LLC, Ivan Yelizariev, " + "Odoo Community Association (OCA)", + "support": "pos@it-projects.info", + "website": "https://github.com/OCA/pos", + "license": "LGPL-3", + "depends": [ + 'point_of_sale', + ], + 'data': [ + 'data/pos_product_qty_available_data.xml', + ], + 'qweb': [ + 'static/src/xml/pos.xml', + ], + "auto_install": False, + "installable": True, +} diff --git a/pos_product_qty_available/data/pos_product_qty_available_data.xml b/pos_product_qty_available/data/pos_product_qty_available_data.xml new file mode 100644 index 00000000..034e1bea --- /dev/null +++ b/pos_product_qty_available/data/pos_product_qty_available_data.xml @@ -0,0 +1,21 @@ + + + + + + diff --git a/pos_product_qty_available/i18n/de.po b/pos_product_qty_available/i18n/de.po new file mode 100644 index 00000000..52d05dad --- /dev/null +++ b/pos_product_qty_available/i18n/de.po @@ -0,0 +1,71 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_product_qty_available +# +# Translators: +# Translation Bot , 2017 +# Ermin Trevisan , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-04-27 23:49+0000\n" +"PO-Revision-Date: 2018-04-27 23:49+0000\n" +"Last-Translator: Ermin Trevisan , 2018\n" +"Language-Team: German (https://www.transifex.com/it-projects-llc/teams/76080/de/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: de\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: pos_product_qty_available +#. openerp-web +#: code:addons/pos_product_qty_available/static/src/xml/pos.xml:15 +#, python-format +msgid "(of" +msgstr "(von " + +#. module: pos_product_qty_available +#. openerp-web +#: code:addons/pos_product_qty_available/static/src/js/test_pos_quantities.js:11 +#: code:addons/pos_product_qty_available/static/src/js/test_pos_quantities.js:68 +#, python-format +msgid "" +"

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.

" +msgstr "" +"

Anklicken, um das POS-System zu starten. Es läuft auf Tablets, " +"Laptops, oder industrieller Hardware.

Sobald eine Sitzung gestartet " +"wurde, funktioniert das System auch ohne Internet-Verbindung.

" + +#. module: pos_product_qty_available +#. openerp-web +#: code:addons/pos_product_qty_available/static/src/js/test_pos_quantities.js:43 +#, python-format +msgid "Click the payment method" +msgstr "" + +#. module: pos_product_qty_available +#. openerp-web +#: code:addons/pos_product_qty_available/static/src/js/test_pos_quantities.js:61 +#: code:addons/pos_product_qty_available/static/src/js/test_pos_quantities.js:64 +#, python-format +msgid "Close POS" +msgstr "" + +#. module: pos_product_qty_available +#. openerp-web +#: code:addons/pos_product_qty_available/static/src/js/test_pos_quantities.js:36 +#, python-format +msgid "Open the payment screen" +msgstr "" + +#. module: pos_product_qty_available +#. openerp-web +#: code:addons/pos_product_qty_available/static/src/js/test_pos_quantities.js:83 +#, python-format +msgid "Ready to launch your point of sale? Click here." +msgstr "" +"Bereit, Ihren Point of Salezu starten? Klicken Sie hier." diff --git a/pos_product_qty_available/i18n/es.po b/pos_product_qty_available/i18n/es.po new file mode 100644 index 00000000..1e7e63e7 --- /dev/null +++ b/pos_product_qty_available/i18n/es.po @@ -0,0 +1,71 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_product_qty_available +# +# Translators: +# charles paul requena palomino , 2018 +# Alexandr Frrost , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-04-27 23:49+0000\n" +"PO-Revision-Date: 2018-04-27 23:49+0000\n" +"Last-Translator: Alexandr Frrost , 2018\n" +"Language-Team: Spanish (https://www.transifex.com/it-projects-llc/teams/76080/es/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: es\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: pos_product_qty_available +#. openerp-web +#: code:addons/pos_product_qty_available/static/src/xml/pos.xml:15 +#, python-format +msgid "(of" +msgstr "" + +#. module: pos_product_qty_available +#. openerp-web +#: code:addons/pos_product_qty_available/static/src/js/test_pos_quantities.js:11 +#: code:addons/pos_product_qty_available/static/src/js/test_pos_quantities.js:68 +#, python-format +msgid "" +"

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.

" +msgstr "" +"

Haga clic para iniciar la interfaz del punto de venta. Se ejecuta en " +"tabletas, computadoras portátiles o hardware industrial.

Una vez " +"que se inicia la sesión, el sistema continúa ejecutándose sin conexión a " +"Internet.

" + +#. module: pos_product_qty_available +#. openerp-web +#: code:addons/pos_product_qty_available/static/src/js/test_pos_quantities.js:43 +#, python-format +msgid "Click the payment method" +msgstr "" + +#. module: pos_product_qty_available +#. openerp-web +#: code:addons/pos_product_qty_available/static/src/js/test_pos_quantities.js:61 +#: code:addons/pos_product_qty_available/static/src/js/test_pos_quantities.js:64 +#, python-format +msgid "Close POS" +msgstr "" + +#. module: pos_product_qty_available +#. openerp-web +#: code:addons/pos_product_qty_available/static/src/js/test_pos_quantities.js:36 +#, python-format +msgid "Open the payment screen" +msgstr "" + +#. module: pos_product_qty_available +#. openerp-web +#: code:addons/pos_product_qty_available/static/src/js/test_pos_quantities.js:83 +#, python-format +msgid "Ready to launch your point of sale? Click here." +msgstr "¿Listo para lanzar su punto de venta? Haga clic aquí." diff --git a/pos_product_qty_available/readme/CONTRIBUTORS.rst b/pos_product_qty_available/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000..2dfcdfbe --- /dev/null +++ b/pos_product_qty_available/readme/CONTRIBUTORS.rst @@ -0,0 +1,9 @@ +* Ivan Yelizariev (https://it-projects.info/team/yelizariev) + +* Ilmir Karamov (https://it-projects.info/team/ilmir-k) + +* Kolushov Alexandr (https://it-projects.info/team/KolushovAlexandr) + +* gaelTorrecillas (https://github.com/gaelTorrecillas) + +* manawi (https://github.com/manawi) diff --git a/pos_product_qty_available/readme/CREDITS.rst b/pos_product_qty_available/readme/CREDITS.rst new file mode 100644 index 00000000..73d9027f --- /dev/null +++ b/pos_product_qty_available/readme/CREDITS.rst @@ -0,0 +1,6 @@ +The development of this module has been financially supported by: + +* IT-Projects LLC + +Original module: pos_product_available +Repository: https://github.com/it-projects-llc/pos-addons/tree/12.0/ diff --git a/pos_product_qty_available/readme/DESCRIPTION.rst b/pos_product_qty_available/readme/DESCRIPTION.rst new file mode 100644 index 00000000..ac8bcaf6 --- /dev/null +++ b/pos_product_qty_available/readme/DESCRIPTION.rst @@ -0,0 +1,3 @@ +This module allows you to see the available quantity of products in the POS. + +At the *Point of Sale*, the quantity of the product is displayed in the card and in the order panel. diff --git a/pos_product_qty_available/readme/USAGE.rst b/pos_product_qty_available/readme/USAGE.rst new file mode 100644 index 00000000..e308679e --- /dev/null +++ b/pos_product_qty_available/readme/USAGE.rst @@ -0,0 +1,3 @@ +* Go to *Point of Sale* + +* Now the quantity of the product is shown on the product card and on the order panel diff --git a/pos_product_qty_available/static/description/icon.png b/pos_product_qty_available/static/description/icon.png new file mode 100644 index 00000000..8a058284 Binary files /dev/null and b/pos_product_qty_available/static/description/icon.png differ diff --git a/pos_product_qty_available/static/description/index.html b/pos_product_qty_available/static/description/index.html new file mode 100644 index 00000000..3dc27ca9 --- /dev/null +++ b/pos_product_qty_available/static/description/index.html @@ -0,0 +1,102 @@ +
+
+
+

Available quantity of products in POS

+

Let a cashier know how many products are available

+
+ +
+
+ +
+
+
+

+ Adds available quantity at order panel +

+
+
+
+ +
+
+
+

+ Adds available quantity at products. +

+
+ +
+
+ +
+
+
+
+ +
+
+
+

Usage

+

+ There no any settings. Just install the module and start POS. +

+

+ Works in offline mode. +

+
+
+
+ +
+
+
+

Need our service?

+

Contact us by email or fill out request form

+ +
+
+
+
+ Tested on Odoo
10.0 community +
+
+ Tested on Odoo
10.0 enterprise +
+
+
+
+
diff --git a/pos_product_qty_available/static/description/screenshot-2.png b/pos_product_qty_available/static/description/screenshot-2.png new file mode 100644 index 00000000..8b76833d Binary files /dev/null and b/pos_product_qty_available/static/description/screenshot-2.png differ diff --git a/pos_product_qty_available/static/description/screenshot.png b/pos_product_qty_available/static/description/screenshot.png new file mode 100644 index 00000000..1d6d1694 Binary files /dev/null and b/pos_product_qty_available/static/description/screenshot.png differ diff --git a/pos_product_qty_available/static/src/css/pos.css b/pos_product_qty_available/static/src/css/pos.css new file mode 100644 index 00000000..8f3012a5 --- /dev/null +++ b/pos_product_qty_available/static/src/css/pos.css @@ -0,0 +1,24 @@ +.pos .product .qty-tag { + position: absolute; + top: 2px; + left: 2px; + vertical-align: top; + color: white; + line-height: 13px; + background: #7f82ac; + padding: 2px 5px; + border-radius: 2px; + font-weight: bold; +} +.pos .product .qty-tag.not-available { + background: #d882ac; +} + +.pos .order .orderline .qty-info{ + color: #777; + font-weight: bold; + font-style: normal; +} +.pos .order .orderline .qty-info.not-available{ + color:red; +} \ No newline at end of file diff --git a/pos_product_qty_available/static/src/js/pos.js b/pos_product_qty_available/static/src/js/pos.js new file mode 100644 index 00000000..df3a080f --- /dev/null +++ b/pos_product_qty_available/static/src/js/pos.js @@ -0,0 +1,123 @@ +/* Copyright 2014-2017 Ivan Yelizariev + Copyright 2016 gaelTorrecillas + Copyright 2016 manawi + Copyright 2017 Ilmir Karamov + Copyright 2018 Kolushov Alexandr + License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). */ +odoo.define('pos_product_qty_available.PosModel', function (require) { + "use strict"; + + var rpc = require('web.rpc'); + var models = require('point_of_sale.models'); + + var PosModelSuper = models.PosModel.prototype; + models.PosModel = models.PosModel.extend({ + load_server_data: function () { + var self = this; + + var loaded = PosModelSuper.load_server_data.call(this); + + var prod_model = _.find(this.models, function (model) { + return model.model === 'product.product'; + }); + if (prod_model) { + prod_model.fields.push('qty_available', 'type'); + var context_super = prod_model.context; + prod_model.context = function (that) { + var ret = context_super(that); + ret.location = that.config.stock_location_id[0]; + return ret; + }; + var loaded_super = prod_model.loaded; + prod_model.loaded = function (that, products) { + loaded_super(that, products); + self.db.product_qtys = products; + }; + return loaded; + } + + return loaded.then(function () { + return rpc.query({ + model: 'product.product', + method: 'search_read', + args: [], + fields: ['qty_available', 'type'], + domain: [['sale_ok', '=', true], + ['available_in_pos', '=', true]], + context: {'location': self.config.stock_location_id[0]}, + }).then(function (products) { + self.db.product_qtys = products; + }); + }); + }, + set_product_qty_available: function (product, qty) { + product.qty_available = qty; + this.refresh_qty_available(product); + }, + update_product_qty_from_order_lines: function (order) { + var self = this; + order.orderlines.each(function (line) { + var product = line.get_product(); + product.qty_available -= line.get_quantity(); + self.refresh_qty_available(product); + }); + // Compatibility with pos_multi_session + order.trigger('new_updates_to_send'); + }, + after_load_server_data: function () { + var self = this; + var res = PosModelSuper.after_load_server_data + .apply(this, arguments); + _.each(this.db.product_qtys, function (v) { + _.extend(self.db.get_product_by_id(v.id), v); + }); + return res; + }, + refresh_qty_available:function (product) { + var $elem = $("[data-product-id='"+product.id+"'] .qty-tag"); + $elem.html(product.qty_available); + if (product.qty_available <= 0 && !$elem.hasClass('not-available')) { + $elem.addClass('not-available'); + } + }, + push_order: function (order, opts) { + var pushed = PosModelSuper.push_order.call(this, order, opts); + if (order) { + this.update_product_qty_from_order_lines(order); + } + return pushed; + }, + push_and_invoice_order: function (order) { + var invoiced = PosModelSuper.push_and_invoice_order + .call(this, order); + + if (order && order.get_client() && order.orderlines) { + this.update_product_qty_from_order_lines(order); + } + + return invoiced; + }, + }); + + var OrderlineSuper = models.Orderline; + models.Orderline = models.Orderline.extend({ + export_as_JSON: function () { + var data = OrderlineSuper.prototype.export_as_JSON + .apply(this, arguments); + data.qty_available = this.product.qty_available; + return data; + }, + // Compatibility with pos_multi_session + apply_ms_data: function (data) { + if (OrderlineSuper.prototype.apply_ms_data) { + OrderlineSuper.prototype.apply_ms_data.apply(this, arguments); + } + var product = this.pos.db.get_product_by_id(data.product_id); + if (product.qty_available !== data.qty_available) { + this.pos.set_product_qty_available(product, data.qty_available); + } + }, + + }); + +}); diff --git a/pos_product_qty_available/static/src/js/test_pos_quantities.js b/pos_product_qty_available/static/src/js/test_pos_quantities.js new file mode 100644 index 00000000..72a2c838 --- /dev/null +++ b/pos_product_qty_available/static/src/js/test_pos_quantities.js @@ -0,0 +1,104 @@ +/* Copyright 2018 Kolushov Alexandr + License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). */ +odoo.define('pos_product_qty_available.tour', function (require) { + "use strict"; + + var tour = require("web_tour.tour"); + var core = require('web.core'); + var _t = core._t; + + function open_pos_neworder () { + return [{ + trigger: ".o_pos_kanban button.oe_kanban_action_button", + content: _t("Click to start the point of sale interface"), + position: "bottom", + }, { + content: "Switch to table or make dummy action", + trigger: '.table, .order-button.selected', + position: "bottom", + timeout: 20000, + }, { + content: 'waiting for loading to finish', + 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: '.orderline:contains("' + product_name + '") .qty-info:contains("0")', + }]; + } + + function payment (pay_method) { + return [{ + trigger: '.button.pay', + content: _t("Open the payment screen"), + }, { + content: "Choose Administrator like a cashier", + trigger: '.modal-dialog.cashier:not(.oe_hidden) .cashier .selection-item:contains("Mitchell Admin"), .payment-screen:not(.oe_hidden) h1:contains("Payment")', + }, { + extra_trigger: '.button.paymentmethod:contains("' + pay_method +'")', + trigger: '.button.paymentmethod:contains("' + pay_method +'")', + content: _t("Click the payment method"), + }, { + trigger: '.payment-screen .input-button.number-char:contains("2")', + content: 'Set payment amount', + }, { + extra_trigger: '.button.next.highlight:contains("Validate")', + trigger: '.button.next.highlight:contains("Validate")', + content: 'Validate payment', + }, { + extra_trigger: '.pos-sale-ticket', + trigger: '.button.next.highlight:contains("Next Order")', + content: 'Check proceeded validation', + }]; + } + + function close_pos () { + return [{ + trigger: '.header-button:contains("Close")', + content: _t("Close POS"), + }, { + trigger: '.header-button.confirm:contains("Confirm")', + content: _t("Close POS"), + }, { + extra_trigger: ".o_pos_kanban button.oe_kanban_action_button", + trigger: '.breadcrumb li.active', + content: _t("Click to start the point of sale interface"), + position: "bottom", + }]; + } + + function check_quantity () { + return [{ + content: 'check quantity', + extra_trigger: '.product-list .product:contains("LED Lamp") .qty-tag.not-available:contains("-1")', + trigger: '.order-button.selected', + }]; + } + + var steps = [tour.STEPS.SHOW_APPS_MENU_ITEM, { + trigger: '.o_app[data-menu-xmlid="point_of_sale.menu_point_root"]', + content: _t("Launch your point of sale"), + position: 'right', + edition: 'community', + }, { + trigger: '.o_app[data-menu-xmlid="point_of_sale.menu_point_root"]', + content: _t("Launch your point of sale"), + position: 'bottom', + edition: 'enterprise', + }]; + steps = steps.concat(open_pos_neworder()); + steps = steps.concat(add_product_to_order('LED Lamp')); + steps = steps.concat(payment('Cash (USD)')); + steps = steps.concat(close_pos()); + steps = steps.concat(open_pos_neworder()); + steps = steps.concat(check_quantity()); + + tour.register('tour_pos_product_qty_available', {test: true, url: '/web'}, steps); + +}); diff --git a/pos_product_qty_available/static/src/xml/pos.xml b/pos_product_qty_available/static/src/xml/pos.xml new file mode 100644 index 00000000..b7525eb5 --- /dev/null +++ b/pos_product_qty_available/static/src/xml/pos.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + this.attr('t-if', "line.get_quantity_str() !== '1' || line.selected || line.get_product().qty_available lt line.quantity "); + + + + + (of ) + + + + + diff --git a/pos_product_qty_available/tests/__init__.py b/pos_product_qty_available/tests/__init__.py new file mode 100644 index 00000000..cca0a7de --- /dev/null +++ b/pos_product_qty_available/tests/__init__.py @@ -0,0 +1,3 @@ +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). + +from . import test_quantities diff --git a/pos_product_qty_available/tests/test_quantities.py b/pos_product_qty_available/tests/test_quantities.py new file mode 100644 index 00000000..32294b43 --- /dev/null +++ b/pos_product_qty_available/tests/test_quantities.py @@ -0,0 +1,34 @@ +# Copyright 2018 Ivan Yelizariev +# Copyright 2018 Kolushov Alex +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). + +import odoo.tests + + +@odoo.tests.common.at_install(True) +@odoo.tests.common.post_install(True) +class TestUi(odoo.tests.HttpCase): + + def test_pos_product_qty_available(self): + # needed because tests are run before the module is marked as + # installed. In js web will only load qweb coming from modules + # that are returned by the backend in module_boot. Without + # this you end up with js, css but no qweb. + env = self.env + env['ir.module.module'].search([('name', + '=', + 'pos_product_qty_available')], + limit=1).state = 'installed' + + env['product.template'].search([('name', '=', 'LED Lamp')]).write({ + 'type': 'product', + }) + + # 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_product_qty_available', 500)", + "odoo.__DEBUG__.services['web_tour.tour']." + "tours.tour_pos_product_qty_available.ready", + login="admin", timeout=200)