Repository
OCA/sale-promotion · module folder · Try on Runboat
Module version
1.0.0
Category
Sale
Folder size
0.06 MB
License
AGPL-3
Application
No
Auto-installable
No
Website
https://github.com/OCA/sale-promotion
Last tracking update
2026-08-07 08:43:05
Authors
Odoo Community Association (OCA), Tecnativa
Maintainers
Odoo Community Association (OCA), Tecnativa
Committers
OCA-git-bot, oca-ci, Bhavesh Heliconia
Odoo dependencies
Python dependencies
None
System dependencies
None
Required by
sale_loyalty_multi_gift
Description
This module allows to define multiple reward products on promotions.

Code Analysis

Views touched (3)
XML IDNameModelTypeStatus
loyalty_reward_view_form loyalty.reward form Inherits loyalty.loyalty_reward_view_form
loyalty_reward_view_form loyalty.reward form Inherits loyalty.loyalty_reward_view_form
loyalty_reward_view_kanban_multi_gift loyalty.reward kanban Inherits loyalty.loyalty_reward_view_kanban
HTTP endpoints (0)

No HTTP endpoints found for this module.

Models touched (3)

New fields (0)

No new fields.

Public methods (1)
  • write(self, vals)
    In https://github.com/odoo/odoo/blob/69b1993fb45b76110c24f5189a0ecfe9eb59a2aa /addons/loyalty/models/loyalty_program.py#L409 there is a call convert_to_cache on reward_ids that causes that one2many create commands are called twice and thus we get a duplicated record.

New fields (3)
  • loyalty_multi_gift_ids One2many → loyalty.reward.product_line
    comodel_name='loyalty.reward.product_line' inverse_name='reward_id' string='Gift list'
  • multi_gift Boolean
    compute='_compute_multi_gift'
  • reward_type Selection
    ondelete={'multi_gift': 'set default'} selection_add=[('multi_gift', 'Multi Gift')]
Public methods (1)
  • write(self, vals)
    Avoid duplicating the multi gift lines when updating the reward

New fields (4)
  • reward_default_product_id Many2one → product.product
    comodel_name='product.product' compute='_compute_reward_default_product_id' readonly=False
  • reward_id Many2one → loyalty.reward
    comodel_name='loyalty.reward'
  • reward_product_ids Many2many → product.product
    comodel_name='product.product' help='Reward Product' string='Gift Options'
  • reward_product_quantity Integer
    help='Reward product quantity' string='Quantity'
Public methods (1)
  • onchange_reward_product_ids(self)
    @api.onchange('reward_product_ids')

Loading…

Status
Open migration PR — not merged yet for this version
CI status
green — ready to merge
Open since
574 days ago
Last activity
21 days ago
Repository
OCA/sale-promotion
Pull request
[17.0][MIG] loyalty_multi_gift: Migration to 17.0 (#242)
Status
Open migration PR — not merged yet for this version
CI status
green — ready to merge
Open since
100 days ago
Last activity
2 days ago
Repository
OCA/sale-promotion
Pull request
[19.0][MIG] loyalty_multi_gift: Migration to 19.0 (#333)