| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
from odoo import fields, models, api |
| 5 |
|
| 6 |
|
| 7 |
class PosOrderLine(models.Model): |
| 8 |
_inherit = 'pos.order.line' |
| 9 |
|
| 10 |
is_reward_line = fields.Boolean( |
| 11 |
help="Whether this line is part of a reward or not.") |
| 12 |
reward_id = fields.Many2one( |
| 13 |
'loyalty.reward', "Reward", ondelete='restrict', |
| 14 |
help="The reward associated with this line.", index='btree_not_null') |
| 15 |
coupon_id = fields.Many2one( |
| 16 |
'loyalty.card', "Coupon", ondelete='restrict', |
| 17 |
help="The coupon used to claim that reward.") |
| 18 |
reward_identifier_code = fields.Char(help=""" |
| 19 |
Technical field used to link multiple reward lines from the same reward together. |
| 20 |
""") |
| 21 |
points_cost = fields.Float(help="How many point this reward cost on the coupon.") |
| 22 |
|
| 23 |
@api.model |
| 24 |
def _load_pos_data_fields(self, config): |
| 25 |
params = super()._load_pos_data_fields(config) |
| 26 |
params += ['is_reward_line', 'reward_id', 'reward_identifier_code', 'points_cost', 'coupon_id'] |
| 27 |
return params |