PrestaShop/PrestaShop — pull request #985 by dlage (2013-11-16 13:07:49+00:00)
Title: [-] BO: Fix stock when combinations are removed.

The stock for a product currently gets messed up when you remove the combinations from it.
The steps to reproduce are:

1. Create a product with combinations
1. Use advanced stock management and add stock for the combinations
1. Remove all combinations

After that, the product is shown with the combined stock, but you are unable to manage it (because the stock is specific to an attribute).

As I see it there are at least three viable options to avoid the current behaviour:

1. Always specifying `id_product_attribute=0` when not given in the queries to `ps_stock` **(this is the approach I took in this PR)**
1. Removing stock together with the product combination (this might be the best option since you can't really recover the combination)
1. Change stock entries for a deleted combination to `id_product_attribute=0`

If you believe there's a better approach please share it.