Skip to content
Health
75/100
good
  • Security25/25
    No findings
  • Activity12/25
    Last human commit 21 months ago
  • Required by20/25
    3 modules depend on it
  • Maturity18/25
    In 3 Odoo series since 16.0

Heuristic over the facts below, not an audit · How it's computed

Security findings
Grave / minor (static analysis)
Required by
3
Modules depending on it
External deps
0 pip · 0 bin
Python packages / system binaries
License
AGPL-3
No conflicts with its dependencies
Folder size
0.06 MB
Module directory on disk
Code analysis 0 migration notes 4 models 4 views 0 HTTP endpoints

Description

This module adds a link in the sale order line to the program used in a discount, so it can be easily tracked afterwards. Also eases the implementation of loyalty modules that don't necessarily use the discount product as product for the discount line.

It also links the reward lines to:

  • The order lines that generated them, so we can follow which order lines produced which discounts.
  • The order lines over which the reward is applied:
    • In a discount promo: the cheapest product, specific products or the whole order.
    • In a product promo: the product lines over which the reward is discounted.

Additionally, this module adds a button in the loyalty program form view to open related sale orders.

Dependencies

Odoo dependencies
Python dependencies
None
System dependencies
None
Required by
sale_loyalty_limit, sale_loyalty_multi_gift, sale_loyalty_partner

Code analysis

Extracted from the source by best-effort static analysis (no code is executed); details may be incomplete.

Views touched 4

XML IDNameModelTypeStatus
loyalty_program_view_form_inherit loyalty.program.form.inherit loyalty.program form Inherits loyalty.loyalty_program_view_form
view_order_form sale.order form Inherits sale.view_order_form
view_order_line_tree sale.order.line tree Inherits sale.view_order_line_tree
view_order_product_search sale.report search Inherits sale.view_order_product_search

HTTP endpoints 0

No HTTP endpoints found for this module.

Models touched 4

New fields (1)
  • related_so_count Integer
    compute='_compute_related_so_count'
Public methods (1)
  • action_open_related_sale_orders(self)

New fields (0)

No new fields.

Public methods (1)
  • write(self, vals)
    We're looking for reward lines set in the write, from those, we'll get the proper ids to write them into the related lines

New fields (4)
  • loyalty_program_id Many2one
    related='reward_id.program_id' store=True string='Loyalty Program'
  • reward_generated_line_ids Many2many → sale.order.line
    column1='sale_line_id' column2='reward_generated_line_id' comodel_name='sale.order.line' help='Link on the reward lines generated meeting this line as criteria' relation='sale_line_reward_generated_line_rel' string='Reward Generated lines'
  • reward_line_ids Many2many → sale.order.line
    column1='sale_line_id' column2='reward_line_id' comodel_name='sale.order.line' help='Link on the reward lines applied from this one' relation='sale_line_reward_line_rel' string='Reward lines'
  • reward_origin_generated_line_ids Many2many → sale.order.line
    column1='reward_generated_line_id' column2='sale_line_id' comodel_name='sale.order.line' help='Origin Link on the reward lines generated meeting this line as criteria' relation='sale_line_reward_generated_line_rel' string='Origin Reward Generated lines'
Public methods (1)
  • write(self, vals)
    When the reward line is update we should refresh the line links as well

New fields (1)
  • loyalty_program_id Many2one → loyalty.program
    comodel_name='loyalty.program' string='Loyalty Program'
Public methods (0)

No public methods.

Loading…

Loading…

Loading…