Loyalty multi gift

loyalty_multi_gift
REPOSITORY
REPOSITORYOCA/sale-promotion
GIT
GIThttps://github.com/OCA/sale-promotion.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/sale-promotion/tree/18.0/loyalty_multi_gift
VERSION
VERSION 1.0.0
CATEGORY
CATEGORYSale
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSTecnativa, Odoo Community Association (OCA)
MAINTAINERS
MAINTAINERSTecnativa, Odoo Community Association (OCA)
COMMITTERS
COMMITTERSOCA-git-bot, oca-ci, Bhavesh Heliconia
WEBSITE
WEBSITEhttps://github.com/OCA/sale-promotion
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 19:30:08
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - loyalty
    - product
    - base
    - mail
    - base_setup
    - web
    - bus
    - web_tour
    - html_editor
    - uom
    - portal
    - web_editor
    - http_routing
    - auth_signup
    - account
    - onboarding
    - analytic
    - digest
    - resource
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION
This module allows to define multiple reward products on promotions.

Code Analysis

Views touched (3)
XML IDNameModelTypeStatus
loyalty_reward_view_form loyalty.reward xpath Inherits loyalty.loyalty_reward_view_form
loyalty_reward_view_form loyalty.reward xpath Inherits loyalty.loyalty_reward_view_form
loyalty_reward_view_kanban_multi_gift loyalty.reward xpath Inherits loyalty.loyalty_reward_view_kanban
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')
REPOSITORY
REPOSITORYOCA/sale-promotion
GIT
GIThttps://github.com/OCA/sale-promotion.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/sale-promotion/tree/16.0/loyalty_multi_gift
VERSION
VERSION 1.0.0
CATEGORY
CATEGORYSale
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSTecnativa, Odoo Community Association (OCA)
MAINTAINERS
MAINTAINERSTecnativa, Odoo Community Association (OCA)
COMMITTERS
COMMITTERSPedro M. Baeza, Weblate, oca-ci, pilarvargas-tecnativa
WEBSITE
WEBSITEhttps://github.com/OCA/sale-promotion
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:53:41
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - loyalty
    - product
    - base
    - mail
    - base_setup
    - web
    - bus
    - web_tour
    - uom
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (3)
XML IDNameModelTypeStatus
loyalty_reward_view_form loyalty.reward xpath Inherits loyalty.loyalty_reward_view_form
loyalty_reward_view_form loyalty.reward xpath Inherits loyalty.loyalty_reward_view_form
loyalty_reward_view_kanban_multi_gift loyalty.reward xpath Inherits loyalty.loyalty_reward_view_kanban
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')
STATUS
STATUSOpen migration PR - not merged yet for this version
REPOSITORY
REPOSITORYOCA/sale-promotion
PULL REQUEST
PULL REQUEST[17.0][MIG] loyalty_multi_gift: Migration to 17.0 (#242)
STATUS
STATUSOpen migration PR - not merged yet for this version
REPOSITORY
REPOSITORYOCA/sale-promotion
PULL REQUEST
PULL REQUEST[19.0][MIG] loyalty_multi_gift: Migration to 19.0 (#333)
STATUS
STATUSOpen migration PR - not merged yet for this version
REPOSITORY
REPOSITORYOCA/sale-promotion
PULL REQUEST
PULL REQUEST[19.0] [MIG] loyalty_multi_gift: Migration to 19.0 (#315)