diff --git a/pos_empty_home/README.rst b/pos_empty_home/README.rst new file mode 100644 index 0000000000..1c87cb562b --- /dev/null +++ b/pos_empty_home/README.rst @@ -0,0 +1,97 @@ +========================== +Point of Sale - Empty Home +========================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:d466ee10223c29926a9909ee242d7bf9cc24cb834e8e36ba9a555e1c854e507c + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/18.0/pos_empty_home + :alt: OCA/pos +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/pos-18-0/pos-18-0-pos_empty_home + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/pos&target_branch=18.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module extends Odoo Point Of Sale features, displaying an empty +home page at the start of the Point of Sale, or when no search is done +and no category is selected. (when root category is selected) + +This module is interesting to avoid to display useless products, when +user did not yet realized a search. (Default displayed products are just +the first eighty products) + +It can limits errors to avoid users to select undesired product. + +|image| + +.. |image| image:: https://raw.githubusercontent.com/OCA/pos/18.0/pos_empty_home/static/description/pos_empty_home.png + +**Table of contents** + +.. contents:: + :local: + +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 to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* La Louve +* GRAP + +Contributors +------------ + +- Sylvain LE GAL + <`https://twitter.com/legalsylvain\\> >`__ +- Druidoo <`https://www.druidoo.io\\> >`__ +- Dhara Solanki +- Iván Todorovich +- Helly kapatel +- `Trobz `__ + + - Phan Hong Phuc + +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/pos `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/pos_empty_home/__init__.py b/pos_empty_home/__init__.py new file mode 100644 index 0000000000..0650744f6b --- /dev/null +++ b/pos_empty_home/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/pos_empty_home/__manifest__.py b/pos_empty_home/__manifest__.py new file mode 100644 index 0000000000..c091d59cd4 --- /dev/null +++ b/pos_empty_home/__manifest__.py @@ -0,0 +1,25 @@ +# Copyright (C) 2017-Today: La Louve () +# Copyright (C) 2020-Today: Druidoo () +# @author: Sylvain LE GAL (https://twitter.com/legalsylvain) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +{ + "name": "Point of Sale - Empty Home", + "version": "18.0.1.0.0", + "category": "Point Of Sale", + "summary": "Point of Sale - Hide products if no category is selected", + "author": "La Louve, GRAP, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/pos", + "license": "AGPL-3", + "depends": ["point_of_sale"], + "data": ["views/pos_config_view.xml"], + "assets": { + "point_of_sale._assets_pos": [ + "pos_empty_home/static/src/js/product_screen.esm.js", + "pos_empty_home/static/src/xml/product_screen.xml", + ], + }, + "demo": [ + "demo/pos_empty_home_demo.xml", + ], +} diff --git a/pos_empty_home/demo/pos_empty_home_demo.xml b/pos_empty_home/demo/pos_empty_home_demo.xml new file mode 100644 index 0000000000..79a907c3de --- /dev/null +++ b/pos_empty_home/demo/pos_empty_home_demo.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/pos_empty_home/i18n/ca.po b/pos_empty_home/i18n/ca.po new file mode 100644 index 0000000000..c960d72fc7 --- /dev/null +++ b/pos_empty_home/i18n/ca.po @@ -0,0 +1,62 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_empty_home +# +# Translators: +# Marc Tormo i Bochaca , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-09 03:08+0000\n" +"PO-Revision-Date: 2022-03-23 12:17+0000\n" +"Last-Translator: Noel estudillo \n" +"Language-Team: Catalan (https://www.transifex.com/oca/teams/23907/ca/)\n" +"Language: ca\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" +"X-Generator: Weblate 4.3.2\n" + +#. module: pos_empty_home +#: model:ir.model.fields,field_description:pos_empty_home.field_pos_config__display_name +msgid "Display Name" +msgstr "" + +#. module: pos_empty_home +#: model:ir.model.fields,field_description:pos_empty_home.field_pos_config__iface_empty_home +msgid "Empty Home" +msgstr "Casa buida" + +#. module: pos_empty_home +#: model:ir.model.fields,help:pos_empty_home.field_pos_config__iface_empty_home +#: model_terms:ir.ui.view,arch_db:pos_empty_home.view_pos_config_form +msgid "Hide products if no category is selected." +msgstr "Amaga els productes si no s'ha seleccionat cap categoria." + +#. module: pos_empty_home +#: model:ir.model.fields,field_description:pos_empty_home.field_pos_config__id +msgid "ID" +msgstr "" + +#. module: pos_empty_home +#: model:ir.model.fields,field_description:pos_empty_home.field_pos_config____last_update +msgid "Last Modified on" +msgstr "" + +#. module: pos_empty_home +#: model:ir.model,name:pos_empty_home.model_pos_config +msgid "Point of Sale Configuration" +msgstr "Configuració del punt de venda" + +#. module: pos_empty_home +#. openerp-web +#: code:addons/pos_empty_home/static/src/xml/pos_empty_home.xml:0 +#, python-format +msgid "" +"To select a product, please scan a barcode or search products by category or " +"by name" +msgstr "" +"Per seleccionar un producte, si us plau llegiu un codi de barres o cerqueu " +"un producte per categoria o per nom" diff --git a/pos_empty_home/i18n/es.po b/pos_empty_home/i18n/es.po new file mode 100644 index 0000000000..53c58187c2 --- /dev/null +++ b/pos_empty_home/i18n/es.po @@ -0,0 +1,59 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_empty_home +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-03-22 22:35+0000\n" +"Last-Translator: Ivorra78 \n" +"Language-Team: none\n" +"Language: es\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" +"X-Generator: Weblate 4.17\n" + +#. module: pos_empty_home +#: model:ir.model.fields,field_description:pos_empty_home.field_pos_config__display_name +msgid "Display Name" +msgstr "Mostrar Nombre" + +#. module: pos_empty_home +#: model:ir.model.fields,field_description:pos_empty_home.field_pos_config__iface_empty_home +msgid "Empty Home" +msgstr "Hogar Vacío" + +#. module: pos_empty_home +#: model:ir.model.fields,help:pos_empty_home.field_pos_config__iface_empty_home +#: model_terms:ir.ui.view,arch_db:pos_empty_home.view_pos_config_form +msgid "Hide products if no category is selected." +msgstr "Ocultar productos si no se selecciona ninguna categoría." + +#. module: pos_empty_home +#: model:ir.model.fields,field_description:pos_empty_home.field_pos_config__id +msgid "ID" +msgstr "ID" + +#. module: pos_empty_home +#: model:ir.model.fields,field_description:pos_empty_home.field_pos_config____last_update +msgid "Last Modified on" +msgstr "Úlima modificación el" + +#. module: pos_empty_home +#: model:ir.model,name:pos_empty_home.model_pos_config +msgid "Point of Sale Configuration" +msgstr "Configuración del Punto de Venta" + +#. module: pos_empty_home +#. openerp-web +#: code:addons/pos_empty_home/static/src/xml/pos_empty_home.xml:0 +#, python-format +msgid "" +"To select a product, please scan a barcode or search products by category or " +"by name" +msgstr "" +"Para seleccionar un producto, escanee un código de barras o busque productos " +"por categoría o por nombre" diff --git a/pos_empty_home/i18n/fr.po b/pos_empty_home/i18n/fr.po new file mode 100644 index 0000000000..af6b5d4feb --- /dev/null +++ b/pos_empty_home/i18n/fr.po @@ -0,0 +1,60 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_empty_home +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-05-05 09:32+0000\n" +"PO-Revision-Date: 2024-06-28 20:47+0000\n" +"Last-Translator: Julie LeBrun \n" +"Language-Team: \n" +"Language: fr\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" +"X-Generator: Weblate 4.17\n" + +#. module: pos_empty_home +#: model:ir.model.fields,field_description:pos_empty_home.field_pos_config__display_name +msgid "Display Name" +msgstr "Nom d'affichage" + +#. module: pos_empty_home +#: model:ir.model.fields,field_description:pos_empty_home.field_pos_config__iface_empty_home +msgid "Empty Home" +msgstr "Accueil vide" + +#. module: pos_empty_home +#: model:ir.model.fields,help:pos_empty_home.field_pos_config__iface_empty_home +#: model_terms:ir.ui.view,arch_db:pos_empty_home.view_pos_config_form +msgid "Hide products if no category is selected." +msgstr "Masquer les articles si aucune catégorie n'est sélectionnée." + +#. module: pos_empty_home +#: model:ir.model.fields,field_description:pos_empty_home.field_pos_config__id +msgid "ID" +msgstr "ID" + +#. module: pos_empty_home +#: model:ir.model.fields,field_description:pos_empty_home.field_pos_config____last_update +msgid "Last Modified on" +msgstr "Dernière modification le" + +#. module: pos_empty_home +#: model:ir.model,name:pos_empty_home.model_pos_config +msgid "Point of Sale Configuration" +msgstr "Configuration du point de vente" + +#. module: pos_empty_home +#. openerp-web +#: code:addons/pos_empty_home/static/src/xml/pos_empty_home.xml:0 +#, python-format +msgid "" +"To select a product, please scan a barcode or search products by category or " +"by name" +msgstr "" +"Pour sélectionner un produit, veuillez scanner un code barre, ou bien " +"réaliser une recherche de produits par catégorie ou par nom" diff --git a/pos_empty_home/i18n/it.po b/pos_empty_home/i18n/it.po new file mode 100644 index 0000000000..4e573b51ad --- /dev/null +++ b/pos_empty_home/i18n/it.po @@ -0,0 +1,59 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_empty_home +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-03-16 13:22+0000\n" +"Last-Translator: mymage \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" +"X-Generator: Weblate 4.14.1\n" + +#. module: pos_empty_home +#: model:ir.model.fields,field_description:pos_empty_home.field_pos_config__display_name +msgid "Display Name" +msgstr "Nome visualizzato" + +#. module: pos_empty_home +#: model:ir.model.fields,field_description:pos_empty_home.field_pos_config__iface_empty_home +msgid "Empty Home" +msgstr "Prima pagina vuota" + +#. module: pos_empty_home +#: model:ir.model.fields,help:pos_empty_home.field_pos_config__iface_empty_home +#: model_terms:ir.ui.view,arch_db:pos_empty_home.view_pos_config_form +msgid "Hide products if no category is selected." +msgstr "Nasconde i prodotti se non è selezionata una categoria." + +#. module: pos_empty_home +#: model:ir.model.fields,field_description:pos_empty_home.field_pos_config__id +msgid "ID" +msgstr "ID" + +#. module: pos_empty_home +#: model:ir.model.fields,field_description:pos_empty_home.field_pos_config____last_update +msgid "Last Modified on" +msgstr "Ultima modifica il" + +#. module: pos_empty_home +#: model:ir.model,name:pos_empty_home.model_pos_config +msgid "Point of Sale Configuration" +msgstr "Configurazione punto vendita" + +#. module: pos_empty_home +#. openerp-web +#: code:addons/pos_empty_home/static/src/xml/pos_empty_home.xml:0 +#, python-format +msgid "" +"To select a product, please scan a barcode or search products by category or " +"by name" +msgstr "" +"Per selezionare un prodotto, leggere un codice a barre o cercare un prodotto " +"per nome o categoria" diff --git a/pos_empty_home/i18n/pos_empty_home.pot b/pos_empty_home/i18n/pos_empty_home.pot new file mode 100644 index 0000000000..08bf82b1d8 --- /dev/null +++ b/pos_empty_home/i18n/pos_empty_home.pot @@ -0,0 +1,54 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_empty_home +# +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" + +#. module: pos_empty_home +#: model:ir.model.fields,field_description:pos_empty_home.field_pos_config__display_name +msgid "Display Name" +msgstr "" + +#. module: pos_empty_home +#: model:ir.model.fields,field_description:pos_empty_home.field_pos_config__iface_empty_home +msgid "Empty Home" +msgstr "" + +#. module: pos_empty_home +#: model:ir.model.fields,help:pos_empty_home.field_pos_config__iface_empty_home +#: model_terms:ir.ui.view,arch_db:pos_empty_home.view_pos_config_form +msgid "Hide products if no category is selected." +msgstr "" + +#. module: pos_empty_home +#: model:ir.model.fields,field_description:pos_empty_home.field_pos_config__id +msgid "ID" +msgstr "" + +#. module: pos_empty_home +#: model:ir.model.fields,field_description:pos_empty_home.field_pos_config____last_update +msgid "Last Modified on" +msgstr "" + +#. module: pos_empty_home +#: model:ir.model,name:pos_empty_home.model_pos_config +msgid "Point of Sale Configuration" +msgstr "" + +#. module: pos_empty_home +#. openerp-web +#: code:addons/pos_empty_home/static/src/xml/pos_empty_home.xml:0 +#, python-format +msgid "" +"To select a product, please scan a barcode or search products by category or" +" by name" +msgstr "" diff --git a/pos_empty_home/models/__init__.py b/pos_empty_home/models/__init__.py new file mode 100644 index 0000000000..db8634ade1 --- /dev/null +++ b/pos_empty_home/models/__init__.py @@ -0,0 +1 @@ +from . import pos_config diff --git a/pos_empty_home/models/pos_config.py b/pos_empty_home/models/pos_config.py new file mode 100644 index 0000000000..487fe130f6 --- /dev/null +++ b/pos_empty_home/models/pos_config.py @@ -0,0 +1,14 @@ +# Copyright 2021 Iván Todorovich +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import fields, models + + +class PosConfig(models.Model): + _inherit = "pos.config" + + iface_empty_home = fields.Boolean( + string="Empty Home", + help="Hide products if no category is selected.", + default=False, + ) diff --git a/pos_empty_home/pyproject.toml b/pos_empty_home/pyproject.toml new file mode 100644 index 0000000000..4231d0cccb --- /dev/null +++ b/pos_empty_home/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/pos_empty_home/readme/CONTRIBUTORS.md b/pos_empty_home/readme/CONTRIBUTORS.md new file mode 100644 index 0000000000..905b9b603a --- /dev/null +++ b/pos_empty_home/readme/CONTRIBUTORS.md @@ -0,0 +1,7 @@ +- Sylvain LE GAL \ +- Druidoo \ +- Dhara Solanki \ +- Iván Todorovich \ +- Helly kapatel \ +- [Trobz](https://www.trobz.com) + - Phan Hong Phuc \ diff --git a/pos_empty_home/readme/DESCRIPTION.md b/pos_empty_home/readme/DESCRIPTION.md new file mode 100644 index 0000000000..2c2affaf04 --- /dev/null +++ b/pos_empty_home/readme/DESCRIPTION.md @@ -0,0 +1,11 @@ +This module extends Odoo Point Of Sale features, displaying an empty +home page at the start of the Point of Sale, or when no search is done +and no category is selected. (when root category is selected) + +This module is interesting to avoid to display useless products, when +user did not yet realized a search. (Default displayed products are just +the first eighty products) + +It can limits errors to avoid users to select undesired product. + +![image](../static/description/pos_empty_home.png) diff --git a/pos_empty_home/static/description/icon.png b/pos_empty_home/static/description/icon.png new file mode 100644 index 0000000000..944554478b Binary files /dev/null and b/pos_empty_home/static/description/icon.png differ diff --git a/pos_empty_home/static/description/index.html b/pos_empty_home/static/description/index.html new file mode 100644 index 0000000000..a84aeda411 --- /dev/null +++ b/pos_empty_home/static/description/index.html @@ -0,0 +1,440 @@ + + + + + +Point of Sale - Empty Home + + + +
+

Point of Sale - Empty Home

+ + +

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

+

This module extends Odoo Point Of Sale features, displaying an empty +home page at the start of the Point of Sale, or when no search is done +and no category is selected. (when root category is selected)

+

This module is interesting to avoid to display useless products, when +user did not yet realized a search. (Default displayed products are just +the first eighty products)

+

It can limits errors to avoid users to select undesired product.

+

image

+

Table of contents

+ +
+

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 to smash it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • La Louve
  • +
  • GRAP
  • +
+
+
+

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.

+

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_empty_home/static/description/pos_empty_home.png b/pos_empty_home/static/description/pos_empty_home.png new file mode 100644 index 0000000000..d177af3329 Binary files /dev/null and b/pos_empty_home/static/description/pos_empty_home.png differ diff --git a/pos_empty_home/static/src/js/product_screen.esm.js b/pos_empty_home/static/src/js/product_screen.esm.js new file mode 100644 index 0000000000..f46c12e286 --- /dev/null +++ b/pos_empty_home/static/src/js/product_screen.esm.js @@ -0,0 +1,17 @@ +import {ProductScreen} from "@point_of_sale/app/screens/product_screen/product_screen"; +import {patch} from "@web/core/utils/patch"; + +patch(ProductScreen.prototype, { + get isShowEmptyHome() { + return ( + this.pos.config.iface_empty_home && + this.pos.session._has_available_products && + !this.pos.selectedCategory && + this.searchWord == "" + ); + }, + + get productsToDisplay() { + return this.isShowEmptyHome ? [] : super.productsToDisplay; + }, +}); diff --git a/pos_empty_home/static/src/xml/product_screen.xml b/pos_empty_home/static/src/xml/product_screen.xml new file mode 100644 index 0000000000..8f150e7b47 --- /dev/null +++ b/pos_empty_home/static/src/xml/product_screen.xml @@ -0,0 +1,16 @@ + + + + + +

To select a product, please scan a barcode or search products by category or by name.

+
+
+
diff --git a/pos_empty_home/views/pos_config_view.xml b/pos_empty_home/views/pos_config_view.xml new file mode 100644 index 0000000000..73348b227d --- /dev/null +++ b/pos_empty_home/views/pos_config_view.xml @@ -0,0 +1,18 @@ + + + + pos.config + + + + + + + + + +