Link loyalty programs to order lines
sale_loyalty_order_line_link · OCA/sale-promotion
Replaces
sale_coupon_order_line_link (16.0) Health
75/100
good
-
Security25/25No findings
-
Activity12/25Last human commit 21 months ago
-
Required by20/253 modules depend on it
-
Maturity18/25In 3 Odoo series since 16.0
Heuristic over the facts below, not an audit · How it's computed
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
Code analysis
Extracted from the source by best-effort static analysis (no code is executed); details may be incomplete.
Views touched 4
| XML ID | Name | Model | Type | Status |
|---|---|---|---|---|
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_countIntegercompute='_compute_related_so_count'
-
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_idMany2onerelated='reward_id.program_id'store=Truestring='Loyalty Program' -
reward_generated_line_idsMany2many → sale.order.linecolumn1='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_idsMany2many → sale.order.linecolumn1='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_idsMany2many → sale.order.linecolumn1='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'
-
write(self, vals)When the reward line is update we should refresh the line links as well
New fields (1)
-
loyalty_program_idMany2one → loyalty.programcomodel_name='loyalty.program'string='Loyalty Program'
No public methods.
Loading…
Loading…
Loading…