Odoo Help


Is there any way to prevent customers to buy products with no stock on ecommerce?

Xavier Micharet
on 2/9/15, 12:15 PM 467 views

I have been testing Odoo in order to implement it for my ecommerce and, despite I think is the best option for what I need, I have found one problem that makes it useless for my organization.

The ecommerce module allows you to buy products even when you have no stock. If I have no stock I need to show a message saying that the product is not available and dissable the add to cart button. Inspecting the website.sale_producte template I have seen that these options are in the code but they appear not to work.

<p t-if="len(product.product_variant_ids) &gt; 1" class="css_not_available_msg bg-danger" style="padding: 15px;">Product not available</p>

                    <a id="add_to_cart" class="btn btn-primary btn-lg mt8 js_check_product a-submit" href="#">Add to Cart</a>

Has any one found a solution for this?

On 1/27/16, 8:18 AM

Hi Xavier,

I have gone through your query and tried to replicate the same.In order to prevent customers to buy products with no stock on eCommerce I have a recommendation which might solve your problem.

Hence as a solution to your query, we already have a module which caters to your need.

Kindly check the below mentioned link for more info :- 


Hope this helps.



This is duplicated,  the answer of this is on this question.



Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 2/9/15, 12:15 PM
Seen: 467 times
Last updated: 1/27/16, 8:18 AM