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.

33 lines
1.8 KiB

  1. # -*- coding: utf-8 -*-
  2. # Copyright 2004-2010 OpenERP SA
  3. # Copyright 2017 RGB Consulting S.L. (https://www.rgbconsulting.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. string='Target Product',
  26. help='The product affected by this rule')
  27. category_id = fields.Many2one(comodel_name='pos.category',
  28. string='Target Category',
  29. help='The category affected by this rule')