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.

31 lines
1.5 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 LoyaltyProgram(models.Model):
  7. _name = 'loyalty.program'
  8. name = fields.Char(string='Loyalty Program Name', size=32, index=True,
  9. required=True)
  10. pp_currency = fields.Float(string='Points per currency',
  11. help='Amount of loyalty points given to the '
  12. 'customer per sold currency')
  13. pp_product = fields.Float(string='Points per product',
  14. help='Amount of loyalty points given to the '
  15. 'customer per product sold')
  16. pp_order = fields.Float(string='Points per order',
  17. help='Amount of loyalty points given to the '
  18. 'customer for each point of sale order')
  19. rounding = fields.Float(string='Points Rounding', default=1,
  20. help='Loyalty point amounts will be rounded to '
  21. 'multiples of this value')
  22. rule_ids = fields.One2many(comodel_name='loyalty.rule',
  23. inverse_name='loyalty_program_id',
  24. string='Rules')
  25. reward_ids = fields.One2many(comodel_name='loyalty.reward',
  26. inverse_name='loyalty_program_id',
  27. string='Rewards')