diff --git a/pos_access_right/README.rst b/pos_access_right/README.rst index 744817cc..68f7ce93 100644 --- a/pos_access_right/README.rst +++ b/pos_access_right/README.rst @@ -26,8 +26,6 @@ This module will add the following groups to Odoo: * PoS - Delete Order: The cashier can not delete a full order; -* PoS - Delete Order Line: The cashier can not delete an order line; - .. image:: /pos_access_right/static/description/new_groups.png If a user doesn't belong to a group, he can not use the according feature. diff --git a/pos_access_right/demo/res_groups.yml b/pos_access_right/demo/res_groups.yml index a0efa203..d4bf70bc 100644 --- a/pos_access_right/demo/res_groups.yml +++ b/pos_access_right/demo/res_groups.yml @@ -24,8 +24,3 @@ - !record {model: res.groups, id: group_pos_delete_order}: users: - base.user_root - -- !record {model: res.groups, id: group_pos_delete_order_line}: - users: - - base.user_root - - base.user_demo diff --git a/pos_access_right/i18n/fr.po b/pos_access_right/i18n/fr.po index c5c82e96..f51dc4b4 100644 --- a/pos_access_right/i18n/fr.po +++ b/pos_access_right/i18n/fr.po @@ -29,13 +29,6 @@ msgstr "Changer le prix unitaire - Fonctionnalité non autorisée" 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:130 -#, python-format -msgid "Delete Order Line - Unauthorized function" -msgstr "Supprimer une ligne de 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:144 @@ -75,12 +68,6 @@ msgstr "Veuillez vous rapprocher d'un superviseur" msgid "Point of Sale - Delete Order" msgstr "Point de Vente - Supprimer une commande" -#. module: pos_access_right -#: model:ir.model.fields,field_description:pos_access_right.field_pos_config_group_pos_delete_order_line -#: model:res.groups,name:pos_access_right.group_pos_delete_order_line -msgid "Point of Sale - Delete Order Line" -msgstr "Point de Vente - Supprimer une ligne de commande" - #. module: pos_access_right #: model:res.groups,name:pos_access_right.group_pos_discount msgid "Point of Sale - Discount" @@ -117,11 +104,6 @@ msgstr "The champs existe pour passer l'ID du groupe 'PdV - Autoriser les quanti msgid "This field is there to pass the id of the 'PoS - Allow Unit Price Change' Group to the Point of Sale Frontend." msgstr "The champs existe pour passer l'ID du groupe 'PdV - Autoriser les changements de prix' au sein du point de vente tactile." -#. module: pos_access_right -#: model:ir.model.fields,help:pos_access_right.field_pos_config_group_pos_delete_order_line -msgid "This field is there to pass the id of the 'PoS - Delete Order Line' Group to the Point of Sale Frontend." -msgstr "The champs existe pour passer l'ID du groupe 'PdV - Supprimer une ligne de commande' au sein du point de vente tactile." - #. module: pos_access_right #: model:ir.model.fields,help:pos_access_right.field_pos_config_group_pos_delete_order msgid "This field is there to pass the id of the 'PoS - Delete Order' Group to the Point of Sale Frontend." diff --git a/pos_access_right/models/pos_config.py b/pos_access_right/models/pos_config.py index 380b6dc0..9b79ea09 100644 --- a/pos_access_right/models/pos_config.py +++ b/pos_access_right/models/pos_config.py @@ -44,13 +44,6 @@ class PosConfig(models.Model): help="This field is there to pass the id of the 'PoS - Delete Order'" " Group to the Point of Sale Frontend.") - group_pos_delete_order_line = fields.Many2one( - comodel_name='res.groups', - compute='_compute_group_pos_delete_order_line', - string='Point of Sale - Delete Order Line', - help="This field is there to pass the id of the 'PoS - Delete Order" - " Line' Group to the Point of Sale Frontend.") - @api.multi def _compute_group_pos_negative_qty(self): for config in self: @@ -72,17 +65,11 @@ class PosConfig(models.Model): @api.multi def _compute_group_pos_multi_order(self): for config in self: - self.group_pos_discount = \ + self.group_pos_multi_order = \ self.env.ref('pos_access_right.group_pos_multi_order') @api.multi def _compute_group_pos_delete_order(self): for config in self: - self.group_pos_discount = \ + self.group_pos_delete_order = \ self.env.ref('pos_access_right.group_pos_delete_order') - - @api.multi - def _compute_group_pos_delete_order_line(self): - for config in self: - self.group_pos_discount = \ - self.env.ref('pos_access_right.group_pos_delete_order_line') diff --git a/pos_access_right/security/res_groups.yml b/pos_access_right/security/res_groups.yml index d4b4e589..e46e352b 100644 --- a/pos_access_right/security/res_groups.yml +++ b/pos_access_right/security/res_groups.yml @@ -23,7 +23,3 @@ - !record {model: res.groups, id: group_pos_delete_order}: name: Point of Sale - Delete Order category_id: base.module_category_usability - -- !record {model: res.groups, id: group_pos_delete_order_line}: - name: Point of Sale - Delete Order Line - category_id: base.module_category_usability diff --git a/pos_access_right/static/description/new_groups.png b/pos_access_right/static/description/new_groups.png index 43ce34c8..0d610e2e 100644 Binary files a/pos_access_right/static/description/new_groups.png and b/pos_access_right/static/description/new_groups.png differ diff --git a/pos_access_right/static/src/js/pos_access_right.js b/pos_access_right/static/src/js/pos_access_right.js index 12e91b22..be7fb225 100644 --- a/pos_access_right/static/src/js/pos_access_right.js +++ b/pos_access_right/static/src/js/pos_access_right.js @@ -39,12 +39,6 @@ point_of_sale.gui else{ $(".mode-button[data-mode='price']").addClass('pos-disabled-mode'); } - if (user.groups_id.indexOf(this.pos.config.group_pos_delete_order_line[0]) != -1){ - $('.numpad-backspace').removeClass('pos-disabled-mode'); - } - else{ - $('.numpad-backspace').addClass('pos-disabled-mode'); - } }; @@ -58,7 +52,6 @@ point_of_sale.models models.load_fields("pos.config", "group_pos_change_unit_price"); models.load_fields("pos.config", "group_pos_multi_order"); models.load_fields("pos.config", "group_pos_delete_order"); - models.load_fields("pos.config", "group_pos_delete_order_line"); // Overload 'set_cashier' function to display correctly // unauthorized function after cashier changed @@ -123,19 +116,6 @@ screens.NumpadWidget } }, - // block '+/-' button if user doesn't belong to the correct group - clickDeleteLastChar: function() { - if (this.pos.get_cashier().groups_id.indexOf(this.pos.config.group_pos_delete_order_line[0]) == -1) { - this.gui.show_popup('error',{ - 'title': _t('Delete Order Line - 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 clickChangeMode: function(event) { if (event.currentTarget.attributes['data-mode'].nodeValue == 'discount' &&