Browse Source

[ADD] pos_disable_change_cashier

pull/533/head
Sylvain LE GAL 4 years ago
parent
commit
3288bcacd2
  1. 70
      pos_disable_change_cashier/README.rst
  2. 1
      pos_disable_change_cashier/__init__.py
  3. 20
      pos_disable_change_cashier/__manifest__.py
  4. 33
      pos_disable_change_cashier/i18n/fr.po
  5. 1
      pos_disable_change_cashier/models/__init__.py
  6. 14
      pos_disable_change_cashier/models/pos_config.py
  7. 5
      pos_disable_change_cashier/readme/CONFIGURE.rst
  8. 1
      pos_disable_change_cashier/readme/CONTRIBUTORS.rst
  9. 5
      pos_disable_change_cashier/readme/DESCRIPTION.rst
  10. BIN
      pos_disable_change_cashier/static/description/pos_config_form.png
  11. 21
      pos_disable_change_cashier/static/src/js/chrome.js
  12. 14
      pos_disable_change_cashier/views/assets.xml
  13. 32
      pos_disable_change_cashier/views/pos_config.xml

70
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 <https://github.com/legalsylvain/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/legalsylvain/pos/issues/new?body=module:%20pos_disable_change_cashier%0Aversion:%2012.0-pos_disable_change_cashier%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
~~~~~~~
* GRAP
Contributors
~~~~~~~~~~~~
* Sylvain LE GAL <https://twitter.com/legalsylvain>
Maintainers
~~~~~~~~~~~
This module is part of the `legalsylvain/pos <https://github.com/legalsylvain/pos/tree/12.0-pos_disable_change_cashier/pos_disable_change_cashier>`_ project on GitHub.
You are welcome to contribute.

1
pos_disable_change_cashier/__init__.py

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

20
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',
],
}

33
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 caisser"
#. 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"

1
pos_disable_change_cashier/models/__init__.py

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

14
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"
)

5
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

1
pos_disable_change_cashier/readme/CONTRIBUTORS.rst

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

5
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.

BIN
pos_disable_change_cashier/static/description/pos_config_form.png

After

Width: 1174  |  Height: 338  |  Size: 36 KiB

21
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();
}
},
});
});

14
pos_disable_change_cashier/views/assets.xml

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
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>
<template id="assets" inherit_id="point_of_sale.assets">
<xpath expr="." position="inside">
<script type="text/javascript" src="/pos_disable_change_cashier/static/src/js/chrome.js"></script>
</xpath>
</template>
</odoo>

32
pos_disable_change_cashier/views/pos_config.xml

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
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>
<record model="ir.ui.view" id="pos_config_view_form">
<field name="name">pos.config.form (in pos_default_partner)</field>
<field name="model">pos.config</field>
<field name="inherit_id" ref="point_of_sale.pos_config_view_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='iface_big_scrollbars']/../.." position="after">
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_left_pane">
<field name="iface_change_cashier"/>
</div>
<div class="o_setting_right_pane">
<label for="iface_change_cashier"/>
<div class="text-muted">
Enable the possibility to change cashier
</div>
</div>
</div>
</xpath>
</field>
</record>
</odoo>
Loading…
Cancel
Save