1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# -*- coding: utf-8 -*-
# Copyright (C) 2016-Today: La Louve (<http://www.lalouve.net/>)
# @author: Sylvain LE GAL (https://twitter.com/legalsylvain)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import fields, models, api
class PosConfig(models.Model):
_inherit = 'pos.config'
group_pos_negative_qty = fields.Many2one(
comodel_name='res.groups',
compute='_compute_group_pos_negative_qty',
string='Point of Sale - Allow Negative Quantity',
help="This field is there to pass the id of the 'PoS - Allow Negative"
" Quantity' Group to the Point of Sale Frontend.")
group_pos_discount = fields.Many2one(
comodel_name='res.groups',
compute='_compute_group_pos_discount',
string='Point of Sale - Allow Discount',
help="This field is there to pass the id of the 'PoS - Allow Discount'"
" Group to the Point of Sale Frontend.")
group_pos_change_unit_price = fields.Many2one(
comodel_name='res.groups',
compute='_compute_group_pos_change_unit_price',
string='Point of Sale - Allow Unit Price Change',
help="This field is there to pass the id of the 'PoS - Allow Unit"
" Price Change' Group to the Point of Sale Frontend.")
group_pos_multi_order = fields.Many2one(
comodel_name='res.groups',
compute='_compute_group_pos_multi_order',
string='Point of Sale - Many Orders',
help="This field is there to pass the id of the 'PoS - Many Orders"
" Group to the Point of Sale Frontend.")
group_pos_delete_order = fields.Many2one(
comodel_name='res.groups',
compute='_compute_group_pos_delete_order',
string='Point of Sale - Delete Order',
help="This field is there to pass the id of the 'PoS - Delete Order'"
" Group to the Point of Sale Frontend.")
@api.multi
def _compute_group_pos_negative_qty(self):
for config in self:
self.group_pos_negative_qty = \
self.env.ref('pos_access_right.group_pos_negative_qty')
@api.multi
def _compute_group_pos_discount(self):
for config in self:
self.group_pos_discount = \
self.env.ref('pos_access_right.group_pos_discount')
@api.multi
def _compute_group_pos_change_unit_price(self):
for config in self:
self.group_pos_change_unit_price = \
self.env.ref('pos_access_right.group_pos_change_unit_price')
@api.multi
def _compute_group_pos_multi_order(self):
for config in self:
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_delete_order = \
self.env.ref('pos_access_right.group_pos_delete_order')