diff --git a/pos_cashier_login/README.rst b/pos_cashier_login/README.rst new file mode 100644 index 00000000..2ca45a68 --- /dev/null +++ b/pos_cashier_login/README.rst @@ -0,0 +1,87 @@ +=================== +POS - Cashier login +=================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! 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%2Fserver--auth-lightgray.png?logo=github + :target: https://github.com/OCA/server-auth/tree/11.0/pos_cashier_login + :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_cashier_login + :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 will require for the cashier to "sign in", in the PoS, each time a new order is created. This can reduce the likelihood that a the user creates an order under a different cashier. It works best if PoS barcodes and PIN (Settings > Users > Point of Sale) are used on users but it is also possible to switch the cashier using the selection widget. In this way the users can quickly scan themselves and a PIN will be requested only when a different user is switched. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +After installing the module the cashier will have to be selected before each order. + +With scanner: + +* Set Barcode and PIN on all users (Settings > Users > Point of Sale) which will work in the PoS. +* Print User Labels (Setting > Users > Print) +* Scan label in PoS to start a new order + +Without scanner: +* Switch/or select same using the cashier selection widget (top left) to start a new order + +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 +~~~~~~~ + +* Lambda IS + +Contributors +~~~~~~~~~~~~ + +* Kiril Vangelovski + +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_cashier_login/__init__.py b/pos_cashier_login/__init__.py new file mode 100644 index 00000000..6ac02ac2 --- /dev/null +++ b/pos_cashier_login/__init__.py @@ -0,0 +1,3 @@ +# Copyright (C) 2019 by Lambda IS + +from . import models diff --git a/pos_cashier_login/__manifest__.py b/pos_cashier_login/__manifest__.py new file mode 100755 index 00000000..02756087 --- /dev/null +++ b/pos_cashier_login/__manifest__.py @@ -0,0 +1,22 @@ +# Copyright (C) 2019 by Lambda IS +{ + 'name': 'POS - Cashier login', + 'category': 'Point Of Sale', + 'author': 'Lambda IS, ' + 'Odoo Community Association (OCA)', + 'website': 'https://odoo-community.org/', + 'license': 'AGPL-3', + 'summary': 'Require for cashier to sign in before each sale', + 'version': '11.0.0.1.0', + 'depends': [ + 'point_of_sale', + ], + 'data': [ + 'views/assets.xml', + 'views/pos_config.xml', + ], + 'qweb': [ + 'static/src/xml/main.xml', + ], + 'installable': True, +} diff --git a/pos_cashier_login/models/__init__.py b/pos_cashier_login/models/__init__.py new file mode 100644 index 00000000..ece5c988 --- /dev/null +++ b/pos_cashier_login/models/__init__.py @@ -0,0 +1,3 @@ +# Copyright (C) 2019 by Lambda IS + +from . import pos_config diff --git a/pos_cashier_login/models/pos_config.py b/pos_cashier_login/models/pos_config.py new file mode 100644 index 00000000..b8b09c43 --- /dev/null +++ b/pos_cashier_login/models/pos_config.py @@ -0,0 +1,11 @@ +# Copyright (C) 2019 by Lambda IS + +from odoo import fields, models + + +class POSConfig(models.Model): + _inherit = 'pos.config' + + require_cashier_login = fields.Boolean( + string='Cashier Login', + help='Require for cashier to be selected before each new sale') diff --git a/pos_cashier_login/readme/CONTRIBUTORS.rst b/pos_cashier_login/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000..12806534 --- /dev/null +++ b/pos_cashier_login/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* Kiril Vangelovski diff --git a/pos_cashier_login/readme/DESCRIPTION.rst b/pos_cashier_login/readme/DESCRIPTION.rst new file mode 100644 index 00000000..e301be2c --- /dev/null +++ b/pos_cashier_login/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +This module will require for the cashier to "sign in", in the PoS, each time a new order is created. This can reduce the likelihood that a the user creates an order under a different cashier. It works best if PoS barcodes and PIN (Settings > Users > Point of Sale) are used on users but it is also possible to switch the cashier using the selection widget. In this way the users can quickly scan themselves and a PIN will be requested only when a different user is switched. diff --git a/pos_cashier_login/readme/USAGE.rst b/pos_cashier_login/readme/USAGE.rst new file mode 100644 index 00000000..4196efd3 --- /dev/null +++ b/pos_cashier_login/readme/USAGE.rst @@ -0,0 +1,10 @@ +After installing the module the cashier will have to be selected before each order. + +With scanner: + +* Set Barcode and PIN on all users (Settings > Users > Point of Sale) which will work in the PoS. +* Print User Labels (Setting > Users > Print) +* Scan label in PoS to start a new order + +Without scanner: +* Switch/or select same using the cashier selection widget (top left) to start a new order diff --git a/pos_cashier_login/static/description/icon.png b/pos_cashier_login/static/description/icon.png new file mode 100755 index 00000000..7339fd8e Binary files /dev/null and b/pos_cashier_login/static/description/icon.png differ diff --git a/pos_cashier_login/static/description/index.html b/pos_cashier_login/static/description/index.html new file mode 100644 index 00000000..93c0d998 --- /dev/null +++ b/pos_cashier_login/static/description/index.html @@ -0,0 +1,432 @@ + + + + + + +POS - Cashier login + + + +
+

POS - Cashier login

+ + +

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

+

This module will require for the cashier to “sign in”, in the PoS, each time a new order is created. This can reduce the likelihood that a the user creates an order under a different cashier. It works best if PoS barcodes and PIN (Settings > Users > Point of Sale) are used on users but it is also possible to switch the cashier using the selection widget. In this way the users can quickly scan themselves and a PIN will be requested only when a different user is switched.

+

Table of contents

+ +
+

Usage

+

After installing the module the cashier will have to be selected before each order.

+

With scanner:

+
    +
  • Set Barcode and PIN on all users (Settings > Users > Point of Sale) which will work in the PoS.
  • +
  • Print User Labels (Setting > Users > Print)
  • +
  • Scan label in PoS to start a new order
  • +
+

Without scanner: +* Switch/or select same using the cashier selection widget (top left) to start a new order

+
+
+

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

+
    +
  • Lambda IS
  • +
+
+
+

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/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_cashier_login/static/src/css/main.css b/pos_cashier_login/static/src/css/main.css new file mode 100644 index 00000000..4fbdd603 --- /dev/null +++ b/pos_cashier_login/static/src/css/main.css @@ -0,0 +1,5 @@ + +.cashier-login-screen .screen-content, +.cashier-login-screen .centered-content { + border: none !important; +} diff --git a/pos_cashier_login/static/src/js/main.js b/pos_cashier_login/static/src/js/main.js new file mode 100755 index 00000000..cfff14a5 --- /dev/null +++ b/pos_cashier_login/static/src/js/main.js @@ -0,0 +1,42 @@ +// Copyright (C) 2019 by Lambda IS + +odoo.define('pos_cashier_login.main', function (require) { + 'use strict'; + + var gui = require('point_of_sale.gui'); + var screens = require('point_of_sale.screens'); + var chrome = require('point_of_sale.chrome'); + var pos_models = require('point_of_sale.models'); + var SuperPosModel = pos_models.PosModel.prototype; + + pos_models.PosModel = pos_models.PosModel.extend({ + set_cashier: function(user){ + SuperPosModel.set_cashier.call(this, user); + if (this.gui.screen_instances['products']) { + this.gui.show_screen('products'); + } + }, + }); + + chrome.Chrome.include({ + build_widgets: function() { + this._super(); + if (this.pos.config.require_cashier_login) { + this.gui.set_startup_screen('cashier-login'); + this.gui.set_default_screen('cashier-login'); + } + }, + }); + + var CashierLoginScreenWidget = screens.ScreenWidget.extend({ + template: 'CashierLoginScreenWidget', + + // override all barcode actions other than + // barcode_cashier_action to do nothing + barcode_product_action: function(code){}, + barcode_client_action: function(code){}, + barcode_discount_action: function(code){}, + }); + + gui.define_screen({name: 'cashier-login', widget: CashierLoginScreenWidget}); +}) diff --git a/pos_cashier_login/static/src/xml/main.xml b/pos_cashier_login/static/src/xml/main.xml new file mode 100644 index 00000000..55dfe175 --- /dev/null +++ b/pos_cashier_login/static/src/xml/main.xml @@ -0,0 +1,14 @@ + + + + + + + + diff --git a/pos_cashier_login/views/assets.xml b/pos_cashier_login/views/assets.xml new file mode 100644 index 00000000..4719f0f8 --- /dev/null +++ b/pos_cashier_login/views/assets.xml @@ -0,0 +1,12 @@ + + + + + + + diff --git a/pos_cashier_login/views/pos_config.xml b/pos_cashier_login/views/pos_config.xml new file mode 100644 index 00000000..203b7e3a --- /dev/null +++ b/pos_cashier_login/views/pos_config.xml @@ -0,0 +1,25 @@ + + + + + + pos.config + + + +
+
+ +
+
+
+
+
+
+
+ +