Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Property Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
      • Get a Tailored Demo
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +32 2 290 34 90
    • Get a Tailored Demo
  • Pricing
  • Help
  1. APPS
  2. eCommerce
  3. Website Quantity Min Max And Multiplier v 18.0
  4. Sales Conditions FAQ

Website Quantity Min Max And Multiplier

by Bytesfuel https://bytesfuel.com/
Odoo

$ 19.45

v 18.0 Third Party
Apps purchases are linked to your Odoo account, please sign in or sign up first.
Availability
Odoo Online
Odoo.sh
On Premise
Odoo Apps Dependencies • Sales (sale_management)
• eCommerce (website_sale)
• Discuss (mail)
• Invoicing (account)
• Website (website)
Lines of code 299
Technical Name website_min_max_qty_bytesfuel
LicenseLGPL-3
Websitehttps://bytesfuel.com/
Versions 18.0 19.0
You bought this module and need support? Click here!
Availability
Odoo Online
Odoo.sh
On Premise
Odoo Apps Dependencies • Sales (sale_management)
• eCommerce (website_sale)
• Discuss (mail)
• Invoicing (account)
• Website (website)
Lines of code 299
Technical Name website_min_max_qty_bytesfuel
LicenseLGPL-3
Websitehttps://bytesfuel.com/
Versions 18.0 19.0

Website Minimum Quantity

Enforce minimum order quantities and purchase multiples for products — seamlessly across both the Odoo backend (Sale Orders) and the eCommerce website (Product page & Shopping Cart).

Community | Enterprise
What This Module Does

Take full control of order quantities

Prevent incorrect purchases — on every channel.

The Website Minimum Quantity module lets you define a Minimum Quantity (Min Qty) and a Maximum Quantity (Max Qty) directly on each product. Once set, the system enforces these limits end-to-end:

  • Backend Sale Orders — real-time warnings & hard constraints stop invalid quantities from being saved.
  • Website Product Page — the quantity input is pre-filled with the minimum, steps by the multiple, and shows an inline info badge.
  • Website Shopping Cart — the + / − buttons snap to the correct multiple; the server-side cart route also validates and auto-corrects quantities.
  • Add-to-Cart Gate — a JavaScript capture-phase listener blocks the add-to-cart action entirely if the quantity is invalid, showing a clear user-friendly notification.
# Example: Min Qty = 10 on a product

Valid purchases: 10 · 20 · 30 · 40 …
Invalid purchases: 1 · 5 · 13 · 25 …

# Example: Max Qty = 100 on a product

Qty ≤ 100 → Allowed
Qty > 100 → Blocked / Auto-capped

Key Features

Everything you need to manage purchase quantity rules in one lightweight module.

01
Per-Product Quantity Fields

Two new fields added directly to the Product Template model: Min Qty (default 1) and Max Qty (0 = no limit). Configured from the product form under General Information → Quantity Limits.

02
Multiples Enforcement

Sales must be ordered in exact multiples of the minimum quantity. If Min Qty = 5, only 5, 10, 15, 20 … are valid. The module checks via qty % min_qty == 0 with a floating-point tolerance of ±0.001.

03
Maximum Quantity Cap

Optionally set a Max Qty to prevent customers or sales reps from ordering too much. Validated on both the website cart and the backend sale order. Setting Max Qty = 0 means no upper limit.

04
Smart Website Product Page

The quantity input on the product page is automatically set to min_qty, steps by min_qty, and has HTML5 min/step/max attributes applied via Qweb templates — no manual configuration required. An info badge shows limits to the customer inline.

05
Cart Page Quantity Control

In the shopping cart, the + button increments by min_qty and the − button decrements by the same step — always snapping to the nearest valid multiple. The cart line input also has data-min, data-step, and data-max attributes set.

06
Server-Side Cart Validation

The /shop/cart/update_json endpoint is overridden to auto-correct quantities before they reach Odoo's cart logic — rounding to the nearest valid multiple and capping at Max Qty. This prevents any invalid quantity from being saved even if JS is bypassed.

07
Real-Time User Notifications

The Odoo notification service displays a "Quantity Limit" warning toast whenever the user manually enters an invalid quantity on the website. The input is automatically reset to the nearest valid value.

08
Add-to-Cart Gating

A capture-phase JavaScript listener validates the quantity before Odoo's own event handlers. If the quantity is invalid, preventDefault(), stopPropagation(), and stopImmediatePropagation() are called — completely blocking the add-to-cart action and showing a notification.

09
Backend Sale Order Enforcement

The Sale Order Line model has both an @api.onchange (live popup warning in the UI) and an @api.constrains (hard DB-level check) to ensure no invalid quantities are ever saved — even via RPC or imports.

See It In Action

Real examples of the module working on the backend and frontend.

Admin Configuration

1. Easy Admin Setup

Admins can easily set the minimum quantity multiple and maximum limit directly from the product template form. These limits are instantly synchronized across all sales channels.

Product Page Interface

2. Smart Web Store Integration

Customers see clear badges indicating the quantity limits right on the product page. The input field automatically steps in exact multiples (e.g., 5, 10, 15) when using the + and - buttons.

Frontend Cart Validation

3. Live Frontend Warnings

If a user manually types an invalid number or bypasses the input steps, a clean popup warning alerts them immediately. The quantity is instantly auto-corrected before reaching the cart.

4. Strict Backend Protection

Sales representatives creating manual orders in the backend are also guided by strict constraints. Popups warn against invalid quantities, and the system prevents saving incorrect entries.

Backend Constraints

How It Works — Step-by-Step Workflow

From product configuration to enforced checkout.

Configuration (Admin)

1
Install the Module

Go to Apps → Search "Website Minimum Quantity" and click Install. The module depends on sale_management and website_sale.

2
Open a Product Form

Navigate to Inventory / Sales → Products, open any product template, and go to the General Information tab.

3
Set Quantity Limits

In the Quantity Limits group, enter the desired Minimum Quantity (e.g., 10) and optionally a Maximum Quantity (e.g., 100, or leave 0 for unlimited).

4
Save the Product

Click Save. The limits are now active in all channels — backend and website — immediately.

Customer Experience (Website)

5
Browse the Product Page

The quantity input is pre-filled with min_qty. An info card below the input displays: "Min Qty: 10 (multiples of 10)" and/or "Max Qty: 100".

6
Use +/− Buttons

Clicking + increases the quantity by min_qty (e.g., 10 → 20 → 30). Clicking − decreases by the same step. The value never drops below min_qty or exceeds max_qty.

7
Manual Input Validation

If a customer types an invalid quantity (e.g., 13), a "Quantity Limit" notification toast fires immediately, and the input is auto-corrected to the nearest valid multiple (e.g., 10).

8
Add to Cart / Checkout

If the quantity is still invalid when the customer clicks Add to Cart, the action is blocked entirely by the JS capture listener. The server further validates and auto-corrects via the overridden /shop/cart/update_json endpoint.

Backend Sale Order Workflow

A
Add Product to Sale Order Line

When a sales rep adds a product in a Sale Order and enters a quantity, the _onchange_qty_limits method fires immediately.

B
Live UI Warning

If the quantity is not a valid multiple or exceeds max_qty, a yellow warning dialog appears inline in the form ("Invalid Quantity – must be a multiple of X") without blocking navigation.

C
Hard Constraint on Save

The _check_qty_limits constraint runs when the order is confirmed or saved. If the quantity is still invalid, a UserError is raised and the record is not saved — protecting data integrity.

D
Order Confirmed with Valid Quantities

Once all line quantities comply with the configured rules, the sale order can be confirmed and processed normally through the standard Odoo workflow.

Help & Support

Need help configuring the module, extending its functionality, or integrating with custom workflows? Our team is here to help. You receive 90 days of free support after purchase (excludes data recovery, migration, or training).

Email: info@bytesfuel.com

Website: https://bytesfuel.com

Contact Us

You may also like

Website Quick Cart
Website Sale Address Autofill
Add to Cart with Quantity Ajax By Bytesfuel
Website Menu Ribbons / Highlight By Bytesfuel
Theme Arsha
Theme Align
Theme Nova
Theme Fuelbox
Other Apps Other Themes

Please log in to comment on this module

  • The author can leave a single reply to each comment.
  • This section is meant to ask simple questions or leave a rating. Every report of a problem experienced while using the module should be addressed to the author directly (refer to the following point).
  • If you want to start a discussion with the author or have a question related to your purchase, please use the support page.
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with