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. Product
  3. Price List Max Qty Rule v 19.0
  4. Sales Conditions FAQ

Price List Max Qty Rule

by Said YAHIA https://www.linkedin.com/in/said-yahia-a3a64261
Odoo

$ 39.84

v 19.0 Third Party 1
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 Discuss (mail)
Lines of code 46
Technical Name oyoor_pricelist_max_qty_rule
LicenseAGPL-3
Websitehttps://www.linkedin.com/in/said-yahia-a3a64261
Versions 13.0 14.0 15.0 16.0 17.0 18.0 19.0
You bought this module and need support? Click here!
Availability
Odoo Online
Odoo.sh
On Premise
Odoo Apps Dependencies Discuss (mail)
Lines of code 46
Technical Name oyoor_pricelist_max_qty_rule
LicenseAGPL-3
Websitehttps://www.linkedin.com/in/said-yahia-a3a64261
Versions 13.0 14.0 15.0 16.0 17.0 18.0 19.0
oyoor / pricelist-max-qty
  • Overview
  • How it Works
  • Features
  • Code
  • Contact

Price List with Max Qty Rule

Add an upper quantity boundary to any pricelist rule — so special pricing only applies when the sold quantity stays within your defined ceiling.

One-time license  $40 USD
v19.0.1.0.2 AGPL-3 Said YAHIA
Overview

What does this module do?

Odoo's standard pricelist items allow a Min. Quantity threshold — but there is no built-in ceiling. This module adds a Max. Quantity field to every pricelist rule, giving you full range control over when a price applies.

🎯

The Core Problem

Standard Odoo pricelists trigger a rule for all quantities above the minimum. You cannot stop a promotional price from applying when a customer orders a very large quantity — which can erode margins unintentionally.

✅

Bounded Pricing Rules

Set a Max. Quantity on any rule. If the ordered quantity exceeds that ceiling, Odoo automatically skips the rule and falls back to the next matching rule — or the product's list price.

🖥️

Works in Sale & POS

The quantity check runs at the Odoo core pricing engine level, so it applies consistently in both Sales Orders and the Point of Sale module without extra configuration.

How It Works

Pricing logic, step by step

The module hooks into Odoo's native _is_applicable_for method on product.pricelist.item.

1

Configure a Pricelist Rule

Open any pricelist and add or edit a rule. Two quantity fields now appear side by side: Min. Quantity (already existed) and the new Max. Quantity.

2

Set Your Ceiling

Enter a non-zero integer in Max. Quantity. A value of 0 means "no ceiling" — the rule behaves exactly as before the module was installed.

3

Odoo Evaluates the Rule

When a sale or POS line is computed, Odoo calls _is_applicable_for. The module intercepts: if max_quantity is set and the ordered quantity exceeds it, the rule returns False — it is skipped.

4

Fallback Pricing Applies

Odoo continues evaluating remaining pricelist rules in priority order. If none match, it falls back to the product's standard sales price — protecting your margins automatically.

Features

Everything included

New Max. Quantity field on Pricelist Items

Visible in both the tree (list) and form views of pricelist rules — inserted cleanly right after Min. Quantity via XML inheritance.

Zero = No Ceiling (fully backward-compatible)

The default value is 0, which disables the upper-bound check. Existing pricelist rules behave identically after installation.

Applies to Sales Orders & Point of Sale

Implemented at the pricing engine level, not the UI layer — so the rule is enforced anywhere Odoo computes a price from a pricelist.

Community & Enterprise compatible

Depends only on base and product — no Enterprise-only dependencies. Installs on both editions without modification.

Lightweight — no new menus or models

A single model extension (product.pricelist.item) and three view patches. No migrations, no extra security rules, no configuration screens.

Technical Reference

Core implementation

The entire business logic lives in a single Python method override on product.pricelist.item.

models/product_pricelist.py
class PricelistItem(models.Model):
    _inherit = "product.pricelist.item"

    # New upper-bound field — default 0 means "no ceiling"
    max_quantity = fields.Integer('Max. Quantity', default=0)

    def _is_applicable_for(self, product, qty_in_product_uom):
        # Call original Odoo logic first
        res = super()._is_applicable_for(product, qty_in_product_uom)
        self.ensure_one()
        product.ensure_one()

        # If a ceiling is set and qty exceeds it → skip this rule
        if self.max_quantity and not qty_in_product_uom <= self.max_quantity:
            return False

        return res

Tech stack & compatibility:

Python 3.10+ ORM Inheritance XML View Inheritance Community Enterprise AGPL-3
Support

Need help?

The author is available for support, customisation, and questions about this module.

✉️ Email

syahia1111@gmail.com

🔗 LinkedIn

said-yahia-a3a64261

👤 Author

Said YAHIA

oyoor_pricelist_max_qty_rule  ·  AGPL-3  ·  © Said YAHIA

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