OdooWiki OCA HUB

Auto Refresh Coupons

sale_loyalty_auto_refresh folder_open OCA/sale-promotion open_in_new
Website License: AGPL-3

This module allows to auto apply the programs without the need of the user intervention.

auto_awesome What this module does

AI-generated from the code · Odoo 19.0

Automatically applies and refreshes loyalty and promotion rewards on sales orders whenever the order changes, without the user having to click anything. A company-wide setting turns this behaviour on or off.

This module makes Odoo re-evaluate and re-apply promotion programs on a sales order automatically, so users no longer have to manually refresh coupons or rewards after editing an order.

Where it appears: - A new "Auto Refresh Coupons" checkbox is added to the Sales settings screen (under the margins setting). - The same option is stored per company, so each company can decide independently.

What it does automatically: - When a sales order is created or changed, or when its lines are added, edited or deleted, Odoo recalculates the applicable promotion programs and applies any claimable rewards. - The recalculation is triggered by changes to key fields such as the customer, product, quantity, unit price, unit of measure, taxes and discount on order lines. - It only runs on orders that are still in draft or sent state and only when the company option is enabled. - Errors raised while applying a reward are logged instead of blocking the user. - The coupon and reward wizards temporarily disable this automatic refresh so a coupon is not discarded mid-process.

It touches the sales order, sales order line, company settings, configuration settings and the loyalty coupon/reward wizards. Extra trigger fields can be configured through system parameters.

Depends on

sale_loyalty
Models and fields (7)
  • sale.order · new modelauto_refresh_coupon
  • res.company · extends an existing modelauto_refresh_coupon (Auto Refresh Coupons)
  • sale.order.line · new model
  • res.config.settings · extends an existing modelauto_refresh_coupon
  • sale.coupon.refresh.mixin · new modelauto_refresh_coupon_triggers_data
  • sale.loyalty.coupon.wizard · extends an existing model
  • sale.loyalty.reward.wizard · extends an existing model

Text generated by AI (DeepSeek) from reading the Odoo 19.0 code on GitHub; it may contain mistakes, so check the code before deciding. View the code on GitHub

Availability by version

Reviewed: 2026-11-03
Confirmed (verified in repository and branch) Estimated (unverified) No information

Confirmation status: 3 confirmed, 6 with no information of 9 versions.

Sources · Odoo 19.0

Confirmed on 2026-11-03 in branch 19.0 of OCA/sale-promotion.

terminal Installation and usage

OCA documentation · Odoo 19.0

You can set this feature on or off in every company. To do so:

  • Go to Sales \> Configuration \> Settings
  • In the Pricing section you'll find the option Auto refresh promotions.

The auto-refresh in the backend is triggered over a minimum set of fields changes. If you want to extend the list of that fields:

  • Go to Settings \> Technical \> Config parameters
  • Add or update the key:
  • For sale.order: sale_loyalty_auto_refresh.sale_order_triggers
  • For sale.order.line: sale_loyalty_auto_refresh.sale_order_line_triggers
  • In every add the fields seperated by commas that you want to add to the recomputation triggers.

⚠️ After configuring or removing a trigger a restart of Odoo is recommended so the depends are reloaded properly. Anyway it isn't mandatory and the module detects the new triggers so the auto-refresh works as expected as soon as they are set.

You need to configure a Promotion program with the option Program trigger set to Automatic (shown in Debug mode only, read-only computed field). This can be done in Sales \> Products \> Discount & Loyalty.

Now, make a quotation that fulfill the promotion condition and the promotion will be automatically applied.

No verified information in OCA: Installation.

info

Data imported from GitHub: this sheet reflects the latest catalog review, not a live lookup. Always check the module documentation and staging before installing in production.