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.

34 lines
1.9 KiB

  1. # Copyright 2004-2010 OpenERP SA
  2. # Copyright 2017 RGB Consulting S.L. (https://www.rgbconsulting.com)
  3. # Copyright 2018 Lambda IS DOOEL <https://www.lambda-is.com>
  4. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
  5. from odoo import fields, models
  6. class LoyaltyRule(models.Model):
  7. _name = 'loyalty.rule'
  8. name = fields.Char(string='Rule Name', size=32, index=True, required=True)
  9. type = fields.Selection(selection=[('product', 'Product'),
  10. ('category', 'Category')],
  11. string='Type', required=True, default='product',
  12. help='The concept this rule applies to')
  13. cumulative = fields.Boolean(help='The points from this rule will be added '
  14. 'to points won from other rules with '
  15. 'the same concept')
  16. pp_product = fields.Float(string='Points per product',
  17. help='Amount of points earned per product')
  18. pp_currency = fields.Float(string='Points per currency',
  19. help='Amount of points earned per currency')
  20. loyalty_program_id = fields.Many2one(comodel_name='loyalty.program',
  21. string='Loyalty Program',
  22. help='The Loyalty Program this rule '
  23. 'belongs to')
  24. product_id = fields.Many2one(comodel_name='product.product',
  25. domain=[('available_in_pos', '=', True)],
  26. string='Target Product',
  27. help='The product affected by this rule')
  28. category_id = fields.Many2one(comodel_name='pos.category',
  29. string='Target Category',
  30. help='The category affected by this rule')