OdooWiki OCA HUB

Discount by quantities of product category

pricelist_by_category_qty folder_open OCA/sale-workflow open_in_new
Sales Management License: AGPL-3

This module will add a button inside the sale order and will compute the discount not by line but by quantities of the same product category, in the same sale order. e.g.: You've defined 10% discount for Category A for 100 PCE min in the List price.

You try to sell 50 Pieces of Product A and 50 Pieces of Product B (defined on Category A). The OnChange in the line will compute the price of the product as usual. Then you click on the new button. The unit price will be updated as you've sold 50+50 = 100 pieces of the same category! => you will have 10% discount on both lines !

This module was originally developed in v7.0 by the company Julius : https://github.com/julius-network-solutions/julius-openobject-addons/tree/master/pricelist_by_category_qty

auto_awesome What this module does

AI-generated from the code · Odoo 12.0

Adds a 'Compute global discount' button on quotations and sales orders that recalculates line prices using the total quantity of each product category in the order, so volume discounts apply across products of the same category.

This module changes how volume discounts from pricelists are applied on a sales order. Normally each line is priced on its own quantity. With this module, a new button 'Compute global discount' appears on the quotation/sales order form, next to the 'Send by Email' button, and is available while the order is in Draft or Sent state.

When clicked, the module adds up the ordered quantities of all lines that belong to the same product category (ignoring cancelled orders), then looks up the pricelist price for that combined quantity. The resulting unit price is written back on each line of that category, so all lines benefit from the volume discount.

  • It groups quantities by product category, not by individual product.
  • It follows pricelist rules, including pricelists based on another pricelist.
  • It only updates prices when the matching pricelist rule is category-specific; otherwise the normal line price is kept.
  • It only runs on draft or sent orders, so confirmed orders are not changed.

It touches sale.order and sale.order.line and uses the standard product pricelist logic. No automatic computation happens on its own; the user must press the button.

Depends on

sale
Models and fields (2)
  • sale.order · extends an existing model
  • sale.order.line · extends an existing model

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

Sources · Odoo 12.0

Confirmed on 2026-11-03 in branch 12.0 of OCA/sale-workflow.

terminal Installation and usage

No verified information

Installation instructions, the distribution package, dependencies and configuration steps are not shown because they have not yet been verified in the module documentation for any version.

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.