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
33 lines
1.8 KiB
# -*- coding: utf-8 -*-
|
|
# Copyright 2004-2010 OpenERP SA
|
|
# Copyright 2017 RGB Consulting S.L. (https://www.rgbconsulting.com)
|
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
|
|
|
from odoo import fields, models
|
|
|
|
|
|
class LoyaltyRule(models.Model):
|
|
_name = 'loyalty.rule'
|
|
|
|
name = fields.Char(string='Rule Name', size=32, index=True, required=True)
|
|
type = fields.Selection(selection=[('product', 'Product'),
|
|
('category', 'Category')],
|
|
string='Type', required=True, default='product',
|
|
help='The concept this rule applies to')
|
|
cumulative = fields.Boolean(help='The points from this rule will be added '
|
|
'to points won from other rules with '
|
|
'the same concept')
|
|
pp_product = fields.Float(string='Points per product',
|
|
help='Amount of points earned per product')
|
|
pp_currency = fields.Float(string='Points per currency',
|
|
help='Amount of points earned per currency')
|
|
loyalty_program_id = fields.Many2one(comodel_name='loyalty.program',
|
|
string='Loyalty Program',
|
|
help='The Loyalty Program this rule '
|
|
'belongs to')
|
|
product_id = fields.Many2one(comodel_name='product.product',
|
|
string='Target Product',
|
|
help='The product affected by this rule')
|
|
category_id = fields.Many2one(comodel_name='pos.category',
|
|
string='Target Category',
|
|
help='The category affected by this rule')
|