Browse Source
Merge pull request #2 from quentinDupont/12.0-ADD-pos_place_imp
[IMP] Config for each pos
pull/381/head
Sylvain LE GAL
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with
38 additions and
1 deletions
-
pos_place/__manifest__.py
-
pos_place/i18n/fr.po
-
pos_place/models/pos_config.py
-
pos_place/static/src/js/widget.js
-
pos_place/views/view_pos_config.xml
|
|
@ -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', |
|
|
|
], |
|
|
|
|
|
@ -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" |
|
|
|
|
|
@ -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', |
|
|
|
|
|
@ -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 () { |
|
|
|
|
|
@ -0,0 +1,26 @@ |
|
|
|
<?xml version="1.0" encoding="UTF-8"?> |
|
|
|
<!-- |
|
|
|
Copyright (C) 2013 - Today: GRAP (http://www.grap.coop) |
|
|
|
@author: Quentin DUPONT (https://twitter.com/pondupont) |
|
|
|
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
|
|
|
--> |
|
|
|
<odoo> |
|
|
|
|
|
|
|
<record id="view_pos_config_form" model="ir.ui.view"> |
|
|
|
<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='module_pos_restaurant']/../.." position="after"> |
|
|
|
<div class="col-12 col-lg-6 o_setting_box"> |
|
|
|
<div class="o_setting_left_pane"> |
|
|
|
<field name="use_pos_place" groups="pos_place.group_pos_place_manager"/> |
|
|
|
</div> |
|
|
|
<div class="o_setting_right_pane"> |
|
|
|
<label for="use_pos_place" groups="pos_place.group_pos_place_manager"/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</xpath> |
|
|
|
</field> |
|
|
|
</record> |
|
|
|
|
|
|
|
</odoo> |