You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

75 lines
2.8 KiB

  1. # -*- coding: utf-8 -*-
  2. # Copyright (C) 2016-Today: La Louve (<http://www.lalouve.net/>)
  3. # @author: Sylvain LE GAL (https://twitter.com/legalsylvain)
  4. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
  5. from openerp import fields, models, api
  6. class PosConfig(models.Model):
  7. _inherit = 'pos.config'
  8. group_negative_qty_id = fields.Many2one(
  9. comodel_name='res.groups',
  10. compute='_compute_group_negative_qty_id',
  11. string='Point of Sale - Allow Negative Quantity',
  12. help="This field is there to pass the id of the 'PoS - Allow Negative"
  13. " Quantity' Group to the Point of Sale Frontend.")
  14. group_discount_id = fields.Many2one(
  15. comodel_name='res.groups',
  16. compute='_compute_group_discount_id',
  17. string='Point of Sale - Allow Discount',
  18. help="This field is there to pass the id of the 'PoS - Allow Discount'"
  19. " Group to the Point of Sale Frontend.")
  20. group_change_unit_price_id = fields.Many2one(
  21. comodel_name='res.groups',
  22. compute='_compute_group_change_unit_price_id',
  23. string='Point of Sale - Allow Unit Price Change',
  24. help="This field is there to pass the id of the 'PoS - Allow Unit"
  25. " Price Change' Group to the Point of Sale Frontend.")
  26. group_multi_order_id = fields.Many2one(
  27. comodel_name='res.groups',
  28. compute='_compute_group_multi_order_id',
  29. string='Point of Sale - Many Orders',
  30. help="This field is there to pass the id of the 'PoS - Many Orders"
  31. " Group to the Point of Sale Frontend.")
  32. group_delete_order_id = fields.Many2one(
  33. comodel_name='res.groups',
  34. compute='_compute_group_delete_order_id',
  35. string='Point of Sale - Delete Order',
  36. help="This field is there to pass the id of the 'PoS - Delete Order'"
  37. " Group to the Point of Sale Frontend.")
  38. @api.multi
  39. def _compute_group_negative_qty_id(self):
  40. for config in self:
  41. self.group_negative_qty_id = \
  42. self.env.ref('pos_access_right.group_negative_qty')
  43. @api.multi
  44. def _compute_group_discount_id(self):
  45. for config in self:
  46. self.group_discount_id = \
  47. self.env.ref('pos_access_right.group_discount')
  48. @api.multi
  49. def _compute_group_change_unit_price_id(self):
  50. for config in self:
  51. self.group_change_unit_price_id = \
  52. self.env.ref('pos_access_right.group_change_unit_price')
  53. @api.multi
  54. def _compute_group_multi_order_id(self):
  55. for config in self:
  56. self.group_multi_order_id = \
  57. self.env.ref('pos_access_right.group_multi_order')
  58. @api.multi
  59. def _compute_group_delete_order_id(self):
  60. for config in self:
  61. self.group_delete_order_id = \
  62. self.env.ref('pos_access_right.group_delete_order')