When using EAN14 barcodes there are two quantities two manage on order lines:
The number of packages.
The number of units to be sold. (Which can be computed with: quantity of packages * package size).
In such case it is quite common that the user sets the quantity using the package size, and the final quantity (which determines the unit_price) is updated acordingly.
I tought using secundary units for this, but the problem is that we may have multiple secondary units. Let me explain:
A pencil can be sold in the following packages:
A package of 6 units
A box of 10 packages, so 60 units.
A pallet of 120 box, 7200 units.
But a pen can be sold with:
A package of 9 units
A box of 8 packages, so 80 units.
A pallet of 100 boxes, 8000 units.
For each product the rate of package, box, and pallet conversion it is different which forces the user to create a different units for each product, which makes nearly unmanegable when the number of products starts to grow.
I would rather use a new model for such case. Create the product for just one unit and then add several ‘pacakges’ with the name and quantity. Maybe something like GitHub - NaN-tic/trytond-product_package can help you. The barcode then should also live on that level and searching the product should also search the new model.
After some thoughts I think the module should depend on stock_package module. The package, box or pallet should be a record of the stock.package.type module.
This will allow to:
Define on the sale/purchase order the number of the packages requested (which is usefull when selling a fruits/vegetables or some other packaged products which are sold by weight but the exact price is not quite relevant).
When creating the shipment, automatically create the packages based on what the requested on the user.