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).
Proposal
We put all the changes into one new module product_kit (which will extras_depend from module sale and purchase).
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:
Quantity
UoM
Product (type = goods or assets)
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 fixed).
On sale and purchase line, a copy of the kit components is stored for each product kit when the order is quoted (this is to keep the history of the kit once the order is validated). The copy is cleared if the order is reset to draft.
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.
I can not see how such beast could exist in accounting.
In every country, I have seen that accounting is separating service and goods and taxes are different between goods and service.
I don’t know in other sectors I speak for what affects me. In my case it is simple both a service and a goods can be part of a compound. When making the invoice / sale it must be separated by tax.
Well you can see those goods as consumable, in this case their cost will be accounted as general cost for the company.
Or you actually delivery the goods to the customer (even if they are not shipped to the customer but consume in-place) and so you have to invoice them.
I think I could improve the proposal to allow ‘service’ or ‘goods’ to define components. In such case when such product is selected on a sale, this trigger the addition of a line for each component. The quantity are kept in sync and each line has its own price and its own taxes. The components on non-kit product can be of any type (goods or service).
Now about the kit behavior, we need to fill a unit price on the stock move created. I think the best way is to divide the sale unit price base on the list price of each component.
I think it will be based on on_change_lines. I think it will work a little bit like the shipment cost before this change (or only on quotation) and those added lines will have a link to the main line.
What I mean if all kits will use the on_change_lines to create compoments lines or only the ones that contain service products?
When all components are goods it makes sense to include only the kit on the purchae/sale (and invoce) line but include all the components on the shipments.