Sometimes companies sell or purchase kit that are composed of multiple products.
Such product can not be managed in Tryton because at the shipment level those kit must be managed by individual components.
Such kit has only meaning for goods (not services). And a kit can not contain goods and services because in most countries the taxes are different.
Another case is to sale a product/service that must always be accompanied by other products (service or goods).
We put all the changes into one new module
product_kit (which will
extras_depend from module
We define a new type of product
kit (this ensures that a kit will not be used in a stock move).
The product has a
One2Many of components. For
kit type, it is required and all the same type. For other types, it is optional and can have mixed types. A component is defined by:
- Product (type =
- Fixed (boolean): define if the quantity must be multiply or not by the kit quantity.
The quantity fields of the product computes for kits the possible quantity of kit available by checking the quantity of each component.
The cost price of a kit is always computed as the sum of the component cost (The cost price method is always set to
On sale and purchase line, a copy of the kit components is stored when a product kit is selected (this is to keep the history of the kit once the order is validated).
Such line computes for each component the stock move to create (using same design for exception). The origin of the stock moves are the component line. The unit price of the moves come from the division of the unit price of the kit using the list price of each component as ratio.
The quantity to invoice (based on shipment) is computed by taking the smallest shipped ratio of the component and apply it to the kit quantity (rounded with the UoM).
All the stock moves are linked to the invoice line but the
moved_quantity compute the quantity like above.
The accounting properties used are those defined on the product kit (and not from the component, it is the user responsibility to ensure coherence).
The prices are also computed using the product kit properties.
When quoting a sale or purchase with product with component (not kit), we create a new line for each component. Those new lines are linked to the not kit product line. This link is used on quote transition to keep synchronized the quantities.