Browse Source

[FIX] remove useless feature;[FIX] bug on multi order check

pull/115/head
Sylvain LE GAL 8 years ago
parent
commit
27c338e0c3
  1. 2
      pos_access_right/README.rst
  2. 5
      pos_access_right/demo/res_groups.yml
  3. 18
      pos_access_right/i18n/fr.po
  4. 17
      pos_access_right/models/pos_config.py
  5. 4
      pos_access_right/security/res_groups.yml
  6. BIN
      pos_access_right/static/description/new_groups.png
  7. 20
      pos_access_right/static/src/js/pos_access_right.js

2
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: 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 .. 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. If a user doesn't belong to a group, he can not use the according feature.

5
pos_access_right/demo/res_groups.yml

@ -24,8 +24,3 @@
- !record {model: res.groups, id: group_pos_delete_order}: - !record {model: res.groups, id: group_pos_delete_order}:
users: users:
- base.user_root - base.user_root
- !record {model: res.groups, id: group_pos_delete_order_line}:
users:
- base.user_root
- base.user_demo

18
pos_access_right/i18n/fr.po

@ -29,13 +29,6 @@ msgstr "Changer le prix unitaire - Fonctionnalité non autorisée"
msgid "Delete Order - Unauthorized function" msgid "Delete Order - Unauthorized function"
msgstr "Supprimer une commande de vente - Fonctionnalité non autorisée" 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 #. module: pos_access_right
#. openerp-web #. openerp-web
#: code:addons/pos_access_right/static/src/js/pos_access_right.js:144 #: 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" msgid "Point of Sale - Delete Order"
msgstr "Point de Vente - Supprimer une commande" 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 #. module: pos_access_right
#: model:res.groups,name:pos_access_right.group_pos_discount #: model:res.groups,name:pos_access_right.group_pos_discount
msgid "Point of Sale - 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." 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." 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 #. module: pos_access_right
#: model:ir.model.fields,help:pos_access_right.field_pos_config_group_pos_delete_order #: 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." msgid "This field is there to pass the id of the 'PoS - Delete Order' Group to the Point of Sale Frontend."

17
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'" help="This field is there to pass the id of the 'PoS - Delete Order'"
" Group to the Point of Sale Frontend.") " 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 @api.multi
def _compute_group_pos_negative_qty(self): def _compute_group_pos_negative_qty(self):
for config in self: for config in self:
@ -72,17 +65,11 @@ class PosConfig(models.Model):
@api.multi @api.multi
def _compute_group_pos_multi_order(self): def _compute_group_pos_multi_order(self):
for config in self: for config in self:
self.group_pos_discount = \
self.group_pos_multi_order = \
self.env.ref('pos_access_right.group_pos_multi_order') self.env.ref('pos_access_right.group_pos_multi_order')
@api.multi @api.multi
def _compute_group_pos_delete_order(self): def _compute_group_pos_delete_order(self):
for config in self: for config in self:
self.group_pos_discount = \
self.group_pos_delete_order = \
self.env.ref('pos_access_right.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')

4
pos_access_right/security/res_groups.yml

@ -23,7 +23,3 @@
- !record {model: res.groups, id: group_pos_delete_order}: - !record {model: res.groups, id: group_pos_delete_order}:
name: Point of Sale - Delete Order name: Point of Sale - Delete Order
category_id: base.module_category_usability 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

BIN
pos_access_right/static/description/new_groups.png

Before

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

After

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

20
pos_access_right/static/src/js/pos_access_right.js

@ -39,12 +39,6 @@ point_of_sale.gui
else{ else{
$(".mode-button[data-mode='price']").addClass('pos-disabled-mode'); $(".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_change_unit_price");
models.load_fields("pos.config", "group_pos_multi_order"); 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");
models.load_fields("pos.config", "group_pos_delete_order_line");
// Overload 'set_cashier' function to display correctly // Overload 'set_cashier' function to display correctly
// unauthorized function after cashier changed // 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 // block 'discount' or 'price' button if user doesn't belong to the correct group
clickChangeMode: function(event) { clickChangeMode: function(event) {
if (event.currentTarget.attributes['data-mode'].nodeValue == 'discount' && if (event.currentTarget.attributes['data-mode'].nodeValue == 'discount' &&

Loading…
Cancel
Save