v 10.0 Third Party 80
Download for v 10.0 Deploy on Odoo.sh
Technical Name stock_packaging_calculator
Also available in version v 13.0 v 14.0 v 15.0
You bought this module and need support? Click here!

Stock packaging calculator

Alpha License: LGPL-3 OCA/stock-logistics-warehouse Translate me on Weblate Try me on Runbot

Basic module providing an helper method to calculate the quantity of product by packaging.


This is an alpha version, the data model and design can change at any time without warning. Only for development or testing purpose, do not use in production. More details on development status

Table of contents


Imagine you have the following packagings:

  • Pallet: 1000 Units
  • Big box: 500 Units
  • Box: 50 Units

and you have to pick from your warehouse 2860 Units.

Then you can do:

>>> product.product_qty_by_packaging(2860)
    {"id": 1, "qty": 2, "name": "Pallet"},
    {"id": 2, "qty": 1, "name": "Big box"},
    {"id": 3, "qty": 7, "name": "Box"},
    {"id": 100, "qty": 10, "name": "Units"},

With this you can show a proper message to warehouse operators to quickly pick the quantity they need.

Optionally you can get contained packaging by passing with_contained flag:

>>> product.product_qty_by_packaging(2860, with_contained=True)
    {"id": 1, "qty": 2, "name": "Pallet", "contained": [{"id": 2, "qty": 2, "name": "Big box"}]},
    {"id": 2, "qty": 1, "name": "Big box", "contained": [{"id": 3, "qty": 10, "name": "Box"}]},
    {"id": 3, "qty": 7, "name": "Box", "contained": [{"id": 100, "qty": 50, "name": "Units"}]},
    {"id": 100, "qty": 10, "name": "Units", "contained": []},},

Known issues / Roadmap


  1. Fractional quantities (eg: 0.5 Kg) are lost when counting units
  2. Maybe rely on packaging_uom

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed feedback.

Do not contact contributors directly about support or help with technical issues.



  • Camptocamp


This module is maintained by the OCA.

Odoo Community Association

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

This module is part of the OCA/stock-logistics-warehouse project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

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, please use the developer contact information. They can usually be found in the description.
Please choose a rating from 1 to 5 for this module.