# Product Kit Support

**URL:** https://discuss.tryton.org/t/product-kit-support/1938
**Category:** Feature
**Tags:** purchasing, sales
**Created:** [November 12, 2019, 4:27pm UTC](https://discuss.tryton.org/t/product-kit-support/1938 "2019-11-12T16:27:24Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [November 12, 2019, 4:27pm UTC](https://discuss.tryton.org/t/product-kit-support/1938/1 "2019-11-12T16:27:25Z")

</div>

## Rational

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.

## Implementation

> **[Add product kit support (#9391) · Issues · Tryton / Tryton · GitLab](https://foss.heptapod.net/tryton/tryton/-/issues/9391)**
>
> Following https://discuss.tryton.org/t/product-kit-support/1938

---

<div class="post-metadata">

### Author: ![pokoli](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/pokoli/32/22_2.png) [@pokoli](https://discuss.tryton.org/u/pokoli)
#### Post date: [November 12, 2019, 5:29pm UTC](https://discuss.tryton.org/t/product-kit-support/1938/2 "2019-11-12T17:29:38Z")

</div>

When you talk about product do you refer to `product.template` or `product.variant` ?

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [November 12, 2019, 5:34pm UTC](https://discuss.tryton.org/t/product-kit-support/1938/3 "2019-11-12T17:34:50Z")

</div>

I mean '`product.product` like for production (until we have a good design to mix template and product).

---

<div class="post-metadata">

### Author: ![osloar](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/osloar/32/599_2.png) [@osloar](https://discuss.tryton.org/u/osloar)
#### Post date: [November 12, 2019, 6:00pm UTC](https://discuss.tryton.org/t/product-kit-support/1938/4 "2019-11-12T18:00:29Z")

</div>

i. I think it’s a very good initiative!  
Only one detail. A composite article can be formed by Goods or Services.

In my case, for example, a Goods is 1 needle and a Service a visit, a test, … that can be part of the compound.

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [November 12, 2019, 6:05pm UTC](https://discuss.tryton.org/t/product-kit-support/1938/5 "2019-11-12T18:05:10Z")

</div>

> [@osloar](#):
>
> A composite article can be formed by Goods or Services

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.

---

<div class="post-metadata">

### Author: ![osloar](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/osloar/32/599_2.png) [@osloar](https://discuss.tryton.org/u/osloar)
#### Post date: [November 12, 2019, 6:17pm UTC](https://discuss.tryton.org/t/product-kit-support/1938/6 "2019-11-12T18:17:19Z")

</div>

> [@ced](#):
>
> 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.

For example in my case no!

For me a veterinary service I sell at 21 VAT and an article also

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [November 12, 2019, 6:18pm UTC](https://discuss.tryton.org/t/product-kit-support/1938/7 "2019-11-12T18:18:09Z")

</div>

> [@osloar](#):
>
> For me a veterinary service I sell at 21 VAT and an article also

The rate can be the same but the reporting is not. This is standard in all European countries.

---

<div class="post-metadata">

### Author: ![osloar](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/osloar/32/599_2.png) [@osloar](https://discuss.tryton.org/u/osloar)
#### Post date: [November 12, 2019, 6:30pm UTC](https://discuss.tryton.org/t/product-kit-support/1938/8 "2019-11-12T18:30:09Z")

</div>

> [@ced](#):
>
> The rate can be the same but the reporting is not. This is standard in all European countries.

What do you mean by reporting?

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [November 12, 2019, 9:33pm UTC](https://discuss.tryton.org/t/product-kit-support/1938/9 "2019-11-12T21:33:02Z")

</div>

> [@osloar](#):
>
> What do you mean by reporting?

Tax reporting with the [tax code](http://docs.tryton.org/projects/modules-account/en/latest/#tax-code).  
In most case, the tax and base amount of VAT on goods or service are reported in different tax code.

---

<div class="post-metadata">

### Author: ![osloar](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/osloar/32/599_2.png) [@osloar](https://discuss.tryton.org/u/osloar)
#### Post date: [November 12, 2019, 9:54pm UTC](https://discuss.tryton.org/t/product-kit-support/1938/10 "2019-11-12T21:54:52Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [November 12, 2019, 9:56pm UTC](https://discuss.tryton.org/t/product-kit-support/1938/11 "2019-11-12T21:56:59Z")

</div>

So they are not a kit as I said in:

> [@ced](#):
>
> a kit can not contain goods and services because in most countries the taxes are different.

> [@osloar](#):
>
> When making the invoice / sale it must be separated by tax.

They are two lines on the sale.

---

<div class="post-metadata">

### Author: ![osloar](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/osloar/32/599_2.png) [@osloar](https://discuss.tryton.org/u/osloar)
#### Post date: [November 13, 2019, 1:05pm UTC](https://discuss.tryton.org/t/product-kit-support/1938/12 "2019-11-13T13:05:56Z")

</div>

In Spain, for example, in the veterinary sector, a service and goods may have the same VAT.

For example:

Name Product Kit: Castration surgery  
product 1: anesthesia  
product 2: gauze  
product 3: castration (it is a service)

the 3 products have a 21

---

<div class="post-metadata">

### Author: ![pokoli](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/pokoli/32/22_2.png) [@pokoli](https://discuss.tryton.org/u/pokoli)
#### Post date: [November 13, 2019, 1:35pm UTC](https://discuss.tryton.org/t/product-kit-support/1938/13 "2019-11-13T13:35:46Z")

</div>

> [@osloar](#):
>
> Name Product Kit: Castration surgery  
> product 1: anesthesia  
> product 2: gauze  
> product 3: castration (it is a service)

Taxes may be the same but for accouting you should report them in a two diferent accounts: 705 for services and 700 for goods.

For me what you describe is a service product which involves consuming two goods of the warehouse but they are not delivered to the customer.

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [November 13, 2019, 1:50pm UTC](https://discuss.tryton.org/t/product-kit-support/1938/14 "2019-11-13T13:50:59Z")

</div>

> [@pokoli](#):
>
> For me what you describe is a service product which involves consuming two goods of the warehouse but they are not delivered to the customer.

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.

---

<div class="post-metadata">

### Author: ![pokoli](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/pokoli/32/22_2.png) [@pokoli](https://discuss.tryton.org/u/pokoli)
#### Post date: [November 13, 2019, 2:07pm UTC](https://discuss.tryton.org/t/product-kit-support/1938/15 "2019-11-13T14:07:27Z")

</div>

> [@ced](#):
>
> 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.

That sounds good to me but I’m not sure to understand in which case the a addition of sale lines is triggered. Could you please clarify? Thanks

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [November 13, 2019, 2:13pm UTC](https://discuss.tryton.org/t/product-kit-support/1938/16 "2019-11-13T14:13:37Z")

</div>

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](http://hg.tryton.org/modules/sale_shipment_cost/rev/326087629a85/) (or only on quotation) and those added lines will have a link to the main line.

---

<div class="post-metadata">

### Author: ![risto3](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/r/a87d85/32.png) [@risto3](https://discuss.tryton.org/u/risto3)
#### Post date: [November 13, 2019, 2:37pm UTC](https://discuss.tryton.org/t/product-kit-support/1938/17 "2019-11-13T14:37:01Z")

</div>

will this work with the scenario in [https://discuss.tryton.org/t/purchase-product-kit-asset-goods](https://discuss.tryton.org/t/purchase-product-kit-asset-goods) ?

---

<div class="post-metadata">

### Author: ![pokoli](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/pokoli/32/22_2.png) [@pokoli](https://discuss.tryton.org/u/pokoli)
#### Post date: [November 13, 2019, 2:52pm UTC](https://discuss.tryton.org/t/product-kit-support/1938/18 "2019-11-13T14:52:23Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [November 13, 2019, 2:55pm UTC](https://discuss.tryton.org/t/product-kit-support/1938/19 "2019-11-13T14:55:33Z")

</div>

> [@pokoli](#):
>
> What I mean if all kits will use the on\_change\_lines to create compoments lines or only the ones that contain service products?

All the component lines but only for product that does not have the type ‘kit’ and have components.

> [@ced](#):
>
> I think it will work a little bit like the shipment cost before [this change](http://hg.tryton.org/modules/sale_shipment_cost/rev/326087629a85/) (or only on quotation)

I’m definitely in favor of computing only on quotation for the same reason we did for shipment cost.

---

<div class="post-metadata">

### Author: ![osloar](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/osloar/32/599_2.png) [@osloar](https://discuss.tryton.org/u/osloar)
#### Post date: [November 14, 2019, 8:14am UTC](https://discuss.tryton.org/t/product-kit-support/1938/20 "2019-11-14T08:14:20Z")

</div>

This seems better to me! services and goods in the same product kit.

But IMPORTANT a kit can have 2 prices:

Unique price: specified in the generic name of the kit  
Sum of products: the sum of all the products that make up the product kit.

In addition, this price must always be modified when making the sale.

[Next page](https://discuss.tryton.org/t/product-kit-support/1938.md?page=2)
