125 lines
6.1 KiB
XML
125 lines
6.1 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
<template id="cart_lines_min_max_qty" inherit_id="website_sale.cart_lines" name="Shopping Cart Lines">
|
|
<xpath expr="//th[hasclass('td-qty')]" position="after">
|
|
<th class="text-center td-qty">
|
|
<t t-if="show_qty">
|
|
<span>Max qty.</span>
|
|
</t>
|
|
</th>
|
|
</xpath>
|
|
<xpath expr="//td[hasclass('td-qty')]" position="after">
|
|
<td class="text-center td-qty">
|
|
<div class="css_quantity input-group mx-auto justify-content-center">
|
|
<t t-if="not line._is_not_sellable_line()">
|
|
<t t-if="show_qty">
|
|
<a
|
|
t-attf-href="#"
|
|
class="btn btn-link js_add_cart_json d-none d-md-inline-block"
|
|
aria-label="Remove one"
|
|
title="Remove one"
|
|
>
|
|
<i class="fa fa-minus"/>
|
|
</a>
|
|
<input
|
|
type="text"
|
|
name="max-qty"
|
|
class="js_quantity form-control quantity"
|
|
t-att-data-line-id="line.id"
|
|
t-att-data-product-id="line.product_id.id"
|
|
t-att-value="line.product_uom_max_qty and int(line.product_uom_max_qty) or int(line.product_uom_qty)"
|
|
t-att-data-min="int(line.product_uom_qty)"
|
|
/>
|
|
<t t-if="line._get_shop_warning(clear=False)">
|
|
<a t-attf-href="#" class="btn btn-link">
|
|
<i
|
|
class='fa fa-warning text-warning'
|
|
t-att-title="line._get_shop_warning()"
|
|
role="img"
|
|
aria-label="Warning"
|
|
/>
|
|
</a>
|
|
</t>
|
|
<a
|
|
t-else=''
|
|
t-attf-href="#"
|
|
class="btn btn-link float_left js_add_cart_json d-none d-md-inline-block"
|
|
aria-label="Add one"
|
|
title="Add one"
|
|
>
|
|
<i class="fa fa-plus"/>
|
|
</a>
|
|
</t>
|
|
<t t-else="">
|
|
<input
|
|
type="hidden"
|
|
class="js_quantity form-control quantity"
|
|
t-att-data-line-id="line.id"
|
|
t-att-data-product-id="line.product_id.id"
|
|
t-att-value="int(line.product_uom_qty) == line.product_uom_qty and int(line.product_uom_qty) or line.product_uom_qty"
|
|
/>
|
|
</t>
|
|
</t>
|
|
<t t-else="">
|
|
<span class="text-muted w-100" t-esc="int(line.product_uom_qty)"/>
|
|
<input
|
|
type="hidden"
|
|
class="js_quantity form-control quantity"
|
|
t-att-data-line-id="line.id"
|
|
t-att-data-product-id="line.product_id.id"
|
|
t-att-value="line.product_uom_qty"
|
|
/>
|
|
</t>
|
|
</div>
|
|
</td>
|
|
</xpath>
|
|
</template>
|
|
<template id="cart_summary_min_max_qty" inherit_id="website_sale.cart_summary" name="Cart right column">
|
|
<xpath expr="//th[hasclass('td-qty')]" position="after">
|
|
<th class="border-top-0 td-qty">Max qty.</th>
|
|
</xpath>
|
|
<xpath expr="//td[hasclass('td-qty')]" position="after">
|
|
<td class='td-qty'>
|
|
<div t-esc="line.product_uom_max_qty"/>
|
|
</td>
|
|
</xpath>
|
|
</template>
|
|
<template id="total" inherit_id="website_sale.total">
|
|
<xpath expr="//tr[@id='empty']" position="after">
|
|
<tr id="balance">
|
|
<td class="text-end border-0">Balance:</td>
|
|
<td class="text-xl-end border-0">
|
|
<span
|
|
t-field="website_sale_order.balance"
|
|
class="monetary_field"
|
|
style="white-space: nowrap;"
|
|
t-options="{'widget': 'monetary', 'display_currency': website_sale_order.currency_id}"
|
|
/>
|
|
</td>
|
|
</tr>
|
|
</xpath>
|
|
<xpath expr="//tr[@id='order_total']" position="after">
|
|
<tr id="updated_balance">
|
|
<td class="text-end border-0">New balance:</td>
|
|
<td class="text-xl-end border-0">
|
|
<t t-if="website_sale_order.updated_balance < 0">
|
|
<span
|
|
t-field="website_sale_order.updated_balance"
|
|
class="monetary_field text-danger"
|
|
style="white-space: nowrap;"
|
|
t-options="{'widget': 'monetary', 'display_currency': website_sale_order.currency_id}"
|
|
/>
|
|
</t>
|
|
<t t-else="">
|
|
<span
|
|
t-field="website_sale_order.updated_balance"
|
|
t-att-class="monetary_field"
|
|
style="white-space: nowrap;"
|
|
t-options="{'widget': 'monetary', 'display_currency': website_sale_order.currency_id}"
|
|
/>
|
|
</t>
|
|
</td>
|
|
</tr>
|
|
</xpath>
|
|
</template>
|
|
</odoo>
|