diff --git a/pos_reset_search/README.rst b/pos_reset_search/README.rst new file mode 100644 index 0000000000..c415fe766c --- /dev/null +++ b/pos_reset_search/README.rst @@ -0,0 +1,90 @@ +============================================= +Point of Sale - Clear product search on click +============================================= + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! 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-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpos-lightgray.png?logo=github + :target: https://github.com/OCA/pos/tree/14.0/pos_reset_search + :alt: OCA/pos +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/pos-14-0/pos-14-0-pos_reset_search + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/184/14.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +The POS search workflow is to type the product name until there is only one product left to be selected. Then the user will select the product by typing on the "enter" key. To select a product clears the search. This workflow is very efficient but it requires training. + +This add-on completes the POS search workflow for beginners. This add-on enables users to search and narrow down the product selection to a handful of products. The user can then use the mouse and click on the product to select. To click on the product clears the search. The default workflow is still usable for trained users. This new workflow is deemed less efficient but has proven to help beginners. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +Simply install this addon, search a product in point of sale, and click on the product you want to add to the order, you'll see the search is cleared when you click. + +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 +~~~~~~~ + +* Le Nid + +Contributors +~~~~~~~~~~~~ + +* Le Nid +* CoopITEasy +* Dhara Solanki + +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. + +.. |maintainer-fkawala| image:: https://github.com/fkawala.png?size=40px + :target: https://github.com/fkawala + :alt: fkawala + +Current `maintainer `__: + +|maintainer-fkawala| + +This module is part of the `OCA/pos `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/pos_reset_search/__init__.py b/pos_reset_search/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/pos_reset_search/__manifest__.py b/pos_reset_search/__manifest__.py new file mode 100644 index 0000000000..eaaf553da9 --- /dev/null +++ b/pos_reset_search/__manifest__.py @@ -0,0 +1,21 @@ +# @author: François Kawala +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +{ + "name": "Point of Sale - Clear product search on click", + "version": "16.0.1.0.0", + "category": "Point of Sale", + "summary": "Point of Sale - Clear product search when user clicks on a product.", + "author": "Le Nid, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/pos", + "license": "AGPL-3", + "maintainers": ["fkawala"], + "depends": [ + "point_of_sale", + ], + "assets": { + "point_of_sale.assets": [ + "/pos_reset_search/static/src/js/Screens/ProductScreen/ProductScreen.js", + ], + }, + "installable": True, +} diff --git a/pos_reset_search/i18n/es.po b/pos_reset_search/i18n/es.po new file mode 100644 index 0000000000..e69de29bb2 diff --git a/pos_reset_search/i18n/it.po b/pos_reset_search/i18n/it.po new file mode 100644 index 0000000000..9ce4346f63 --- /dev/null +++ b/pos_reset_search/i18n/it.po @@ -0,0 +1,14 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" diff --git a/pos_reset_search/i18n/pos_reset_search.pot b/pos_reset_search/i18n/pos_reset_search.pot new file mode 100644 index 0000000000..4d8b20f912 --- /dev/null +++ b/pos_reset_search/i18n/pos_reset_search.pot @@ -0,0 +1,13 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" diff --git a/pos_reset_search/readme/CONTRIBUTORS.rst b/pos_reset_search/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000000..d6ecffab8d --- /dev/null +++ b/pos_reset_search/readme/CONTRIBUTORS.rst @@ -0,0 +1,3 @@ +* Le Nid +* CoopITEasy +* Dhara Solanki diff --git a/pos_reset_search/readme/DESCRIPTION.rst b/pos_reset_search/readme/DESCRIPTION.rst new file mode 100644 index 0000000000..a0f140b6d8 --- /dev/null +++ b/pos_reset_search/readme/DESCRIPTION.rst @@ -0,0 +1,3 @@ +The POS search workflow is to type the product name until there is only one product left to be selected. Then the user will select the product by typing on the "enter" key. To select a product clears the search. This workflow is very efficient but it requires training. + +This add-on completes the POS search workflow for beginners. This add-on enables users to search and narrow down the product selection to a handful of products. The user can then use the mouse and click on the product to select. To click on the product clears the search. The default workflow is still usable for trained users. This new workflow is deemed less efficient but has proven to help beginners. diff --git a/pos_reset_search/readme/USAGE.rst b/pos_reset_search/readme/USAGE.rst new file mode 100644 index 0000000000..9a38f888a8 --- /dev/null +++ b/pos_reset_search/readme/USAGE.rst @@ -0,0 +1 @@ +Simply install this addon, search a product in point of sale, and click on the product you want to add to the order, you'll see the search is cleared when you click. diff --git a/pos_reset_search/static/description/icon.png b/pos_reset_search/static/description/icon.png new file mode 100644 index 0000000000..3a0328b516 Binary files /dev/null and b/pos_reset_search/static/description/icon.png differ diff --git a/pos_reset_search/static/description/index.html b/pos_reset_search/static/description/index.html new file mode 100644 index 0000000000..87c3ad3af7 --- /dev/null +++ b/pos_reset_search/static/description/index.html @@ -0,0 +1,429 @@ + + + + + + +Point of Sale - Clear product search on click + + + +
+

Point of Sale - Clear product search on click

+ + +

Beta License: AGPL-3 OCA/pos Translate me on Weblate Try me on Runbot

+

The POS search workflow is to type the product name until there is only one product left to be selected. Then the user will select the product by typing on the “enter” key. To select a product clears the search. This workflow is very efficient but it requires training.

+

This add-on completes the POS search workflow for beginners. This add-on enables users to search and narrow down the product selection to a handful of products. The user can then use the mouse and click on the product to select. To click on the product clears the search. The default workflow is still usable for trained users. This new workflow is deemed less efficient but has proven to help beginners.

+

Table of contents

+ +
+

Usage

+

Simply install this addon, search a product in point of sale, and click on the product you want to add to the order, you’ll see the search is cleared when you click.

+
+
+

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

+
    +
  • Le Nid
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

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.

+

Current maintainer:

+

fkawala

+

This module is part of the OCA/pos project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/pos_reset_search/static/src/js/Screens/ProductScreen/ProductScreen.js b/pos_reset_search/static/src/js/Screens/ProductScreen/ProductScreen.js new file mode 100644 index 0000000000..a7ee7255b8 --- /dev/null +++ b/pos_reset_search/static/src/js/Screens/ProductScreen/ProductScreen.js @@ -0,0 +1,43 @@ +odoo.define("pos_reset_search.ProductScreen", function (require) { + "use strict"; + + const ProductScreen = require("point_of_sale.ProductScreen"); + const Registries = require("point_of_sale.Registries"); + + const PosProductScreen = (PaymentScreen_) => + class extends PaymentScreen_ { + async _clickProduct(event) { + const ProductScreenChildren = this.__owl__.children; + var ProductWidget = null; + for (const key in ProductScreenChildren) { + if ( + ProductScreenChildren[key].bdom.el.className === + "products-widget" + ) { + ProductWidget = ProductScreenChildren[key]; + } + } + if (ProductWidget) { + const ProductWidgetChildren = ProductWidget.children; + + var ProductsWidgetControlPanel = null; + for (const key in ProductWidgetChildren) { + if ( + ProductWidgetChildren[key].bdom.el.className === + "products-widget-control" + ) { + ProductsWidgetControlPanel = ProductWidgetChildren[key]; + } + } + if (ProductsWidgetControlPanel) { + ProductsWidgetControlPanel.component._clearSearch(); + } + } + return super._clickProduct(event); + } + }; + + Registries.Component.extend(ProductScreen, PosProductScreen); + + return PosProductScreen; +}); diff --git a/setup/pos_reset_search/odoo/addons/pos_reset_search b/setup/pos_reset_search/odoo/addons/pos_reset_search new file mode 120000 index 0000000000..32e3e3cace --- /dev/null +++ b/setup/pos_reset_search/odoo/addons/pos_reset_search @@ -0,0 +1 @@ +../../../../pos_reset_search \ No newline at end of file diff --git a/setup/pos_reset_search/setup.py b/setup/pos_reset_search/setup.py new file mode 100644 index 0000000000..28c57bb640 --- /dev/null +++ b/setup/pos_reset_search/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)