Odoo Help


6 Answers

Emipro Technologies Pvt. Ltd. India

--Emipro Technologies Pvt. Ltd.--
| 7 8 10
Rajkot, India
--Emipro Technologies Pvt. Ltd.--

Emipro has been providing a wide range of business solutions in the domain of ERP & eCommerce. We take pride in serving 1000s of contented customers across the globe with strong roots in the US, Europe & India. Being a Certified Odoo Gold Partner in India as well as the United States, we bring our rich professional experience and unrivaled technical competence to help our customers obtain efficient and cost-effective business solutions in Odoo. With our team of 50+ Odoo Experts and highly experienced business analysts, we serve our customers which are companies of all sizes, ranging from start-ups to large enterprises. 

Our ERP Services:

  • Business Need Analysis & GAP Analysis

  • ERP Migration

  • Odoo Consultancy

  • Odoo Implementation & Customization

  • Odoo Training & Support

  • Odoo Website & eCommerce Development

  • Odoo Integration (Marketplaces, eCommerce platforms, Shipping Carriers, Payment Gateways etc.)

Our Achievements:

Reach Us:

Website: www.emiprotechnologies.com

Email: info@emiprotechnologies.com

Skype: emiprotech

Emipro Technologies Pvt. Ltd. India
7/4/15, 1:10 AM

Hi Pascal,

You can make your own custom module to manage reset the cart by following below steps...

Step 1. Inherit template of cart and make one .xml file.

<template id="clear_cart_button" inherit_id="website_sale.cart" customize_show="True" name="Clear Cart Button">
<xpath expr="//a[@href='/shop/checkout']" position="before">
    <a href="" id="clear_cart_button" class="btn btn-default mb32">&lt;span class="fa fa-trash-o"/> Clear Cart&lt;/a> 
<!-- This template is use to add .js file inside webiste. -->
<template id="assets_frontend" inherit_id="website.assets_frontend" name="Shop">
<xpath expr="." position="inside">
    <script type="text/javascript" src="/website_sale_clear_cart/static/src/js/website_sale_clear_cart.js"></script> 

Step 2. Make .js file inside /startic/src/js folder to make click event of the link.

$(document).ready(function () {
$('.oe_website_sale').each(function () {
var oe_website_sale = this;
$(oe_website_sale).on("click", ".oe_cart #clear_cart_button", function () {
openerp.jsonRpc("/shop/clear_cart", "call", {}).then(function(){
return false;

Step 3. Add controller inside .py file to manage request of clear cart.

class pos_website_sale(http.Controller):
    @http.route(['/shop/clear_cart'], type='json', auth="public", website=True)
    def clear_cart(self):
        order = request.website.sale_get_order()
        if order:
            for line in order.website_order_line:

That's it. It will add one functionality inside cart template for clear/remove all products from the selected cart.

I am sure that it is very useful for you.

Free App is out at Odoo Apps Store now. You can download  and use it.

Odoo Technical notes is published for this. You can view Technical Stpes to reset a shopping cart in Odoo 8 Website  and review it. 

La Page PT, Pascal Tremblay Canada
7/4/15, 7:38 AM

Thanks for all. Very nice from you. I'm testing. For the moment, I have the button but it doesn't work.

La Page PT, Pascal Tremblay Canada
7/4/15, 7:44 AM

Ok, it works well now! 1000 thanks for your quick answer.

DevBranch Company Limited, Luke Branch Hong Kong
7/8/15, 6:23 AM

Thanks for the post! Do you have any suggestions on how this could be done by order line only? The use case is I want to add an 'x' or trash can icon to the order lines in my own module for a quick cart dropdown in the nav/header (already built), and in the shopping cart order lines.

I'm just wondering if there is an easy way to delete order lines given the method shown above or an alternative.

Oocademy, Yenthe Van Ginneken Belgium
8/17/15, 9:36 AM

@Luke I've did something similar. The view: https://github.com/Yenthe666/Dev/blob/master/aa_houbolak/templates.xml#L358 The JS: https://github.com/Yenthe666/Dev/blob/master/aa_houbolak/static/src/js/houbolak.js#L23-L32 This pretty much shows a delete icon and then deletes the specific line through XML-RPC. I hope this helps you :)

Niraj Pajwani India
10/14/15, 6:51 AM

Thanks a lot.

Really its very helpful for me as well as other also.

Ask a Question
Keep Informed
3 follower(s)
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