TIP: You can type at any time to perform a new search.
Coupons & Loyalty
loyalty · odoo/odoo
- Repository
- odoo/odoo · module folder
- Module version
- 1.0
- Category
- Sales
- Folder size
- 4.23 MB
- License
- LGPL-3
- Application
- No
- Auto-installable
- No
- Website
- None
- Last tracking update
- 2026-08-15 22:44:15
- Authors
- Odoo S.A.
- Maintainers
- Odoo S.A.
- Committers
- Raphael Collet, Thibault Delavallée, Atul Patel, Odoo Translation Bot, Géry Debongnie, Julien Castiaux, Victor Feyens, Rémy Voet (ryv), Tiffany Chang (tic), Gorash, Pierre Paridans, William Braeckman, Demesmaeker, Valentin Chevalier, alsh-odoo, Mylyna Hy, Victor Piryns (pivi), Levi Siuzdak (sile), Dylan Kiss (dyki), Sarah Bellefroid, kcv-odoo, dere-odoo, Louis Gobert, Junqi Wu, hatr-odoo, Xavier Luyckx (xlu), Ryan Cen, pish-odoo, Mahdi Alijani (malj), Krzysztof Magusiak (krma), kkuj-odoo, Dhwani Patel, steji, assh-odoo, Elliot ELCO, panj-odoo, Abdullah (abye)
- Odoo dependencies
- Python dependencies
- None
- System dependencies
- None
- Required by
- loyalty_incompatibility, pos_loyalty, sale_loyalty
- Description
Code Analysis ⓘ
Views touched (23)
| XML ID | Name | Model | Type | Status |
|---|---|---|---|---|
gift_card_report |
gift_card_report | ir.ui.view | qweb | New |
gift_card_report_i18n |
gift_card_report_i18n | ir.ui.view | qweb | New |
loyalty_buttons |
loyalty_buttons | ir.ui.view | qweb | Inherits portal.side_content |
loyalty_card_history_template |
My Loyalty History | ir.ui.view | qweb | New |
loyalty_card_update_balance_form |
loyalty.card.update.balance.view.form | loyalty.card.update.balance | form | New |
loyalty_card_view_form |
loyalty.card.view.form | loyalty.card | form | New |
loyalty_card_view_search |
loyalty.card.view.search | loyalty.card | search | New |
loyalty_card_view_tree |
loyalty.card.view.list | loyalty.card | list | New |
loyalty_generate_wizard_view_form |
loyalty.generate.wizard.view.form | loyalty.generate.wizard | form | New |
loyalty_history_form |
loyalty.history.view.form | loyalty.history | form | New |
loyalty_mail_view_tree |
loyalty.mail.view.list | loyalty.mail | list | New |
loyalty_program_gift_ewallet_view_form |
loyalty.program.gift.ewallet.view.form | loyalty.program | form | Inherits loyalty_program_view_form |
loyalty_program_view_form |
loyalty.program.view.form | loyalty.program | form | New |
loyalty_program_view_search |
loyalty.program.view.search | loyalty.program | search | New |
loyalty_program_view_tree |
loyalty.program.view.list | loyalty.program | list | New |
loyalty_report |
loyalty_report | ir.ui.view | qweb | New |
loyalty_report_i18n |
loyalty_report_i18n | ir.ui.view | qweb | New |
loyalty_reward_view_form |
loyalty.reward.view.form | loyalty.reward | form | New |
loyalty_reward_view_kanban |
loyalty.reward.view.kanban | loyalty.reward | kanban | New |
loyalty_rule_view_form |
loyalty.rule.view.form | loyalty.rule | form | New |
loyalty_rule_view_kanban |
loyalty.rule.view.kanban | loyalty.rule | kanban | New |
portal_loyalty_history_breadcrumbs |
Portal layout : Loyalty History Lines | ir.ui.view | qweb | Inherits portal.portal_breadcrumbs |
res_partner_form |
res.partner.view.buttons | res.partner | form | Inherits base.view_partner_form |
HTTP endpoints (2)
| Route(s) | Handler | Auth | Type | Methods | Flags |
|---|---|---|---|---|---|
/my/loyalty_card/<int:card_id>/values |
CustomerPortalLoyalty.portal_get_card_history_values |
user | jsonrpc | ALL | sudo |
/my/loyalty_card/<int:card_id>/history, /my/loyalty_card/<int:card_id>/history/page/<int:page> |
CustomerPortalLoyalty.portal_my_loyalty_card_history |
user | http | ALL | sudo website |
Models touched (13)
New fields (0)
No new fields.
Public methods (0)No public methods.
New fields (13)
-
activeBooleandefault=True -
codeChardefault=<expr>required=True -
company_idMany2oneprecompute=Truerelated='program_id.company_id'store=True -
currency_idMany2onerelated='program_id.currency_id' -
expiration_dateDate -
history_idsOne2many → loyalty.historycomodel_name='loyalty.history'inverse_name='card_id'readonly=True -
partner_idMany2one → res.partnercomodel_name='res.partner'index=True -
point_nameCharreadonly=Truerelated='program_id.portal_point_name' -
pointsFloattracking=True -
points_displayCharcompute='_compute_points_display' -
program_idMany2one → loyalty.programcomodel_name='loyalty.program'default=<expr>index='btree_not_null'ondelete='restrict' -
program_typeSelectionrelated='program_id.program_type' -
use_countIntegercompute='_compute_use_count'
-
action_coupon_send(self)Open a window to compose an email, with the default template returned by `_get_default_template` message loaded by default -
action_loyalty_update_balance(self) -
create(self, vals_list)@api.model_create_multi -
write(self, vals)
New fields (4)
-
card_idMany2one → loyalty.cardcomodel_name='loyalty.card'readonly=Truerequired=True -
descriptionCharrequired=True -
new_balanceFloat -
old_balanceFloatrelated='card_id.points'
-
action_update_card_point(self)
New fields (12)
-
confirmation_messageCharcompute='_compute_confirmation_message' -
coupon_qtyIntegercompute='_compute_coupon_qty'readonly=Falsestore=True args: 'Quantity' -
customer_idsMany2many → res.partnerstring='Customers' args: 'res.partner' -
customer_tag_idsMany2many → res.partner.categorystring='Customer Tags' args: 'res.partner.category' -
descriptionTextstring='Description' -
modeSelectiondefault='anonymous'required=Truestring='For' args: [('anonymous', 'Anonymous Customers'), ('selected', 'Selected Customers')] -
points_grantedFloatdefault=1required=True args: 'Grant' -
points_nameCharreadonly=Truerelated='program_id.portal_point_name' -
program_idMany2one → loyalty.programdefault=<expr>required=True args: 'loyalty.program' -
program_typeSelectionrelated='program_id.program_type' -
valid_untilDate -
will_send_mailBooleancompute='_compute_will_send_mail'
-
generate_coupons(self)
New fields (7)
-
card_idMany2one → loyalty.cardcomodel_name='loyalty.card'index=Trueondelete='cascade'required=True -
company_idMany2onerelated='card_id.company_id' -
descriptionTextrequired=True -
issuedFloat -
order_idMany2oneReferencemodel_field='order_model'readonly=True -
order_modelCharreadonly=True -
usedFloat
No public methods.
New fields (5)
-
activeBooleandefault=True -
mail_template_idMany2one → mail.templatecomodel_name='mail.template'domain=[('model', '=', 'loyalty.card')]ondelete='cascade'required=Truestring='Email Template' -
pointsFloat -
program_idMany2one → loyalty.programcomodel_name='loyalty.program'index=Trueondelete='cascade'required=True -
triggerSelectionrequired=Trueselection=[('create', 'At Creation'), ('points_reach', 'When Reaching')]string='When'
No public methods.
New fields (29)
-
activeBooleandefault=True -
applies_onSelectioncompute='_compute_from_program_type'default='current'readonly=Falserequired=Trueselection=[('current', 'Current order'), ('future', 'Future orders'), ('both', 'Current & Future orders')]store=True -
available_onBooleanhelp='Manage where your program should be available for use.'store=Falsestring='Available On' -
communication_plan_idsOne2many → loyalty.mailcomodel_name='loyalty.mail'compute='_compute_from_program_type'copy=Trueinverse_name='program_id'readonly=Falsestore=True -
company_idMany2one → res.companycomodel_name='res.company'default=<expr>string='Company' -
coupon_countIntegercompute='_compute_coupon_count' -
coupon_count_displayCharcompute='_compute_coupon_count_display'string='Items' -
coupon_idsOne2many → loyalty.cardcomodel_name='loyalty.card'inverse_name='program_id' -
currency_idMany2one → res.currencycomodel_name='res.currency'compute='_compute_currency_id'precompute=Truereadonly=Falserequired=Truestore=Truestring='Currency' -
currency_symbolCharrelated='currency_id.symbol' -
date_fromDatehelp='The start date is included in the validity period of this program'string='Start Date' -
date_toDatehelp='The end date is included in the validity period of this program'string='End date' -
is_nominativeBooleancompute='_compute_is_nominative' -
is_payment_programBooleancompute='_compute_is_payment_program' -
limit_usageBooleanstring='Limit Usage' -
mail_template_idMany2one → mail.templatecomodel_name='mail.template'compute='_compute_mail_template_id'inverse='_inverse_mail_template_id'readonly=Falsestring='Email template' -
max_usageInteger -
nameCharrequired=Truestring='Program Name'translate=True -
payment_program_discount_product_idMany2one → product.productcomodel_name='product.product'compute='_compute_payment_program_discount_product_id'help='Product used in the sales order to apply the discount.'readonly=Truestring='Discount Product' -
portal_point_nameCharcompute='_compute_portal_point_name'default='Points'readonly=Falsestore=Truetranslate=True -
portal_visibleBooleandefault=Falsehelp='\n Show in web portal, PoS customer ticket, eCommerce checkout, the number of points available\n and used by reward.\n ' -
pricelist_idsMany2many → product.pricelistcomodel_name='product.pricelist'domain="[('currency_id', '=', currency_id)]"help='This program is specific to this pricelist set.'string='Pricelist' -
program_typeSelectiondefault='promotion'required=Trueselection=[('coupons', 'Coupons'), ('gift_card', 'Gift Card'), ('loyalty', 'Loyalty Cards'), ('promotion', 'Promotions'), ('ewallet', 'eWallet'), ('promo_code', 'Discount Code'), ('buy_x_get_y', 'Buy X Get Y'), ('next_order_coupons', 'Next Order Coupons')] -
reward_idsOne2many → loyalty.rewardcomodel_name='loyalty.reward'compute='_compute_from_program_type'copy=Trueinverse_name='program_id'readonly=Falsestore=Truestring='Rewards' -
rule_idsOne2many → loyalty.rulecomodel_name='loyalty.rule'compute='_compute_from_program_type'copy=Trueinverse_name='program_id'readonly=Falsestore=Truestring='Conditional rules' -
sequenceIntegercopy=False -
total_order_countIntegercompute='_compute_total_order_count'string='Total Order Count' -
triggerSelectioncompute='_compute_from_program_type'help='\n Automatic: Customers will be eligible for a reward automatically in their cart.\n Use a code: Customers will be eligible for a reward if they enter a code.\n 'readonly=Falseselection=[('auto', 'Automatic'), ('with_code', 'Use a code')]store=True -
trigger_product_idsMany2manyreadonly=Falserelated='rule_ids.product_ids'
-
action_open_loyalty_cards(self) -
create(self, vals_list)@api.model_create_multitrigger_product_ids will overwrite product ids defined in a loyalty rule in certain instances. Thus, it should be explicitly removed from an incoming vals dict unless, of course, it was actually a visible field. -
create_from_template(self, template_id)@api.modelCreates the program from the template id defined in `get_program_templates`. Returns an action leading to that new record. -
default_get(self, fields)@api.model -
get_program_templates(self)@api.modelReturns the templates to be used for promotional programs. -
write(self, vals)
New fields (29)
-
activeBooleandefault=True -
all_discount_product_idsMany2many → product.productcomodel_name='product.product'compute='_compute_all_discount_product_ids' -
clear_walletBooleandefault=False -
company_idMany2onerelated='program_id.company_id'store=True -
currency_idMany2onerelated='program_id.currency_id' -
descriptionCharcompute='_compute_description'precompute=Truereadonly=Falserequired=Truestore=Truetranslate=True -
discountFloatdefault=10string='Discount' -
discount_applicabilitySelectiondefault='order'selection=[('order', 'Order'), ('cheapest', 'Cheapest Product'), ('specific', 'Specific Products')] -
discount_line_product_idMany2one → product.productcomodel_name='product.product'copy=Falsehelp='Product used in the sales order to apply the discount. Each reward has its own product for reporting purpose'ondelete='restrict' -
discount_max_amountMonetaryhelp='This is the max amount this reward may discount, leave to 0 for no limit.'string='Max Discount' -
discount_modeSelectiondefault='percent'required=Trueselection=_get_discount_mode_select -
discount_product_category_idMany2one → product.categorycomodel_name='product.category'string='Discounted Prod. Categories' -
discount_product_domainChardefault='[]' -
discount_product_idsMany2many → product.productcomodel_name='product.product'string='Discounted Products' -
discount_product_tag_idMany2one → product.tagcomodel_name='product.tag'string='Discounted Prod. Tag' -
is_global_discountBooleancompute='_compute_is_global_discount' -
multi_productBooleancompute='_compute_multi_product' -
point_nameCharreadonly=Truerelated='program_id.portal_point_name' -
program_idMany2one → loyalty.programcomodel_name='loyalty.program'index=Trueondelete='cascade'required=True -
program_typeSelectionrelated='program_id.program_type' -
required_pointsFloatdefault=1string='Points needed' -
reward_product_domainCharcompute='_compute_reward_product_domain'store=False -
reward_product_idMany2one → product.productcomodel_name='product.product'domain=[('type', '!=', 'combo')]string='Product' -
reward_product_idsMany2many → product.productcomodel_name='product.product'compute='_compute_multi_product'help='These are the products that can be claimed with this rule.'search='_search_reward_product_ids'string='Reward Products' -
reward_product_qtyIntegerdefault=1 -
reward_product_tag_idMany2one → product.tagcomodel_name='product.tag'string='Product Tag' -
reward_product_uom_idMany2one → uom.uomcomodel_name='uom.uom'compute='_compute_reward_product_uom_id' -
reward_typeSelectiondefault='discount'required=Trueselection=[('product', 'Free Product'), ('discount', 'Discount')] -
user_has_debugBooleancompute='_compute_user_has_debug'
-
create(self, vals_list)@api.model_create_multi -
default_get(self, fields)@api.model -
unlink(self) -
update_field_translations(self, field_name, translations, source_lang='') -
write(self, vals)
New fields (19)
-
activeBooleandefault=True -
codeCharcompute='_compute_code'readonly=Falsestore=Truestring='Discount code' -
company_idMany2onerelated='program_id.company_id'store=True -
currency_idMany2onerelated='program_id.currency_id' -
minimum_amountMonetarystring='Minimum Purchase' -
minimum_amount_tax_modeSelectiondefault='incl'required=Trueselection=[('incl', 'tax included'), ('excl', 'tax excluded')] -
minimum_qtyIntegerdefault=1string='Minimum Quantity' -
modeSelectioncompute='_compute_mode'readonly=Falseselection=[('auto', 'Automatic'), ('with_code', 'With a promotion code')]store=Truestring='Application' -
product_category_idMany2one → product.categorycomodel_name='product.category'string='Categories' -
product_domainChardefault='[]' -
product_idsMany2many → product.productcomodel_name='product.product'string='Products' -
product_tag_idMany2one → product.tagcomodel_name='product.tag'string='Product Tag' -
program_idMany2one → loyalty.programcomodel_name='loyalty.program'index=Trueondelete='cascade'required=True -
program_typeSelectionrelated='program_id.program_type' -
reward_point_amountFloatdefault=1string='Reward' -
reward_point_modeSelectiondefault='order'required=Trueselection=_get_reward_point_mode_selection -
reward_point_nameCharreadonly=Truerelated='program_id.portal_point_name' -
reward_point_splitBooleandefault=Falsehelp="Whether to separate reward coupons per matched unit, only applies to 'future' programs and trigger mode per money spent or unit paid..."string='Split per unit' -
user_has_debugBooleancompute='_compute_user_has_debug'
-
default_get(self, fields)@api.model
New fields (0)
No new fields.
Public methods (1)-
action_archive(self)
New fields (0)
No new fields.
Public methods (1)-
write(self, vals)
New fields (0)
No new fields.
Public methods (1)-
create(self, vals_list)@api.model_create_multiOverride of `product` to set a default image for gift cards.
New fields (1)
-
loyalty_card_countIntegercompute='_compute_count_active_cards'compute_sudo=Truegroups='base.group_user'string='Active loyalty cards'
-
action_view_loyalty_cards(self)
Loading…
Loading…
Loading…