diff --git a/pos_place/__manifest__.py b/pos_place/__manifest__.py index 348258e0..d090c52c 100644 --- a/pos_place/__manifest__.py +++ b/pos_place/__manifest__.py @@ -18,6 +18,7 @@ 'security/res_groups.xml', 'security/ir.model.access.csv', 'views/templates.xml', + 'views/view_pos_config.xml', 'views/view_pos_place.xml', 'views/view_pos_order.xml', ], diff --git a/pos_place/i18n/fr.po b/pos_place/i18n/fr.po index fa1b5934..e05ebc2d 100644 --- a/pos_place/i18n/fr.po +++ b/pos_place/i18n/fr.po @@ -142,6 +142,11 @@ msgstr "Choisir un emplacement" msgid "This field is there to pass the id of the pos place user group to the point of sale client." msgstr "" +#. module: pos_place +#: model:ir.model.fields,field_description:pos_place.field_pos_config__use_pos_place +msgid "Use Point of Sale places" +msgstr "Utiliser les emplacements" + #. module: pos_place #: model:res.groups,name:pos_place.group_pos_place_user msgid "User" diff --git a/pos_place/models/pos_config.py b/pos_place/models/pos_config.py index 924418e6..124dceac 100644 --- a/pos_place/models/pos_config.py +++ b/pos_place/models/pos_config.py @@ -7,6 +7,10 @@ from odoo import api, fields, models class PosConfig(models.Model): _inherit = 'pos.config' + use_pos_place = fields.Boolean( + string="Use Point of Sale places", + default=False) + group_pos_place_user_id = fields.Many2one( 'res.groups', string='Point of Sale Place User Group', compute='_compute_group_pos_place_user_id', diff --git a/pos_place/static/src/js/widget.js b/pos_place/static/src/js/widget.js index e81944ec..2fc8d145 100644 --- a/pos_place/static/src/js/widget.js +++ b/pos_place/static/src/js/widget.js @@ -29,7 +29,8 @@ odoo.define('pos_place.widgets', function (require) { }); }, is_visible: function () { - return this.pos.user.groups_id.indexOf( + return this.pos.config.use_pos_place && + this.pos.user.groups_id.indexOf( this.pos.config.group_pos_place_user_id[0]) !== -1; }, get_name: function () { diff --git a/pos_place/views/view_pos_config.xml b/pos_place/views/view_pos_config.xml new file mode 100644 index 00000000..3f7f8ab0 --- /dev/null +++ b/pos_place/views/view_pos_config.xml @@ -0,0 +1,26 @@ + + + + + + pos.config + + + +
+
+ +
+
+
+
+
+
+
+ +