OdooWiki OCA HUB

Purchase UoM Discrete

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

Discrete and countable units cannot be split. Fractional values are meaningful for continuous measures like weight, volume, length, or time, but not for countable items such as units, boxes, or laptops.

This module rounds purchase order line quantities using Unit based UoMs UP to the next whole number. UoMs that do not share the Unit(s) reference, such as kg, liters, meters, or hours, keep fractional quantities.

This is only a purchase order form onchange helper, with no ORM-level create or write enforcement, so users and integrations can still keep a fractional quantity when it is intentionally applicable.

auto_awesome What this module does

AI-generated from the code · Odoo 19.0

When you enter a quantity on a purchase order line, this module automatically rounds it up to the next whole number if the product is measured in countable units (like units, boxes or laptops). Products measured in weight, volume, length or time keep their decimal quantities.

This module changes how quantities behave on purchase order lines in Odoo.

  • When you type a quantity on a purchase order line, Odoo checks the unit of measure of the product. If that unit is a countable/discrete unit (one that shares the same reference as the standard Unit), the quantity is automatically rounded up to the next whole number. For example, 2.3 units becomes 3 units.
  • If the product uses a continuous unit such as kilograms, liters, meters or hours, the quantity is left unchanged and can stay fractional.
  • The rounding happens as you edit the line (when the quantity, the unit of measure or the line type changes). It is a form helper only: it does not block saving or prevent other systems from writing fractional quantities when that is intentional.
  • Section or note lines on the purchase order are ignored, and lines without a unit of measure are also ignored.
  • The module only touches purchase order lines (purchase.order.line). It adds no new menus, buttons, reports or scheduled actions.

Depends on

purchase
Models and fields (1)
  • purchase.order.line · extends an existing model

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

Sources · Odoo 19.0

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

terminal Installation and usage

OCA documentation · Odoo 19.0

To use this module:

  • Create or edit a purchase order.
  • Add a purchase order line with a Unit-based UoM, such as Units or a box UoM.
  • Enter a fractional quantity.

The quantity is proposed rounded UP to the next whole number.

The behavior is intentionally limited to the purchase order form onchange. Imports, RPC calls, and custom code writes are not forced rounded.

No verified information in OCA: Installation, Configuration.

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.