diff --git a/pos_quick_logout/README.rst b/pos_quick_logout/README.rst new file mode 100644 index 00000000..9432e1bf --- /dev/null +++ b/pos_quick_logout/README.rst @@ -0,0 +1,68 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +================== +PoS - Quick Logout +================== + +This module was written to extend the functionality of Odoo Point Of Sale about +changing of cashier. + +This module add a simple button 'Log Out' available in Point Of Sale Front End +UI. This button is available when the cashier is not the initial user logged in +Odoo. It allows to log out quickly, wihout selecting again the user in the +list. This module is useful for users that use regularly the change of cashier, +especialy with 'pos_access_right', when users doesn't have the right to do some +actions like set discount, change unit price, ... + +Implemented Features +-------------------- + +* By default, the header is unchanged + +.. image:: /pos_quick_logout/static/description/cashier_user_identical.png + + +* If the cashier changed, and is not the user logged in Odoo, the extra button +appears + +.. image:: /pos_quick_logout/static/description/cashier_user_different.png + +Usage +===== + +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/184/9.0 + +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. + +Credits +======= + +Contributors +------------ + +* Sylvain LE GAL + +Maintainer +---------- + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +This module is maintained by the OCA. + +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. + +To contribute to this module, please visit https://odoo-community.org. diff --git a/pos_quick_logout/__init__.py b/pos_quick_logout/__init__.py new file mode 100644 index 00000000..40a96afc --- /dev/null +++ b/pos_quick_logout/__init__.py @@ -0,0 +1 @@ +# -*- coding: utf-8 -*- diff --git a/pos_quick_logout/__openerp__.py b/pos_quick_logout/__openerp__.py new file mode 100644 index 00000000..9cf0d4d1 --- /dev/null +++ b/pos_quick_logout/__openerp__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +# Copyright (C) 2016-Today: La Louve () +# @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 - Quick Logout', + 'version': '9.0.1.0.0', + 'category': 'Point Of Sale', + 'summary': 'Allow PoS user to logout quickly after user changed', + 'author': 'La Louve, Odoo Community Association (OCA)', + 'website': 'http://www.lalouve.net', + 'depends': [ + 'point_of_sale', + ], + 'data': [ + 'static/src/xml/templates.xml', + ], + 'qweb': [ + 'static/src/xml/pos_quick_logout.xml', + ], + 'installable': True, +} diff --git a/pos_quick_logout/i18n/fr.po b/pos_quick_logout/i18n/fr.po new file mode 100644 index 00000000..5a4dacd6 --- /dev/null +++ b/pos_quick_logout/i18n/fr.po @@ -0,0 +1,15 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-04-03 23:52+0000\n" +"PO-Revision-Date: 2016-04-03 23:52+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" diff --git a/pos_quick_logout/static/description/cashier_user_different.png b/pos_quick_logout/static/description/cashier_user_different.png new file mode 100644 index 00000000..5c95d274 Binary files /dev/null and b/pos_quick_logout/static/description/cashier_user_different.png differ diff --git a/pos_quick_logout/static/description/cashier_user_identical.png b/pos_quick_logout/static/description/cashier_user_identical.png new file mode 100644 index 00000000..49b642ae Binary files /dev/null and b/pos_quick_logout/static/description/cashier_user_identical.png differ diff --git a/pos_quick_logout/static/description/icon.png b/pos_quick_logout/static/description/icon.png new file mode 100644 index 00000000..e8f6548b Binary files /dev/null and b/pos_quick_logout/static/description/icon.png differ diff --git a/pos_quick_logout/static/src/css/pos_quick_logout.css b/pos_quick_logout/static/src/css/pos_quick_logout.css new file mode 100644 index 00000000..fcbb4d84 --- /dev/null +++ b/pos_quick_logout/static/src/css/pos_quick_logout.css @@ -0,0 +1,15 @@ +/* + Copyright (C) 2016-Today: La Louve () + @author: Sylvain LE GAL (https://twitter.com/legalsylvain) + License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +*/ + +.pos .pos-branding .pos-logout{ + float:right; + color:#DDD; + font-size:16px; + margin-right:32px; + line-height: 48px; + font-style:italic; + cursor: pointer; +} diff --git a/pos_quick_logout/static/src/js/pos_quick_logout.js b/pos_quick_logout/static/src/js/pos_quick_logout.js new file mode 100644 index 00000000..43423686 --- /dev/null +++ b/pos_quick_logout/static/src/js/pos_quick_logout.js @@ -0,0 +1,40 @@ +/* + Copyright (C) 2016-Today: La Louve () + @author: Sylvain LE GAL (https://twitter.com/legalsylvain) + License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +*/ + +odoo.define('pos_quick_logout.pos_quick_logout', function (require) { + "use strict"; + + var chrome = require('point_of_sale.chrome'); + +/* ******************************************************** +chrome.Chrome +******************************************************** */ + chrome.Chrome.include({ + renderElement: function(){ + this._super(); + var self = this; + this.$('#pos-quick-logout').click(function(){ + self.pos.set_cashier(self.pos.user); + self.widget.username.renderElement(); + }); + }, + }); + +/* ******************************************************** +chrome.Chrome +******************************************************** */ + chrome.UsernameWidget.include({ + renderElement: function(){ + this._super(); + if (this.pos.user.id != this.pos.get_cashier().id){ + $('#pos-quick-logout').show(); + }else{ + $('#pos-quick-logout').hide(); + } + }, + }); + +}); diff --git a/pos_quick_logout/static/src/xml/pos_quick_logout.xml b/pos_quick_logout/static/src/xml/pos_quick_logout.xml new file mode 100644 index 00000000..1155ad2f --- /dev/null +++ b/pos_quick_logout/static/src/xml/pos_quick_logout.xml @@ -0,0 +1,18 @@ + + + + + + + + + Log Out + + + + + diff --git a/pos_quick_logout/static/src/xml/templates.xml b/pos_quick_logout/static/src/xml/templates.xml new file mode 100644 index 00000000..8f854d22 --- /dev/null +++ b/pos_quick_logout/static/src/xml/templates.xml @@ -0,0 +1,17 @@ + + + + +