Skip to content

Commit

Permalink
[IMP] website_sale_order_to_cart: Add cancel sale.order button
Browse files Browse the repository at this point in the history
  • Loading branch information
unaiberis committed Oct 7, 2024
1 parent b67e758 commit 52d0638
Showing 1 changed file with 11 additions and 23 deletions.
34 changes: 11 additions & 23 deletions website_sale_order_to_cart/views/website_templates.xml
Original file line number Diff line number Diff line change
@@ -1,39 +1,31 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<template id="sale_order_cart_inherit" inherit_id="website_sale.cart">
<xpath
expr="//div[hasclass('justify-content-between')]/div[1]"
position="after"
>
<xpath expr="//div[hasclass('justify-content-between')]/div[1]" position="after">
<t t-if="website_sale_order.id">
<div>
<a
class="btn btn-primary mb32"
role="button"
t-att-href="'/action_quotation_mark_send?order_id=' + str(website_sale_order.id)"
>
<a class="btn btn-primary mb32" role="button" t-att-href="'/action_quotation_mark_send?order_id=' + str(website_sale_order.id)">
<span>Confirm Cart</span>
</a>
<a class="btn btn-danger mb32" role="button" t-att-href="'/cancel_sale_order?order_id=' + str(website_sale_order.id)">
<span>Cancel Cart</span>
</a>
</div>
</t>
</xpath>
</template>

<template
id="sale_order_portal_template_inherit"
inherit_id="sale.sale_order_portal_template"
>
<template id="sale_order_portal_template_inherit" inherit_id="sale.sale_order_portal_template">
<xpath expr="//a[@id='o_sale_portal_paynow']" position="after">
<t t-if="sale_order.id">
<div class="d-flex justify-content-center">
<div>
<a
class="btn btn-primary mb32"
role="button"
t-att-href="'/sale_order_to_cart?order_id=' + str(sale_order.id)"
>
<a class="btn btn-primary mb32" role="button" t-att-href="'/sale_order_to_cart?order_id=' + str(sale_order.id)">
<span>Change Order</span>
</a>
<a class="btn btn-danger mb32" role="button" t-att-href="'/cancel_sale_order?order_id=' + str(sale_order.id)">
<span>Cancel Order</span>
</a>
</div>
</div>
</t>
Expand All @@ -43,12 +35,8 @@
<attribute name="t-if">False</attribute>
</xpath>

<xpath
expr="//div[@id='sale_order_communication']/preceding-sibling::div[1]"
position="attributes"
>
<xpath expr="//div[@id='sale_order_communication']/preceding-sibling::div[1]" position="attributes">
<attribute name="t-if">False</attribute>
</xpath>

</template>
</odoo>

0 comments on commit 52d0638

Please sign in to comment.