OdooWiki OCA HUB

Restrict Coupons to Website Sales

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

This module allows to configure a coupon program so the validation is restricted to eCommerce sales.

auto_awesome What this module does

AI-generated from the code · Odoo 15.0

Adds an "Only for e-commerce" option on coupon programs so a coupon or promo code can only be used on the website, not in backend sales orders.

This module lets you decide, per coupon program, whether the coupon is reserved for online shoppers.

On the coupon program form, in the validity section, a new checkbox "Only for e-commerce" appears. When you tick it, the program is marked as website-only.

Business rules added: - If a customer tries to use a coupon whose program is marked website-only on an order that is not linked to a website, Odoo refuses it with the message "This coupon can only be used in the e-commerce". - The same restriction applies when a promo code is validated on an order that has no website: the message "This coupon can only be validated on the e-commerce" is shown.

This affects the coupon.coupon and coupon.program models and the coupon program form view. It works together with the website sales coupon features, so the check happens during the normal coupon/promo code validation flow.

Depends on

website_sale_coupon
Models and fields (2)
  • coupon.coupon · extends an existing model
  • coupon.program · extends an existing modelwebsite_only (Only for e-commerce)

Text generated by AI (DeepSeek) from reading the Odoo 15.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: 2 confirmed, 7 with no information of 9 versions.

Sources · Odoo 15.0

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

terminal Installation and usage

OCA documentation · Odoo 15.0
  • Go to Website > Products > Coupon Programs and choose the one you want to restrict.
  • In the Validity group you'll find a check box to choose whether or not this program should be restrict to eCommerce sales only.

If a coupon belongs to a eCommerce restricted program, if a user tries to validate it from the sale order backend, it will raise an error, disallowing it.

The same coupon will be usable from the eCommerce though.

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.