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.

74 lines
2.8 KiB

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