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.

30 lines
1.5 KiB

  1. # Copyright 2004-2010 OpenERP SA
  2. # Copyright 2017 RGB Consulting S.L. (https://www.rgbconsulting.com)
  3. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
  4. from odoo import fields, models
  5. class LoyaltyProgram(models.Model):
  6. _name = 'loyalty.program'
  7. name = fields.Char(string='Loyalty Program Name', size=32, index=True,
  8. required=True)
  9. pp_currency = fields.Float(string='Points per currency',
  10. help='Amount of loyalty points given to the '
  11. 'customer per sold currency')
  12. pp_product = fields.Float(string='Points per product',
  13. help='Amount of loyalty points given to the '
  14. 'customer per product sold')
  15. pp_order = fields.Float(string='Points per order',
  16. help='Amount of loyalty points given to the '
  17. 'customer for each point of sale order')
  18. rounding = fields.Float(string='Points Rounding', default=1,
  19. help='Loyalty point amounts will be rounded to '
  20. 'multiples of this value')
  21. rule_ids = fields.One2many(comodel_name='loyalty.rule',
  22. inverse_name='loyalty_program_id',
  23. string='Rules')
  24. reward_ids = fields.One2many(comodel_name='loyalty.reward',
  25. inverse_name='loyalty_program_id',
  26. string='Rewards')