Merge branch 'new/13.0/H4721_sale_exception_website__show_exceptions' into '13.0'

new/13.0/H4721_sale_exception_website__show_exceptions into 13.0

See merge request hibou-io/hibou-odoo/suite!761
This commit is contained in:
Kaylie Kipe
2021-01-10 16:40:50 +00:00
3 changed files with 62 additions and 0 deletions

View File

View File

@@ -0,0 +1,22 @@
{
'name': 'Sale Exception Website',
'summary': 'Display sale exceptions on eCommerce site',
'version': '13.0.1.0.0',
'author': "Hibou Corp.",
'category': 'Sale',
'license': 'AGPL-3',
'website': "https://hibou.io",
'description': """
Display sale exceptions on eCommerce site and prevent purchases
""",
'depends': [
'sale_exception_portal',
'website_sale',
],
'demo': [],
'data': [
'views/website_templates.xml',
],
'auto_install': False,
'installable': True,
}

View File

@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<template id="payment_inherit" inherit_id="website_sale.payment" name="Payment Exceptions">
<!-- Show confirmation page if there are no sale order exceptions -->
<xpath expr="//div[@id='wrap']//div[hasclass('oe_cart')]" position="attributes">
<attribute name="t-if">not order._check_sale_order_exceptions()</attribute>
</xpath>
<!-- Display sale order exceptions if any are found -->
<xpath expr="//div[@id='wrap']//div[hasclass('oe_cart')]" position="after">
<t t-if="order._check_sale_order_exceptions()">
<t t-set="exceptions" t-value="order._check_sale_order_exceptions()" />
<div class="col-12 col-xl order-xl-1">
<div class="card bg-danger text-white">
<div class="card-body">
<t t-foreach="exceptions" t-as="exception">
<h4>
<i class="fa fa-warning mr-1" />
<strong><span t-esc="exception['title']"/></strong>
</h4>
<p><span t-esc="exception['description']"/></p>
</t>
</div>
</div>
<div class="row">
<div class="ml-auto mr-3 mt-2">
<a href="/shop/cart" class="float-right btn btn-primary">
<span>Back to Cart
<span class="fa fa-shopping-cart"/>
</span>
</a>
</div>
</div>
</div>
</t>
</xpath>
</template>
</odoo>