Open augusto-weiss opened 2 months ago
Hi @ernestotejeda, some modules you are maintaining are being modified, check this out!
Hello @pedrobaeza @victoralmau Could you check this issue, and let me know what do you think about the solution ?
This must be handled in website_sale_product_pack
, not here. You have also missed the pack setup, products configurations, etc.
ok i understand, but I don't know if the problem has its origin on the website.
following the method _compute_quantities_dict the pack components return 0, and do not compute quantities correctly
About the pack I use non detailed (2nd img)
Hi @pedrobaeza i moved code to website_sale_product_pack. Let me know your opinion ? Thanks
Hi @pedrobaeza I was analyzing the issue in depth and following the call stack, I noticed that the compute_dict_qty method is called on the following line (link), so i should inherit the _get_cart_and_free_qty method. But.. to do that I should add the dependency to website_sale_stock.
Let me know your opinion!
def _get_cart_and_free_qty(self, line=None, product=None, **kwargs):
if (line and line.product_id.pack_ok) or (product and product.pack_ok):
return 0, 0
return super()._get_cart_and_free_qty(line=line, product=product, **kwargs)
Then it seems we need a website_sale_stock_product_pack
glue module for keeping modularity. It's true that you can sell packs (of services, for example), without the need of having stocks. Anyway, why isn't this a problem on backend?
Hi @pedrobaeza Also happens in the backend... but by default is not blocking the possibility of confirming a sale order
Including the first approach (in stock_product_pack):
Compute quantities for packs:
The error: Could not finish a checkout process on website due to stock restriction
Reproduce error: Create a pack. Set pack as storable product, and set out of stock continue selling in FALSE Make sure you have stock of pack lines. Go to website and buy the pack Try to finish the checkout process and you have the error
Also with this PR we ensure not to over-sell packs discriminating outgoing quantity in available quantity (line 37)