Browse Source

Merge a092fb7cbe into 050828d7a0

pull/396/merge
Ammar Officewala 4 years ago
committed by GitHub
parent
commit
466219f5f4
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 93
      pos_access_right/README.rst
  2. 1
      pos_access_right/__init__.py
  3. 24
      pos_access_right/__manifest__.py
  4. 33
      pos_access_right/demo/res_groups.xml
  5. 191
      pos_access_right/i18n/ca.po
  6. 189
      pos_access_right/i18n/fr.po
  7. 152
      pos_access_right/i18n/pos_access_right.pot
  8. 169
      pos_access_right/i18n/ru.po
  9. 1
      pos_access_right/models/__init__.py
  10. 81
      pos_access_right/models/pos_config.py
  11. 1
      pos_access_right/readme/CONFIGURE.rst
  12. 2
      pos_access_right/readme/CONTRIBUTORS.rst
  13. 7
      pos_access_right/readme/DESCRIPTION.rst
  14. 3
      pos_access_right/readme/USAGE.rst
  15. 39
      pos_access_right/security/res_groups.xml
  16. BIN
      pos_access_right/static/description/admin_numpad.png
  17. BIN
      pos_access_right/static/description/demo_error.png
  18. BIN
      pos_access_right/static/description/demo_numpad.png
  19. BIN
      pos_access_right/static/description/icon.png
  20. 438
      pos_access_right/static/description/index.html
  21. BIN
      pos_access_right/static/description/new_groups.png
  22. 13
      pos_access_right/static/src/css/pos_access_right.css
  23. 210
      pos_access_right/static/src/js/pos_access_right.js
  24. 17
      pos_access_right/static/src/xml/templates.xml

93
pos_access_right/README.rst

@ -0,0 +1,93 @@
==================================
Point of Sale - Extra Access Right
==================================
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! 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/12.0/pos_access_right
:alt: OCA/pos
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/pos-12-0/pos-12-0-pos_access_right
: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/12.0
:alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5|
This module extends Odoo Point Of Sale features, restricting possibility to cashier to make some actions in the Point of Sale. This module will add the following groups to Odoo:
* **PoS - Negative Quantity**: The cashier can sell negative quantity in Point Of Sale (ie, can return products);
* **PoS - Discount**: The cashier can set Discount in Point Of Sale;
* **PoS - Change Unit Price**: The cashier can change the unit price of a product in Point Of Sale;
* **PoS - Many Orders**: The cashier can many orders at the same time;
* **PoS - Delete Order**: The cashier can not delete a full order;
**Table of contents**
.. contents::
:local:
Configuration
=============
Once installed, you have to give correct access right to your cashiers.
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 <https://github.com/OCA/pos/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 <https://github.com/OCA/pos/issues/new?body=module:%20pos_access_right%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
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>
* Ammar Officewla <https://twitter.com/AmmarOfficewala>
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 <https://github.com/OCA/pos/tree/12.0/pos_access_right>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

1
pos_access_right/__init__.py

@ -0,0 +1 @@
from . import models

24
pos_access_right/__manifest__.py

@ -0,0 +1,24 @@
# Copyright (C) 2016-Today: La Louve (<http://www.lalouve.net/>)
# @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 - Extra Access Right',
'version': '13.0.1.0.0',
'category': 'Point Of Sale',
'summary': 'Point of Sale - Extra Access Right for certain actions',
'author': 'La Louve, GRAP, Odoo Community Association (OCA)',
'website': 'http://www.github.com/OCA/pos',
'license': 'AGPL-3',
'depends': [
'point_of_sale',
],
'data': [
'security/res_groups.xml',
'static/src/xml/templates.xml',
],
'demo': [
'demo/res_groups.xml',
],
'installable': True,
}

33
pos_access_right/demo/res_groups.xml

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2016-Today: La Louve (<http://www.lalouve.net/>)
@author: Sylvain LE GAL (https://twitter.com/legalsylvain)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
-->
<odoo>
<record id="group_negative_qty" model="res.groups">
<field name="users" eval="[(4, ref('base.user_root')), (4, ref('base.user_admin'))]"/>
</record>
<record id="group_discount" model="res.groups">
<field name="users" eval="[(4, ref('base.user_root')), (4, ref('base.user_admin')), (4, ref('base.user_demo'))]"/>
</record>
<record id="group_change_unit_price" model="res.groups">
<field name="users" eval="[(4, ref('base.user_root')), (4, ref('base.user_admin'))]"/>
</record>
<record id="group_multi_order" model="res.groups">
<field name="users" eval="[(4, ref('base.user_root')), (4, ref('base.user_admin'))]"/>
</record>
<record id="group_delete_order" model="res.groups">
<field name="users" eval="[(4, ref('base.user_root')), (4, ref('base.user_admin'))]"/>
</record>
<record id="group_payment" model="res.groups">
<field name="users" eval="[(4, ref('base.user_root')), (4, ref('base.user_admin'))]"/>
</record>
</odoo>

191
pos_access_right/i18n/ca.po

@ -0,0 +1,191 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * pos_access_right
#
# Translators:
# Marc Tormo i Bochaca <mtbochaca@gmail.com>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 9.0c\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-03-28 05:50+0000\n"
"PO-Revision-Date: 2017-03-28 05:50+0000\n"
"Last-Translator: Marc Tormo i Bochaca <mtbochaca@gmail.com>, 2017\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"
#. module: pos_access_right
#. openerp-web
#: code:addons/pos_access_right/static/src/js/pos_access_right.js:142
#, python-format
msgid "Change Unit Price - Unauthorized function"
msgstr "Canviar preu unitari - Funció no autoritzada "
#. module: pos_access_right
#. openerp-web
#: code:addons/pos_access_right/static/src/js/pos_access_right.js:87
#, python-format
msgid "Delete Order - Unauthorized function"
msgstr "Esborrar comanda - Funció no autoritzada "
#. module: pos_access_right
#. openerp-web
#: code:addons/pos_access_right/static/src/js/pos_access_right.js:135
#, python-format
msgid "Discount - Unauthorized function"
msgstr "Descomptes - Funció no autoritzada "
#. module: pos_access_right
#. openerp-web
#: code:addons/pos_access_right/static/src/js/pos_access_right.js:70
#, python-format
msgid "Many Orders - Unauthorized function"
msgstr "Múltiples Comandes - Funció no autoritzada"
#. module: pos_access_right
#. openerp-web
#: code:addons/pos_access_right/static/src/js/pos_access_right.js:115
#, python-format
msgid "Negative Quantity - Unauthorized function"
msgstr "Quantitat Negativa - Funció no autoritzada "
#. module: pos_access_right
#. openerp-web
#: code:addons/pos_access_right/static/src/js/pos_access_right.js:166
#, fuzzy, python-format
#| msgid "Discount - Unauthorized function"
msgid "Payment - Unauthorized function"
msgstr "Descomptes - Funció no autoritzada "
#. module: pos_access_right
#. openerp-web
#: code:addons/pos_access_right/static/src/js/pos_access_right.js:71
#: code:addons/pos_access_right/static/src/js/pos_access_right.js:88
#: code:addons/pos_access_right/static/src/js/pos_access_right.js:116
#: code:addons/pos_access_right/static/src/js/pos_access_right.js:136
#: code:addons/pos_access_right/static/src/js/pos_access_right.js:143
#: code:addons/pos_access_right/static/src/js/pos_access_right.js:167
#, python-format
msgid "Please ask your manager to do it."
msgstr "Si us plau, pregunti al seu administrador per fer-ho."
#. module: pos_access_right
#: model:ir.model.fields,field_description:pos_access_right.field_pos_config__group_discount_id
msgid "Point of Sale - Allow Discount"
msgstr "Punt de Venda - Permetre Descomptes "
#. module: pos_access_right
#: model:ir.model.fields,field_description:pos_access_right.field_pos_config__group_negative_qty_id
msgid "Point of Sale - Allow Negative Quantity"
msgstr "Punt de Venda - Permetre quantitats negatives "
#. module: pos_access_right
#: model:ir.model.fields,field_description:pos_access_right.field_pos_config__group_change_unit_price_id
msgid "Point of Sale - Allow Unit Price Change"
msgstr "Punt de Venda - Permetre canviar el preu de venda "
#. module: pos_access_right
#: model:ir.model.fields,field_description:pos_access_right.field_pos_config__group_delete_order_id
#: model:res.groups,name:pos_access_right.group_delete_order
msgid "Point of Sale - Delete Order"
msgstr "Punt de Venda - Esborrar comandes "
#. module: pos_access_right
#: model:res.groups,name:pos_access_right.group_discount
msgid "Point of Sale - Discount"
msgstr "Punt de Venda - Descomptes "
#. module: pos_access_right
#: model:ir.model.fields,field_description:pos_access_right.field_pos_config__group_multi_order_id
#: model:res.groups,name:pos_access_right.group_multi_order
msgid "Point of Sale - Many Orders"
msgstr "Punt de Venda - Múltiples Comandes "
#. module: pos_access_right
#: model:res.groups,name:pos_access_right.group_negative_qty
msgid "Point of Sale - Negative Quantity"
msgstr "Punt de Venda - Quantitats negatives "
#. module: pos_access_right
#: model:ir.model.fields,field_description:pos_access_right.field_pos_config__group_payment_id
#: model:res.groups,name:pos_access_right.group_payment
#, fuzzy
#| msgid "Point of Sale - Discount"
msgid "Point of Sale - Payment"
msgstr "Punt de Venda - Descomptes "
#. module: pos_access_right
#: model:res.groups,name:pos_access_right.group_change_unit_price
msgid "Point of Sale - Unit Price Change"
msgstr "Punt de Venda - Canviar preu unitari "
#. module: pos_access_right
#: model:ir.model,name:pos_access_right.model_pos_config
#, fuzzy
msgid "Point of Sale Configuration"
msgstr "Punt de Venda - Descomptes "
#. module: pos_access_right
#: model:ir.model.fields,help:pos_access_right.field_pos_config__group_discount_id
msgid ""
"This field is there to pass the id of the 'PoS - Allow Discount' Group to "
"the Point of Sale Frontend."
msgstr ""
"Aquest camp està aquí per passar el ID del grup 'TPV - Permetre Descomptes' "
"cap a la pantalla del Punt de Venda."
#. module: pos_access_right
#: model:ir.model.fields,help:pos_access_right.field_pos_config__group_negative_qty_id
msgid ""
"This field is there to pass the id of the 'PoS - Allow Negative Quantity' "
"Group to the Point of Sale Frontend."
msgstr ""
"Aquest camp està aquí per passar el ID del grup 'TPV - Permetre Quantitats "
"Negatives' cap a la pantalla del Punt de Venda."
#. module: pos_access_right
#: model:ir.model.fields,help:pos_access_right.field_pos_config__group_change_unit_price_id
msgid ""
"This field is there to pass the id of the 'PoS - Allow Unit Price Change' "
"Group to the Point of Sale Frontend."
msgstr ""
"Aquest camp està aquí per passar el ID del grup 'TPV - Canviar Preu Unitari' "
"cap a la pantalla del Punt de Venda."
#. module: pos_access_right
#: model:ir.model.fields,help:pos_access_right.field_pos_config__group_delete_order_id
msgid ""
"This field is there to pass the id of the 'PoS - Delete Order' Group to the "
"Point of Sale Frontend."
msgstr ""
"Aquest camp està aquí per passar el ID del grup 'TPV - Esborrar Comanda' cap "
"a la pantalla del Punt de Venda."
#. module: pos_access_right
#: model:ir.model.fields,help:pos_access_right.field_pos_config__group_multi_order_id
msgid ""
"This field is there to pass the id of the 'PoS - Many Orders Group to the "
"Point of Sale Frontend."
msgstr ""
"Aquest camp està aquí per passar el ID del grup 'TPV - Múltiples Comandes' "
"cap a la pantalla del Punt de Venda."
#. module: pos_access_right
#: model:ir.model.fields,help:pos_access_right.field_pos_config__group_payment_id
#, fuzzy
#| msgid ""
#| "This field is there to pass the id of the 'PoS - Many Orders Group to the "
#| "Point of Sale Frontend."
msgid ""
"This field is there to pass the id of the 'PoS - Payment' Group to the Point "
"of Sale Frontend."
msgstr ""
"Aquest camp està aquí per passar el ID del grup 'TPV - Múltiples Comandes' "
"cap a la pantalla del Punt de Venda."
#~ msgid "pos.config"
#~ msgstr "pos.config"

189
pos_access_right/i18n/fr.po

@ -0,0 +1,189 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * pos_access_right
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 9.0c\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-11-02 11:49+0000\n"
"PO-Revision-Date: 2016-11-02 11:49+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: pos_access_right
#. openerp-web
#: code:addons/pos_access_right/static/src/js/pos_access_right.js:142
#, python-format
msgid "Change Unit Price - Unauthorized function"
msgstr "Changer le prix unitaire - Fonctionnalité non autorisée"
#. module: pos_access_right
#. openerp-web
#: code:addons/pos_access_right/static/src/js/pos_access_right.js:87
#, python-format
msgid "Delete Order - Unauthorized function"
msgstr "Supprimer une commande de vente - Fonctionnalité non autorisée"
#. module: pos_access_right
#. openerp-web
#: code:addons/pos_access_right/static/src/js/pos_access_right.js:135
#, python-format
msgid "Discount - Unauthorized function"
msgstr "Remise - Fonctionnalité non autorisée"
#. module: pos_access_right
#. openerp-web
#: code:addons/pos_access_right/static/src/js/pos_access_right.js:70
#, python-format
msgid "Many Orders - Unauthorized function"
msgstr "Plusieurs Commandes simultanées - Fonctionnalité non autorisée"
#. module: pos_access_right
#. openerp-web
#: code:addons/pos_access_right/static/src/js/pos_access_right.js:115
#, python-format
msgid "Negative Quantity - Unauthorized function"
msgstr "Quantité négative - Fonctionnalité non autorisée"
#. module: pos_access_right
#. openerp-web
#: code:addons/pos_access_right/static/src/js/pos_access_right.js:166
#, fuzzy, python-format
#| msgid "Discount - Unauthorized function"
msgid "Payment - Unauthorized function"
msgstr "Remise - Fonctionnalité non autorisée"
#. module: pos_access_right
#. openerp-web
#: code:addons/pos_access_right/static/src/js/pos_access_right.js:71
#: code:addons/pos_access_right/static/src/js/pos_access_right.js:88
#: code:addons/pos_access_right/static/src/js/pos_access_right.js:116
#: code:addons/pos_access_right/static/src/js/pos_access_right.js:136
#: code:addons/pos_access_right/static/src/js/pos_access_right.js:143
#: code:addons/pos_access_right/static/src/js/pos_access_right.js:167
#, python-format
msgid "Please ask your manager to do it."
msgstr "Veuillez vous rapprocher d'un responsable"
#. module: pos_access_right
#: model:ir.model.fields,field_description:pos_access_right.field_pos_config__group_discount_id
msgid "Point of Sale - Allow Discount"
msgstr "Point de vente - Autoriser les remises"
#. module: pos_access_right
#: model:ir.model.fields,field_description:pos_access_right.field_pos_config__group_negative_qty_id
msgid "Point of Sale - Allow Negative Quantity"
msgstr "Point de vente - Autoriser les quantités négatives"
#. module: pos_access_right
#: model:ir.model.fields,field_description:pos_access_right.field_pos_config__group_change_unit_price_id
msgid "Point of Sale - Allow Unit Price Change"
msgstr "Point de vente - Autoriser le changement de prix unitaire"
#. module: pos_access_right
#: model:ir.model.fields,field_description:pos_access_right.field_pos_config__group_delete_order_id
#: model:res.groups,name:pos_access_right.group_delete_order
msgid "Point of Sale - Delete Order"
msgstr "Point de Vente - Supprimer une commande"
#. module: pos_access_right
#: model:res.groups,name:pos_access_right.group_discount
msgid "Point of Sale - Discount"
msgstr "Point de Vente - Remise"
#. module: pos_access_right
#: model:ir.model.fields,field_description:pos_access_right.field_pos_config__group_multi_order_id
#: model:res.groups,name:pos_access_right.group_multi_order
msgid "Point of Sale - Many Orders"
msgstr "Point de Vente - Plusieurs commandes simultanées"
#. module: pos_access_right
#: model:res.groups,name:pos_access_right.group_negative_qty
msgid "Point of Sale - Negative Quantity"
msgstr "Point de Vente - Quantité négative"
#. module: pos_access_right
#: model:ir.model.fields,field_description:pos_access_right.field_pos_config__group_payment_id
#: model:res.groups,name:pos_access_right.group_payment
#, fuzzy
#| msgid "Point of Sale - Discount"
msgid "Point of Sale - Payment"
msgstr "Point de Vente - Remise"
#. module: pos_access_right
#: model:res.groups,name:pos_access_right.group_change_unit_price
msgid "Point of Sale - Unit Price Change"
msgstr "Point de Vente - Changer de prix"
#. module: pos_access_right
#: model:ir.model,name:pos_access_right.model_pos_config
#, fuzzy
msgid "Point of Sale Configuration"
msgstr "Point de Vente - Remise"
#. module: pos_access_right
#: model:ir.model.fields,help:pos_access_right.field_pos_config__group_discount_id
msgid ""
"This field is there to pass the id of the 'PoS - Allow Discount' Group to "
"the Point of Sale Frontend."
msgstr ""
"Ce champs existe pour passer l'ID du groupe 'PdV - Autoriser les remises' au "
"sein du point de vente tactile."
#. module: pos_access_right
#: model:ir.model.fields,help:pos_access_right.field_pos_config__group_negative_qty_id
msgid ""
"This field is there to pass the id of the 'PoS - Allow Negative Quantity' "
"Group to the Point of Sale Frontend."
msgstr ""
"Ce champs existe pour passer l'ID du groupe 'PdV - Autoriser les quantités "
"négatives' au sein du point de vente tactile."
#. module: pos_access_right
#: model:ir.model.fields,help:pos_access_right.field_pos_config__group_change_unit_price_id
msgid ""
"This field is there to pass the id of the 'PoS - Allow Unit Price Change' "
"Group to the Point of Sale Frontend."
msgstr ""
"Ce champs existe pour passer l'ID du groupe 'PdV - Autoriser les changements "
"de prix unitaires' au sein du point de vente tactile."
#. module: pos_access_right
#: model:ir.model.fields,help:pos_access_right.field_pos_config__group_delete_order_id
msgid ""
"This field is there to pass the id of the 'PoS - Delete Order' Group to the "
"Point of Sale Frontend."
msgstr ""
"Ce champs existe pour passer l'ID du groupe 'PdV - Supprimer une commande' "
"au sein du point de vente tactile."
#. module: pos_access_right
#: model:ir.model.fields,help:pos_access_right.field_pos_config__group_multi_order_id
msgid ""
"This field is there to pass the id of the 'PoS - Many Orders Group to the "
"Point of Sale Frontend."
msgstr ""
"Ce champs existe pour passer l'ID du groupe 'PdV - Plusieurs commandes' au "
"sein du point de vente tactile."
#. module: pos_access_right
#: model:ir.model.fields,help:pos_access_right.field_pos_config__group_payment_id
#, fuzzy
#| msgid ""
#| "This field is there to pass the id of the 'PoS - Many Orders Group to the "
#| "Point of Sale Frontend."
msgid ""
"This field is there to pass the id of the 'PoS - Payment' Group to the Point "
"of Sale Frontend."
msgstr ""
"Ce champs existe pour passer l'ID du groupe 'PdV - Plusieurs commandes' au "
"sein du point de vente tactile."
#~ msgid "pos.config"
#~ msgstr "pos.config"

152
pos_access_right/i18n/pos_access_right.pot

@ -0,0 +1,152 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * pos_access_right
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.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_access_right
#. openerp-web
#: code:addons/pos_access_right/static/src/js/pos_access_right.js:142
#, python-format
msgid "Change Unit Price - Unauthorized function"
msgstr ""
#. module: pos_access_right
#. openerp-web
#: code:addons/pos_access_right/static/src/js/pos_access_right.js:87
#, python-format
msgid "Delete Order - Unauthorized function"
msgstr ""
#. module: pos_access_right
#. openerp-web
#: code:addons/pos_access_right/static/src/js/pos_access_right.js:135
#, python-format
msgid "Discount - Unauthorized function"
msgstr ""
#. module: pos_access_right
#. openerp-web
#: code:addons/pos_access_right/static/src/js/pos_access_right.js:70
#, python-format
msgid "Many Orders - Unauthorized function"
msgstr ""
#. module: pos_access_right
#. openerp-web
#: code:addons/pos_access_right/static/src/js/pos_access_right.js:115
#, python-format
msgid "Negative Quantity - Unauthorized function"
msgstr ""
#. module: pos_access_right
#. openerp-web
#: code:addons/pos_access_right/static/src/js/pos_access_right.js:166
#, python-format
msgid "Payment - Unauthorized function"
msgstr ""
#. module: pos_access_right
#. openerp-web
#: code:addons/pos_access_right/static/src/js/pos_access_right.js:71
#: code:addons/pos_access_right/static/src/js/pos_access_right.js:88
#: code:addons/pos_access_right/static/src/js/pos_access_right.js:116
#: code:addons/pos_access_right/static/src/js/pos_access_right.js:136
#: code:addons/pos_access_right/static/src/js/pos_access_right.js:143
#: code:addons/pos_access_right/static/src/js/pos_access_right.js:167
#, python-format
msgid "Please ask your manager to do it."
msgstr ""
#. module: pos_access_right
#: model:ir.model.fields,field_description:pos_access_right.field_pos_config__group_discount_id
msgid "Point of Sale - Allow Discount"
msgstr ""
#. module: pos_access_right
#: model:ir.model.fields,field_description:pos_access_right.field_pos_config__group_negative_qty_id
msgid "Point of Sale - Allow Negative Quantity"
msgstr ""
#. module: pos_access_right
#: model:ir.model.fields,field_description:pos_access_right.field_pos_config__group_change_unit_price_id
msgid "Point of Sale - Allow Unit Price Change"
msgstr ""
#. module: pos_access_right
#: model:ir.model.fields,field_description:pos_access_right.field_pos_config__group_delete_order_id
#: model:res.groups,name:pos_access_right.group_delete_order
msgid "Point of Sale - Delete Order"
msgstr ""
#. module: pos_access_right
#: model:res.groups,name:pos_access_right.group_discount
msgid "Point of Sale - Discount"
msgstr ""
#. module: pos_access_right
#: model:ir.model.fields,field_description:pos_access_right.field_pos_config__group_multi_order_id
#: model:res.groups,name:pos_access_right.group_multi_order
msgid "Point of Sale - Many Orders"
msgstr ""
#. module: pos_access_right
#: model:res.groups,name:pos_access_right.group_negative_qty
msgid "Point of Sale - Negative Quantity"
msgstr ""
#. module: pos_access_right
#: model:ir.model.fields,field_description:pos_access_right.field_pos_config__group_payment_id
#: model:res.groups,name:pos_access_right.group_payment
msgid "Point of Sale - Payment"
msgstr ""
#. module: pos_access_right
#: model:res.groups,name:pos_access_right.group_change_unit_price
msgid "Point of Sale - Unit Price Change"
msgstr ""
#. module: pos_access_right
#: model:ir.model,name:pos_access_right.model_pos_config
msgid "Point of Sale Configuration"
msgstr ""
#. module: pos_access_right
#: model:ir.model.fields,help:pos_access_right.field_pos_config__group_discount_id
msgid "This field is there to pass the id of the 'PoS - Allow Discount' Group to the Point of Sale Frontend."
msgstr ""
#. module: pos_access_right
#: model:ir.model.fields,help:pos_access_right.field_pos_config__group_negative_qty_id
msgid "This field is there to pass the id of the 'PoS - Allow Negative Quantity' Group to the Point of Sale Frontend."
msgstr ""
#. module: pos_access_right
#: model:ir.model.fields,help:pos_access_right.field_pos_config__group_change_unit_price_id
msgid "This field is there to pass the id of the 'PoS - Allow Unit Price Change' Group to the Point of Sale Frontend."
msgstr ""
#. module: pos_access_right
#: model:ir.model.fields,help:pos_access_right.field_pos_config__group_delete_order_id
msgid "This field is there to pass the id of the 'PoS - Delete Order' Group to the Point of Sale Frontend."
msgstr ""
#. module: pos_access_right
#: model:ir.model.fields,help:pos_access_right.field_pos_config__group_multi_order_id
msgid "This field is there to pass the id of the 'PoS - Many Orders Group to the Point of Sale Frontend."
msgstr ""
#. module: pos_access_right
#: model:ir.model.fields,help:pos_access_right.field_pos_config__group_payment_id
msgid "This field is there to pass the id of the 'PoS - Payment' Group to the Point of Sale Frontend."
msgstr ""

169
pos_access_right/i18n/ru.po

@ -0,0 +1,169 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * pos_access_right
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2019-05-30 11:19+0000\n"
"Last-Translator: Ivan Yelizariev <yelizariev@it-projects.info>\n"
"Language-Team: none\n"
"Language: ru\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
"X-Generator: Weblate 3.6.1\n"
#. module: pos_access_right
#. openerp-web
#: code:addons/pos_access_right/static/src/js/pos_access_right.js:142
#, python-format
msgid "Change Unit Price - Unauthorized function"
msgstr ""
#. module: pos_access_right
#. openerp-web
#: code:addons/pos_access_right/static/src/js/pos_access_right.js:87
#, python-format
msgid "Delete Order - Unauthorized function"
msgstr ""
#. module: pos_access_right
#. openerp-web
#: code:addons/pos_access_right/static/src/js/pos_access_right.js:135
#, python-format
msgid "Discount - Unauthorized function"
msgstr ""
#. module: pos_access_right
#. openerp-web
#: code:addons/pos_access_right/static/src/js/pos_access_right.js:70
#, python-format
msgid "Many Orders - Unauthorized function"
msgstr ""
#. module: pos_access_right
#. openerp-web
#: code:addons/pos_access_right/static/src/js/pos_access_right.js:115
#, python-format
msgid "Negative Quantity - Unauthorized function"
msgstr ""
#. module: pos_access_right
#. openerp-web
#: code:addons/pos_access_right/static/src/js/pos_access_right.js:166
#, python-format
msgid "Payment - Unauthorized function"
msgstr ""
#. module: pos_access_right
#. openerp-web
#: code:addons/pos_access_right/static/src/js/pos_access_right.js:71
#: code:addons/pos_access_right/static/src/js/pos_access_right.js:88
#: code:addons/pos_access_right/static/src/js/pos_access_right.js:116
#: code:addons/pos_access_right/static/src/js/pos_access_right.js:136
#: code:addons/pos_access_right/static/src/js/pos_access_right.js:143
#: code:addons/pos_access_right/static/src/js/pos_access_right.js:167
#, python-format
msgid "Please ask your manager to do it."
msgstr "Попросите менеджера выполнить это действие."
#. module: pos_access_right
#: model:ir.model.fields,field_description:pos_access_right.field_pos_config__group_discount_id
msgid "Point of Sale - Allow Discount"
msgstr "Точка продаж - Разрешить Скидки"
#. module: pos_access_right
#: model:ir.model.fields,field_description:pos_access_right.field_pos_config__group_negative_qty_id
msgid "Point of Sale - Allow Negative Quantity"
msgstr "Точка продаж - Разрешить отрицательное количество"
#. module: pos_access_right
#: model:ir.model.fields,field_description:pos_access_right.field_pos_config__group_change_unit_price_id
msgid "Point of Sale - Allow Unit Price Change"
msgstr "Точка продаж - Разрешить изменение цены за штуку"
#. module: pos_access_right
#: model:ir.model.fields,field_description:pos_access_right.field_pos_config__group_delete_order_id
#: model:res.groups,name:pos_access_right.group_delete_order
msgid "Point of Sale - Delete Order"
msgstr "Точка продаж - Удаление заказа"
#. module: pos_access_right
#: model:res.groups,name:pos_access_right.group_discount
msgid "Point of Sale - Discount"
msgstr "Точка продаж - Скидки"
#. module: pos_access_right
#: model:ir.model.fields,field_description:pos_access_right.field_pos_config__group_multi_order_id
#: model:res.groups,name:pos_access_right.group_multi_order
msgid "Point of Sale - Many Orders"
msgstr "Точка продаж - Более одного заказа"
#. module: pos_access_right
#: model:res.groups,name:pos_access_right.group_negative_qty
msgid "Point of Sale - Negative Quantity"
msgstr "Точка продаж - Отрицательное количество"
#. module: pos_access_right
#: model:ir.model.fields,field_description:pos_access_right.field_pos_config__group_payment_id
#: model:res.groups,name:pos_access_right.group_payment
#, fuzzy
#| msgid "Point of Sale - Discount"
msgid "Point of Sale - Payment"
msgstr "Точка продаж - Скидки"
#. module: pos_access_right
#: model:res.groups,name:pos_access_right.group_change_unit_price
msgid "Point of Sale - Unit Price Change"
msgstr "Точка продаж - Изменение цены за штуку"
#. module: pos_access_right
#: model:ir.model,name:pos_access_right.model_pos_config
msgid "Point of Sale Configuration"
msgstr "Настройки Точки продаж"
#. module: pos_access_right
#: model:ir.model.fields,help:pos_access_right.field_pos_config__group_discount_id
msgid ""
"This field is there to pass the id of the 'PoS - Allow Discount' Group to "
"the Point of Sale Frontend."
msgstr ""
#. module: pos_access_right
#: model:ir.model.fields,help:pos_access_right.field_pos_config__group_negative_qty_id
msgid ""
"This field is there to pass the id of the 'PoS - Allow Negative Quantity' "
"Group to the Point of Sale Frontend."
msgstr ""
#. module: pos_access_right
#: model:ir.model.fields,help:pos_access_right.field_pos_config__group_change_unit_price_id
msgid ""
"This field is there to pass the id of the 'PoS - Allow Unit Price Change' "
"Group to the Point of Sale Frontend."
msgstr ""
#. module: pos_access_right
#: model:ir.model.fields,help:pos_access_right.field_pos_config__group_delete_order_id
msgid ""
"This field is there to pass the id of the 'PoS - Delete Order' Group to the "
"Point of Sale Frontend."
msgstr ""
#. module: pos_access_right
#: model:ir.model.fields,help:pos_access_right.field_pos_config__group_multi_order_id
msgid ""
"This field is there to pass the id of the 'PoS - Many Orders Group to the "
"Point of Sale Frontend."
msgstr ""
#. module: pos_access_right
#: model:ir.model.fields,help:pos_access_right.field_pos_config__group_payment_id
msgid ""
"This field is there to pass the id of the 'PoS - Payment' Group to the Point "
"of Sale Frontend."
msgstr ""

1
pos_access_right/models/__init__.py

@ -0,0 +1 @@
from . import pos_config

81
pos_access_right/models/pos_config.py

@ -0,0 +1,81 @@
# Copyright (C) 2016-Today: La Louve (<http://www.lalouve.net/>)
# @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'
group_negative_qty_id = fields.Many2one(
comodel_name='res.groups',
compute='_compute_group_negative_qty_id',
string='Point of Sale - Allow Negative Quantity',
help="This field is there to pass the id of the 'PoS - Allow Negative"
" Quantity' Group to the Point of Sale Frontend.")
group_discount_id = fields.Many2one(
comodel_name='res.groups',
compute='_compute_group_discount_id',
string='Point of Sale - Allow Discount',
help="This field is there to pass the id of the 'PoS - Allow Discount'"
" Group to the Point of Sale Frontend.")
group_change_unit_price_id = fields.Many2one(
comodel_name='res.groups',
compute='_compute_group_change_unit_price_id',
string='Point of Sale - Allow Unit Price Change',
help="This field is there to pass the id of the 'PoS - Allow Unit"
" Price Change' Group to the Point of Sale Frontend.")
group_multi_order_id = fields.Many2one(
comodel_name='res.groups',
compute='_compute_group_multi_order_id',
string='Point of Sale - Many Orders',
help="This field is there to pass the id of the 'PoS - Many Orders"
" Group to the Point of Sale Frontend.")
group_delete_order_id = fields.Many2one(
comodel_name='res.groups',
compute='_compute_group_delete_order_id',
string='Point of Sale - Delete Order',
help="This field is there to pass the id of the 'PoS - Delete Order'"
" Group to the Point of Sale Frontend.")
group_payment_id = fields.Many2one(
comodel_name='res.groups',
compute='_compute_group_payment_id',
string='Point of Sale - Payment',
help="This field is there to pass the id of the 'PoS - Payment'"
" Group to the Point of Sale Frontend.")
def _compute_group_negative_qty_id(self):
for config in self:
self.group_negative_qty_id = \
self.env.ref('pos_access_right.group_negative_qty')
def _compute_group_discount_id(self):
for config in self:
self.group_discount_id = \
self.env.ref('pos_access_right.group_discount')
def _compute_group_change_unit_price_id(self):
for config in self:
self.group_change_unit_price_id = \
self.env.ref('pos_access_right.group_change_unit_price')
def _compute_group_multi_order_id(self):
for config in self:
self.group_multi_order_id = \
self.env.ref('pos_access_right.group_multi_order')
def _compute_group_delete_order_id(self):
for config in self:
self.group_delete_order_id = \
self.env.ref('pos_access_right.group_delete_order')
def _compute_group_payment_id(self):
for config in self:
self.group_payment_id = \
self.env.ref('pos_access_right.group_payment')

1
pos_access_right/readme/CONFIGURE.rst

@ -0,0 +1 @@
Once installed, you have to give correct access right to your cashiers.

2
pos_access_right/readme/CONTRIBUTORS.rst

@ -0,0 +1,2 @@
* Sylvain LE GAL <https://twitter.com/legalsylvain>
* Ammmar Officewala <https://twitter.com/AmmarOfficewala>

7
pos_access_right/readme/DESCRIPTION.rst

@ -0,0 +1,7 @@
This module extends Odoo Point Of Sale features, restricting possibility to cashier to make some actions in the Point of Sale. This module will add the following groups to Odoo:
* **PoS - Negative Quantity**: The cashier can sell negative quantity in Point Of Sale (ie, can return products);
* **PoS - Discount**: The cashier can set Discount in Point Of Sale;
* **PoS - Change Unit Price**: The cashier can change the unit price of a product in Point Of Sale;
* **PoS - Many Orders**: The cashier can many orders at the same time;
* **PoS - Delete Order**: The cashier can not delete a full order;

3
pos_access_right/readme/USAGE.rst

@ -0,0 +1,3 @@
.. 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

39
pos_access_right/security/res_groups.xml

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2016-Today: La Louve (<http://www.lalouve.net/>)
@author: Sylvain LE GAL (https://twitter.com/legalsylvain)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
-->
<odoo noupdate="1">
<record id="group_negative_qty" model="res.groups">
<field name="name">Point of Sale - Negative Quantity</field>
<field name="category_id" ref="base.module_category_usability"/>
</record>
<record id="group_discount" model="res.groups">
<field name="name">Point of Sale - Discount</field>
<field name="category_id" ref="base.module_category_usability"/>
</record>
<record id="group_change_unit_price" model="res.groups">
<field name="name">Point of Sale - Unit Price Change</field>
<field name="category_id" ref="base.module_category_usability"/>
</record>
<record id="group_multi_order" model="res.groups">
<field name="name">Point of Sale - Many Orders</field>
<field name="category_id" ref="base.module_category_usability"/>
</record>
<record id="group_delete_order" model="res.groups">
<field name="name">Point of Sale - Delete Order</field>
<field name="category_id" ref="base.module_category_usability"/>
</record>
<record id="group_payment" model="res.groups">
<field name="name">Point of Sale - Payment</field>
<field name="category_id" ref="base.module_category_usability"/>
</record>
</odoo>

BIN
pos_access_right/static/description/admin_numpad.png

After

Width: 243  |  Height: 240  |  Size: 9.3 KiB

BIN
pos_access_right/static/description/demo_error.png

After

Width: 552  |  Height: 442  |  Size: 12 KiB

BIN
pos_access_right/static/description/demo_numpad.png

After

Width: 244  |  Height: 245  |  Size: 9.1 KiB

BIN
pos_access_right/static/description/icon.png

After

Width: 64  |  Height: 64  |  Size: 4.3 KiB

438
pos_access_right/static/description/index.html

@ -0,0 +1,438 @@
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
<title>Point of Sale - Extra Access Right</title>
<style type="text/css">
/*
:Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 7952 2016-07-26 18:15:59Z milde $
:Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils.
See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
customize this style sheet.
*/
/* used to remove borders from tables and images */
.borderless, table.borderless td, table.borderless th {
border: 0 }
table.borderless td, table.borderless th {
/* Override padding for "table.docutils td" with "! important".
The right padding separates the table cells. */
padding: 0 0.5em 0 0 ! important }
.first {
/* Override more specific margin styles with "! important". */
margin-top: 0 ! important }
.last, .with-subtitle {
margin-bottom: 0 ! important }
.hidden {
display: none }
.subscript {
vertical-align: sub;
font-size: smaller }
.superscript {
vertical-align: super;
font-size: smaller }
a.toc-backref {
text-decoration: none ;
color: black }
blockquote.epigraph {
margin: 2em 5em ; }
dl.docutils dd {
margin-bottom: 0.5em }
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
overflow: hidden;
}
/* Uncomment (and remove this text!) to get bold-faced definition list terms
dl.docutils dt {
font-weight: bold }
*/
div.abstract {
margin: 2em 5em }
div.abstract p.topic-title {
font-weight: bold ;
text-align: center }
div.admonition, div.attention, div.caution, div.danger, div.error,
div.hint, div.important, div.note, div.tip, div.warning {
margin: 2em ;
border: medium outset ;
padding: 1em }
div.admonition p.admonition-title, div.hint p.admonition-title,
div.important p.admonition-title, div.note p.admonition-title,
div.tip p.admonition-title {
font-weight: bold ;
font-family: sans-serif }
div.attention p.admonition-title, div.caution p.admonition-title,
div.danger p.admonition-title, div.error p.admonition-title,
div.warning p.admonition-title, .code .error {
color: red ;
font-weight: bold ;
font-family: sans-serif }
/* Uncomment (and remove this text!) to get reduced vertical space in
compound paragraphs.
div.compound .compound-first, div.compound .compound-middle {
margin-bottom: 0.5em }
div.compound .compound-last, div.compound .compound-middle {
margin-top: 0.5em }
*/
div.dedication {
margin: 2em 5em ;
text-align: center ;
font-style: italic }
div.dedication p.topic-title {
font-weight: bold ;
font-style: normal }
div.figure {
margin-left: 2em ;
margin-right: 2em }
div.footer, div.header {
clear: both;
font-size: smaller }
div.line-block {
display: block ;
margin-top: 1em ;
margin-bottom: 1em }
div.line-block div.line-block {
margin-top: 0 ;
margin-bottom: 0 ;
margin-left: 1.5em }
div.sidebar {
margin: 0 0 0.5em 1em ;
border: medium outset ;
padding: 1em ;
background-color: #ffffee ;
width: 40% ;
float: right ;
clear: right }
div.sidebar p.rubric {
font-family: sans-serif ;
font-size: medium }
div.system-messages {
margin: 5em }
div.system-messages h1 {
color: red }
div.system-message {
border: medium outset ;
padding: 1em }
div.system-message p.system-message-title {
color: red ;
font-weight: bold }
div.topic {
margin: 2em }
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
margin-top: 0.4em }
h1.title {
text-align: center }
h2.subtitle {
text-align: center }
hr.docutils {
width: 75% }
img.align-left, .figure.align-left, object.align-left, table.align-left {
clear: left ;
float: left ;
margin-right: 1em }
img.align-right, .figure.align-right, object.align-right, table.align-right {
clear: right ;
float: right ;
margin-left: 1em }
img.align-center, .figure.align-center, object.align-center {
display: block;
margin-left: auto;
margin-right: auto;
}
table.align-center {
margin-left: auto;
margin-right: auto;
}
.align-left {
text-align: left }
.align-center {
clear: both ;
text-align: center }
.align-right {
text-align: right }
/* reset inner alignment in figures */
div.align-right {
text-align: inherit }
/* div.align-center * { */
/* text-align: left } */
.align-top {
vertical-align: top }
.align-middle {
vertical-align: middle }
.align-bottom {
vertical-align: bottom }
ol.simple, ul.simple {
margin-bottom: 1em }
ol.arabic {
list-style: decimal }
ol.loweralpha {
list-style: lower-alpha }
ol.upperalpha {
list-style: upper-alpha }
ol.lowerroman {
list-style: lower-roman }
ol.upperroman {
list-style: upper-roman }
p.attribution {
text-align: right ;
margin-left: 50% }
p.caption {
font-style: italic }
p.credits {
font-style: italic ;
font-size: smaller }
p.label {
white-space: nowrap }
p.rubric {
font-weight: bold ;
font-size: larger ;
color: maroon ;
text-align: center }
p.sidebar-title {
font-family: sans-serif ;
font-weight: bold ;
font-size: larger }
p.sidebar-subtitle {
font-family: sans-serif ;
font-weight: bold }
p.topic-title {
font-weight: bold }
pre.address {
margin-bottom: 0 ;
margin-top: 0 ;
font: inherit }
pre.literal-block, pre.doctest-block, pre.math, pre.code {
margin-left: 2em ;
margin-right: 2em }
pre.code .ln { color: grey; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
pre.code .literal.string, code .literal.string { color: #0C5404 }
pre.code .name.builtin, code .name.builtin { color: #352B84 }
pre.code .deleted, code .deleted { background-color: #DEB0A1}
pre.code .inserted, code .inserted { background-color: #A3D289}
span.classifier {
font-family: sans-serif ;
font-style: oblique }
span.classifier-delimiter {
font-family: sans-serif ;
font-weight: bold }
span.interpreted {
font-family: sans-serif }
span.option {
white-space: nowrap }
span.pre {
white-space: pre }
span.problematic {
color: red }
span.section-subtitle {
/* font-size relative to parent (h1..h6 element) */
font-size: 80% }
table.citation {
border-left: solid 1px gray;
margin-left: 1px }
table.docinfo {
margin: 2em 4em }
table.docutils {
margin-top: 0.5em ;
margin-bottom: 0.5em }
table.footnote {
border-left: solid 1px black;
margin-left: 1px }
table.docutils td, table.docutils th,
table.docinfo td, table.docinfo th {
padding-left: 0.5em ;
padding-right: 0.5em ;
vertical-align: top }
table.docutils th.field-name, table.docinfo th.docinfo-name {
font-weight: bold ;
text-align: left ;
white-space: nowrap ;
padding-left: 0 }
/* "booktabs" style (no vertical lines) */
table.docutils.booktabs {
border: 0px;
border-top: 2px solid;
border-bottom: 2px solid;
border-collapse: collapse;
}
table.docutils.booktabs * {
border: 0px;
}
table.docutils.booktabs th {
border-bottom: thin solid;
text-align: left;
}
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
font-size: 100% }
ul.auto-toc {
list-style-type: none }
</style>
</head>
<body>
<div class="document" id="point-of-sale-extra-access-right">
<h1 class="title">Point of Sale - Extra Access Right</h1>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/pos/tree/13.0/pos_access_right"><img alt="OCA/pos" src="https://img.shields.io/badge/github-OCA%2Fpos-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/pos-12-0/pos-12-0-pos_access_right"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/184/13.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>This module extends Odoo Point Of Sale features, restricting possibility to cashier to make some actions in the Point of Sale. This module will add the following groups to Odoo:</p>
<ul class="simple">
<li><strong>PoS - Negative Quantity</strong>: The cashier can sell negative quantity in Point Of Sale (ie, can return products);</li>
<li><strong>PoS - Discount</strong>: The cashier can set Discount in Point Of Sale;</li>
<li><strong>PoS - Change Unit Price</strong>: The cashier can change the unit price of a product in Point Of Sale;</li>
<li><strong>PoS - Many Orders</strong>: The cashier can many orders at the same time;</li>
<li><strong>PoS - Delete Order</strong>: The cashier can not delete a full order;</li>
</ul>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#configuration" id="id1">Configuration</a></li>
<li><a class="reference internal" href="#usage" id="id2">Usage</a></li>
<li><a class="reference internal" href="#bug-tracker" id="id3">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="id4">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="id5">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="id6">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="id7">Maintainers</a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="configuration">
<h1><a class="toc-backref" href="#id1">Configuration</a></h1>
<p>Once installed, you have to give correct access right to your cashiers.</p>
</div>
<div class="section" id="usage">
<h1><a class="toc-backref" href="#id2">Usage</a></h1>
<a class="reference external image-reference" href="https://runbot.odoo-community.org/runbot/184/9.0"><img alt="Try me on Runbot" src="https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas" /></a>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#id3">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/pos/issues">GitHub Issues</a>.
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
<a class="reference external" href="https://github.com/OCA/pos/issues/new?body=module:%20pos_access_right%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
<h1><a class="toc-backref" href="#id4">Credits</a></h1>
<div class="section" id="authors">
<h2><a class="toc-backref" href="#id5">Authors</a></h2>
<ul class="simple">
<li>La Louve</li>
<li>GRAP</li>
</ul>
</div>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#id6">Contributors</a></h2>
<ul class="simple">
<li>Sylvain LE GAL &lt;<a class="reference external" href="https://twitter.com/legalsylvain">https://twitter.com/legalsylvain</a>&gt;</li>
<li>Ammar Officewala &lt;<a class="reference external" href="https://twitter.com/AmmarOfficewala">https://twitter.com/AmmarOfficewala</a>&gt;</li>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#id7">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<p>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.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/pos/tree/13.0/pos_access_right">OCA/pos</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
</div>
</body>
</html>

BIN
pos_access_right/static/description/new_groups.png

After

Width: 678  |  Height: 141  |  Size: 15 KiB

13
pos_access_right/static/src/css/pos_access_right.css

@ -0,0 +1,13 @@
/*
Copyright (C) 2016-Today: La Louve (<http://www.lalouve.net/>)
@author: Sylvain LE GAL (https://twitter.com/legalsylvain)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
*/
.pos-disabled-mode {
color: #bbb !important;
background-color: #d3d3d3 !important;
}
.pos-disabled-mode:hover {
background: #e2e2e2 !important;
}

210
pos_access_right/static/src/js/pos_access_right.js

@ -0,0 +1,210 @@
/*
Copyright (C) 2016-Today: La Louve (<http://www.lalouve.net/>)
@author: Sylvain LE GAL (https://twitter.com/legalsylvain)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
*/
odoo.define('pos_access_right.pos_access_right', function (require) {
"use strict";
var screens = require('point_of_sale.screens');
var chrome = require('point_of_sale.chrome');
var models = require('point_of_sale.models');
var gui = require('point_of_sale.gui');
var core = require('web.core');
var DB = require('point_of_sale.DB');
var _t = core._t;
// New function 'display_access_right' to display disabled functions
gui.Gui.prototype.get_user_groups = function (){
var self = this;
if (this.pos.get_cashier() && this.pos.user && this.pos.get_cashier().user_id[0] == this.pos.user.id) {
return this.pos.user
}else{
return _.find(this.pos.users, function(user_id){
if (self.pos.get_cashier().user_id && self.pos.get_cashier().user_id[0] == user_id.id){
return user_id
}
})
}
},
gui.Gui.prototype.display_access_right = function (user) {
if (!user.groups_id){
user = this.get_user_groups();
}
if (user.groups_id.indexOf(
this.pos.config.group_negative_qty_id[0]) === -1) {
$('.numpad-minus').addClass('pos-disabled-mode');
} else {
$('.numpad-minus').removeClass('pos-disabled-mode');
}
if (user.groups_id.indexOf(
this.pos.config.group_discount_id[0]) === -1) {
$(".mode-button[data-mode='discount']").addClass(
'pos-disabled-mode');
} else {
$(".mode-button[data-mode='discount']").removeClass(
'pos-disabled-mode');
}
if (user.groups_id.indexOf(
this.pos.config.group_change_unit_price_id[0]) === -1) {
$(".mode-button[data-mode='price']").addClass('pos-disabled-mode');
} else {
$(".mode-button[data-mode='price']").removeClass(
'pos-disabled-mode');
}
if (user.groups_id.indexOf(
this.pos.config.group_payment_id[0]) === -1) {
$(".button.pay").addClass('pos-disabled-mode');
} else {
$(".button.pay").removeClass('pos-disabled-mode');
}
};
// Overload 'set_cashier' function to display correctly
// unauthorized function after cashier changed
var _set_cashier_ = models.PosModel.prototype.set_cashier;
models.PosModel.prototype.set_cashier = function (user) {
var user_groups = user
if (user.user_id && this.user && user.user_id[0] == this.user.id) {
user_groups = this.user
}else{
user_groups = _.find(this.users, function(user_id){
if (user.user_id && user.user_id[0] == user_id.id){
return user_id
}
})
}
if (user_groups) {
this.gui.display_access_right(user_groups);
}
_set_cashier_.call(this, user);
};
chrome.OrderSelectorWidget.include({
/**
* Click new order
* @param {MouseEvent} event
* @param {HTMLElement | jQuery} $el
*/
neworder_click_handler: function (event, $el) {
var user = [];
var self = this
var user = this.gui.get_user_groups()
if (!user || !user.groups_id || user.groups_id.indexOf(
this.pos.config.group_multi_order_id[0]) === -1) {
this.gui.show_popup('error', {
'title': _t('Many Orders - Unauthorized function'),
'body': _t('Please ask your manager to do it.'),
});
} else {
this._super(event, $el);
}
},
/**
* Click delete order
* @param {MouseEvent} event
* @param {HTMLElement | jQuery} $el
*/
deleteorder_click_handler: function (event, $el) {
var user = this.gui.get_user_groups()
if (!user || !user.groups_id || user.groups_id.indexOf(
this.pos.config.group_delete_order_id[0]) === -1) {
this.gui.show_popup('error', {
'title': _t('Delete Order - Unauthorized function'),
'body': _t('Please ask your manager to do it.'),
});
} else {
this._super(event, $el);
}
},
});
screens.NumpadWidget.include({
/**
* To display correctly unauthorized function at the beginning of the
session, based on current user
*/
start: function () {
this._super();
this.gui.display_access_right(this.pos.get_cashier());
},
/**
* Block '+/-' button if user doesn't belong to the correct group
* @returns {Object}
*/
clickSwitchSign: function () {
var user = this.gui.get_user_groups()
if (!user || !user.groups_id || user.groups_id.indexOf(
this.pos.config.group_negative_qty_id[0]) === -1) {
this.gui.show_popup('error', {
'title': _t('Negative Quantity - Unauthorized function'),
'body': _t('Please ask your manager to do it.'),
});
} else {
return this._super();
}
},
/**
* Block 'discount' or 'price' button if user doesn't belong to the
correct group
* @param {MouseEvent} event
* @returns {Object}
*/
clickChangeMode: function (event) {
var target = event.currentTarget.attributes['data-mode'];
var user = this.gui.get_user_groups()
if (target.nodeValue === 'discount' &&
(!user || !user.groups_id || user.groups_id.indexOf(
this.pos.config.group_discount_id[0]) === -1)) {
this.gui.show_popup('error', {
'title': _t('Discount - Unauthorized function'),
'body': _t('Please ask your manager to do it.'),
});
} else if (target.nodeValue === 'price' && (!user || !user.groups_id ||
user.groups_id.indexOf(
this.pos.config.group_change_unit_price_id[0]) === -1)) {
this.gui.show_popup('error', {
'title': _t('Change Unit Price - Unauthorized function'),
'body': _t('Please ask your manager to do it.'),
});
} else {
return this._super(event);
}
},
});
screens.ActionpadWidget.include({
/**
* Block 'Payment' button if user doesn't belong to the correct group
*/
renderElement: function () {
var self = this;
this._super();
this.gui.display_access_right(this.pos.get_cashier());
var button_pay_click_handler = $._data(
this.$el.find(".button.pay")[0], "events").click[0].handler;
this.$('.pay').off('click').click(function () {
var user = self.gui.get_user_groups()
if (!user || !user.groups_id || user.groups_id.indexOf(
self.pos.config.group_payment_id[0]) === -1) {
self.gui.show_popup('error', {
'title': _t('Payment - Unauthorized function'),
'body': _t('Please ask your manager to do it.'),
});
} else {
button_pay_click_handler();
}
});
},
});
});

17
pos_access_right/static/src/xml/templates.xml

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2016-Today: La Louve (<http://www.lalouve.net/>)
@author: Sylvain LE GAL (https://twitter.com/legalsylvain)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
-->
<odoo>
<template id="assets_frontend" inherit_id="point_of_sale.assets">
<xpath expr="." position="inside">
<script type="text/javascript" src="/pos_access_right/static/src/js/pos_access_right.js"/>
</xpath>
<xpath expr="//link[@id='pos-stylesheet']" position="after">
<link rel="stylesheet" href="/pos_access_right/static/src/css/pos_access_right.css" />
</xpath>
</template>
</odoo>
Loading…
Cancel
Save