diff --git a/pos_disable_change_cashier/README.rst b/pos_disable_change_cashier/README.rst new file mode 100644 index 00000000..4a3a7657 --- /dev/null +++ b/pos_disable_change_cashier/README.rst @@ -0,0 +1,70 @@ +====================================== +Point of Sale - Disable Change Cashier +====================================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! 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-legalsylvain%2Fpos-lightgray.png?logo=github + :target: https://github.com/legalsylvain/pos/tree/12.0-pos_disable_change_cashier/pos_disable_change_cashier + :alt: legalsylvain/pos + +|badge1| |badge2| |badge3| + +This module extends Odoo Point Of Sale features, allowing to disable +the button that allow to switch cashiers. + +It can be interested in small shops and in multi company context, +when the pop up displays a lot of users that are not cashiers. + +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +Once installed, the button is disabled by default. + +You can enable it in the point configuration. + + .. figure:: https://raw.githubusercontent.com/legalsylvain/pos/12.0-pos_disable_change_cashier/pos_disable_change_cashier/static/description/pos_config_form.png + +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 +~~~~~~~ + +* GRAP + +Contributors +~~~~~~~~~~~~ + +* Sylvain LE GAL + +Maintainers +~~~~~~~~~~~ + +This module is part of the `legalsylvain/pos `_ project on GitHub. + +You are welcome to contribute. diff --git a/pos_disable_change_cashier/__init__.py b/pos_disable_change_cashier/__init__.py new file mode 100644 index 00000000..0650744f --- /dev/null +++ b/pos_disable_change_cashier/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/pos_disable_change_cashier/__manifest__.py b/pos_disable_change_cashier/__manifest__.py new file mode 100644 index 00000000..e177e61d --- /dev/null +++ b/pos_disable_change_cashier/__manifest__.py @@ -0,0 +1,20 @@ +# Copyright (C) 2020 - Today: GRAP (http://www.grap.coop) +# @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 - Disable Change Cashier', + 'version': '12.0.1.0.0', + 'category': 'Point Of Sale', + 'summary': 'Disable the feature that allow to change cashier in the PoS', + 'author': 'GRAP, Odoo Community Association (OCA)', + 'website': 'https://github.com/OCA/pos', + 'license': 'AGPL-3', + 'depends': [ + 'point_of_sale', + ], + 'data': [ + 'views/assets.xml', + 'views/pos_config.xml', + ], +} diff --git a/pos_disable_change_cashier/i18n/fr.po b/pos_disable_change_cashier/i18n/fr.po new file mode 100644 index 00000000..f2e7e07c --- /dev/null +++ b/pos_disable_change_cashier/i18n/fr.po @@ -0,0 +1,33 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_disable_change_cashier +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2020-09-03 13:47+0000\n" +"PO-Revision-Date: 2020-09-03 13:47+0000\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_disable_change_cashier +#: model:ir.model.fields,field_description:pos_disable_change_cashier.field_pos_config__iface_change_cashier +msgid "Change Cashier" +msgstr "Changer de caissier" + +#. module: pos_disable_change_cashier +#: model:ir.model.fields,help:pos_disable_change_cashier.field_pos_config__iface_change_cashier +#: model_terms:ir.ui.view,arch_db:pos_disable_change_cashier.pos_config_view_form +msgid "Enable the possibility to change cashier" +msgstr "Activer la possibilité de changer de caissier" + +#. module: pos_disable_change_cashier +#: model:ir.model,name:pos_disable_change_cashier.model_pos_config +msgid "Point of Sale Configuration" +msgstr "Paramétrage du point de vente" + diff --git a/pos_disable_change_cashier/models/__init__.py b/pos_disable_change_cashier/models/__init__.py new file mode 100644 index 00000000..db8634ad --- /dev/null +++ b/pos_disable_change_cashier/models/__init__.py @@ -0,0 +1 @@ +from . import pos_config diff --git a/pos_disable_change_cashier/models/pos_config.py b/pos_disable_change_cashier/models/pos_config.py new file mode 100644 index 00000000..9db1558a --- /dev/null +++ b/pos_disable_change_cashier/models/pos_config.py @@ -0,0 +1,14 @@ +# Copyright (C) 2020 - Today: GRAP (http://www.grap.coop) +# @author: Sylvain LE GAL (https://twitter.com/legalsylvain) +# 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_change_cashier = fields.Boolean( + string="Change Cashier", + help="Enable the possibility to change cashier" + ) diff --git a/pos_disable_change_cashier/readme/CONFIGURE.rst b/pos_disable_change_cashier/readme/CONFIGURE.rst new file mode 100644 index 00000000..f3ab1a32 --- /dev/null +++ b/pos_disable_change_cashier/readme/CONFIGURE.rst @@ -0,0 +1,5 @@ +Once installed, the button is disabled by default. + +You can enable it in the point configuration. + + .. figure:: ../static/description/pos_config_form.png diff --git a/pos_disable_change_cashier/readme/CONTRIBUTORS.rst b/pos_disable_change_cashier/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000..9f76a75b --- /dev/null +++ b/pos_disable_change_cashier/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* Sylvain LE GAL diff --git a/pos_disable_change_cashier/readme/DESCRIPTION.rst b/pos_disable_change_cashier/readme/DESCRIPTION.rst new file mode 100644 index 00000000..c1ae162d --- /dev/null +++ b/pos_disable_change_cashier/readme/DESCRIPTION.rst @@ -0,0 +1,5 @@ +This module extends Odoo Point Of Sale features, allowing to disable +the button that allow to switch cashiers. + +It can be interested in small shops and in multi company context, +when the pop up displays a lot of users that are not cashiers. diff --git a/pos_disable_change_cashier/static/description/pos_config_form.png b/pos_disable_change_cashier/static/description/pos_config_form.png new file mode 100644 index 00000000..60f583ac Binary files /dev/null and b/pos_disable_change_cashier/static/description/pos_config_form.png differ diff --git a/pos_disable_change_cashier/static/src/js/chrome.js b/pos_disable_change_cashier/static/src/js/chrome.js new file mode 100644 index 00000000..cd361b89 --- /dev/null +++ b/pos_disable_change_cashier/static/src/js/chrome.js @@ -0,0 +1,21 @@ +/* + Copyright (C) 2020 - Today: GRAP (http://www.grap.coop) + @author: Sylvain LE GAL (https://twitter.com/legalsylvain) + License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +*/ + + +odoo.define('pos_empty_home.screens', function (require) { + "use strict"; + + var chrome = require('point_of_sale.chrome'); + + chrome.UsernameWidget.include({ + click_username: function(){ + if (this.pos.config.iface_change_cashier) { + this._super(); + } + }, + }); + +}); diff --git a/pos_disable_change_cashier/views/assets.xml b/pos_disable_change_cashier/views/assets.xml new file mode 100644 index 00000000..174d585e --- /dev/null +++ b/pos_disable_change_cashier/views/assets.xml @@ -0,0 +1,14 @@ + + + + + + diff --git a/pos_disable_change_cashier/views/pos_config.xml b/pos_disable_change_cashier/views/pos_config.xml new file mode 100644 index 00000000..54efde3c --- /dev/null +++ b/pos_disable_change_cashier/views/pos_config.xml @@ -0,0 +1,31 @@ + + + + + + + pos.config + + + +
+
+ +
+
+
+
+
+
+
+ + +