OdooWiki OCA HUB

Purchase Order General Discount

purchase_order_general_discount folder_open OCA/purchase-workflow open_in_new
Purchases License: AGPL-3

This module allows to set a general discount in a purchase order. This general discount is applied to each line order.

You can also set a default general discount on suppliers and configure to which line field the discount will be applied.

auto_awesome What this module does

AI-generated from the code · Odoo 19.0

Adds a general discount percentage on purchase orders that is copied to every order line, and lets you set a default discount per supplier and choose which line discount field receives it.

This module lets buyers apply one overall discount to a whole purchase order instead of typing a discount on each line. On the purchase order form, next to the tax totals, you get a "Gen. Disc. (%)" field and a small refresh button. When you change that percentage, or press the refresh button, the same discount is written to every order line.

  • The discount cannot be higher than 100%: the system blocks a value above that limit.
  • When you pick a supplier on the order, the supplier's own default purchase discount is loaded automatically into the order.
  • On the supplier (contact) form, in the Purchase tab, you can store a "Purchase General Discount (%)" that will be proposed on future orders. This value is company-specific.
  • In Purchase settings you can choose which line discount field receives the general discount: the standard discount, or Discount 2 / Discount 3 if those fields exist in your database.

The module touches purchase.order, purchase.order.line, res.partner, res.company and res.config.settings. It only changes purchase documents; it does not create new menus.

Depends on

purchase
Models and fields (4)
  • res.company · extends an existing modelpurchase_general_discount_field (Purchase Discount Field)
  • res.partner · extends an existing modelpurchase_general_discount (Purchase General Discount (%))
  • purchase.order · extends an existing modelgeneral_discount (Gen. Disc. (%))
  • res.config.settings · extends an existing modelpurchase_general_discount_field

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: 8 confirmed, 1 with no information of 9 versions.

Sources · Odoo 12.0

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

terminal Installation and usage

OCA documentation · Odoo 19.0

You can set in settings another discount field to be applied. For example, if we had purchase_triple_discount, we could set the general discount in discount3 to be applied after all other discounts.

To do so:

  • Go to Purchases \> Configuration \> Settings and Purchase Discount Field
  • Select the discount you'd wish to use. purchase_triple_discount fields will appear when the module is installed.

There's a method at res.company called _get_purchase_discount_fields that can be used to extend more line discount fields. For example, if we had the field discount4, we could extend it like this:

@api.model
def _get_purchase_discount_fields(self):
    discount_fields = super()._get_purchase_discount_fields()
    discount_fields += [('discount4', _('Discount 4'))]
    return discount_fields

To set a partner default general discount you need to:

  • Go to a partner and set the general discount in Sales & Purchases tab.

To set a general discount in a purchase order you need to:

  • Create a purchase order.
  • Either select a partner with a purchase general discount defined or set one in the summary section of the order.
  • This discount will be applied to every line.

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.