Subproducts and stock behaviour

Because my employer will switch to Dolibarr soon for production use, I’m trying all functions we might possibly use for their behaviour so we know what to do and expect. (Dolibarr 3.1 installation)

Now I have come across some (for me unexpected) behaviour with subproducts and stock.

Scenario: we sell kits which contains various parts. We buy these parts from our suppliers. We sell the kits but also some of the parts are sold seperately.

I created the kit in Dolibarr and added the parts as subproducts.

Now when I add stock of the kit (manually), stock qty of the kit and stock qty of the parts is increased.

When the kit consists of only 1 part, and I increase stock of the part (manually), stock qty of both the kit and the part is increased.

However, when the kit consists of more than 1 part, and I increase stock of all the parts (manually), the stock of the kit is not increased.

When I decrease stock of the kit (manually), stock of both the kit and the parts is decreased.

But when I decrease stock of the parts, stock of the kit stays the same.

Is this behaviour correct and is it just not possible to sell the parts as well as the kits and keep stock correctly? Is there a document explaining stock behaviour in various cases (it is not on the wiki, but should be useful)? Maybe one of the developers can comment (if you explain it to me, I will put it in the wiki!)

I was thinking it might be useful to add some options to subproducts which define the relation between products and their subproducts and stock behaviour. I’m more than willing to help on this and do some coding work myself. Will this behaviour stay the same in 3.2 or will there be changes in the stock system?

1 Like

When a kit contains several products, when you increase/decrease kit, you will increase/decrease subproduct stocks, but when increase/decrease subproduct will not change kit.

Thank you, that’s clear!

I’m trying to understand the logic but I don’t though. Is this behaviour created with a scenario in mind or because it’s harder to code it otherwise?

No one else having trouble with this?

This was done by purpose, not because it was easier.

Do you need another way to use it ?
Can you provide a real life example ?

Real life example:
We sell a kit containing 3 screwdrivers, 2 wrenches and a “special tool”. They come from 3 different suppliers.
We offer them seperately as well, in other words, a customer can also just order the wrench instead of the kit.

But maybe this is not proper usage of the associated products function?

Could you give me an example how kits should be used? That would really help me understand the function!

Thanks!

I have exactly the same problem. It would be really great to implement some more options to the sub products section.