[FIX] website_sale_stock(_option): prevent negative stock & traceback
Before this commit, multiple tabs/session adding items to cart could lead to negative stock displayed in the quantity field. In some case, it could throw a traceback because the wanted product had became unavailable in the meantime, causing the cart to be updated and the line to be deleted from the cart. But then, this line was being accessed again. Now, negative values are prevented at the screen. And there is a check on the line record to be sure it exists before accessing it.
Showing
- addons/website_sale_stock/models/sale_order.py 2 additions, 1 deletionaddons/website_sale_stock/models/sale_order.py
- addons/website_sale_stock/static/src/js/website_sale_stock.js 4 additions, 0 deletions...ns/website_sale_stock/static/src/js/website_sale_stock.js
- addons/website_sale_stock/views/website_sale_stock_templates.xml 1 addition, 1 deletion...website_sale_stock/views/website_sale_stock_templates.xml
- addons/website_sale_stock_options/views/website_sale_stock_templates.xml 1 addition, 1 deletion...sale_stock_options/views/website_sale_stock_templates.xml
Loading
Please register or sign in to comment