Product packaging calculator

product_packaging_calculator
REPOSITORY
REPOSITORYOCA/product-attribute
GIT
GIThttps://github.com/OCA/product-attribute.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/product-attribute/tree/18.0/product_packaging_calculator
VERSION
VERSION 1.0.1
CATEGORY
CATEGORYProduct
LICENSE
LICENSELGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), Camptocamp
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), Camptocamp
COMMITTERS
COMMITTERSVíctor Martínez, Sébastien Alix, Weblate, OCA-git-bot, oca-ci
WEBSITE
WEBSITEhttps://github.com/OCA/product-attribute
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 19:30:13
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - product
    - base
    - mail
    - base_setup
    - web
    - bus
    - web_tour
    - html_editor
    - uom
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES openupgradelib
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION
Basic module providing an helper method to calculate the quantity of
product by packaging.

Code Analysis

Views touched (0)

No views found for this module.

Models touched (2)

New fields (0)

No new fields.

Public methods (2)
  • product_qty_by_packaging(self, prod_qty, with_contained=False)
    Calculate quantity by packaging. The minimal quantity is always represented by the UoM of the product. Limitation: fractional quantities are lost. :prod_qty: total qty to satisfy. :with_contained: include calculation of contained packagings. eg: 1 pallet contains 4 big boxes and 6 little boxes. :returns: list of dict in the form [{id: 1, qty: qty_per_package, name: package_name}] If `with_contained` is passed, each element will include the quantity of smaller packaging, like: {contained: [{id: 1, qty: 4, name: "Big box"}]}
  • product_qty_by_packaging_as_str(self, prod_qty, include_total_units=False, only_packaging=False)
    Return a string representing the qty of each packaging. :param prod_qty: the qty of current product to translate to pkg qty :param include_total_units: includes total qty required initially :param only_packaging: exclude units if you have only units. IOW: if the qty does not match any packaging and this flag is true you'll get an empty string instead of `N units`.

New fields (1)
  • product_qty_by_packaging_display Char
    compute='_compute_product_qty_by_packaging_display' string='Qty by packaging'
Public methods (0)

No public methods.