[IMP] website_sale: switch column price and quantity in front end
This commit is contained in:
@@ -630,8 +630,8 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="2" width="100">Product</th>
|
||||
<th width="100">Price</th>
|
||||
<th width="120">Quantity</th>
|
||||
<th width="100">Price</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -650,20 +650,7 @@
|
||||
</div>
|
||||
<div class="text-muted" t-esc="'\n'.join(line.name.splitlines()[1:])"/>
|
||||
</td>
|
||||
<td class="text-center" name="price">
|
||||
<del class="text-danger" t-att-style="'' if (compute_currency(line.product_id.lst_price) - line.price_reduce) > 1 else 'display: none;'" style="text-decoration: line-through; white-space: nowrap;"
|
||||
t-field="line.product_id.lst_price" t-field-options='{
|
||||
"widget": "monetary",
|
||||
"from_currency": "line.company_id.currency_id",
|
||||
"display_currency": "user_id.partner_id.property_product_pricelist.currency_id"
|
||||
}'/>&nbsp;
|
||||
<span t-field="line.price_reduce" style="white-space: nowrap;" t-field-options='{
|
||||
"widget": "monetary",
|
||||
"from_currency": "website_sale_order.pricelist_id.currency_id",
|
||||
"display_currency": "user_id.partner_id.property_product_pricelist.currency_id"
|
||||
}'/>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<td class="text-center" id="td-qty">
|
||||
<div class="input-group oe_website_spinner">
|
||||
<a t-attf-href="#" class="mb8 input-group-addon js_add_cart_json" data-no-instant="">
|
||||
<i class="fa fa-minus"></i>
|
||||
@@ -677,6 +664,19 @@
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-center" id="td-price" name="price">
|
||||
<del class="text-danger" t-att-style="'' if (compute_currency(line.product_id.lst_price) - line.price_reduce) > 1 else 'display: none;'" style="text-decoration: line-through; white-space: nowrap;"
|
||||
t-field="line.product_id.lst_price" t-field-options='{
|
||||
"widget": "monetary",
|
||||
"from_currency": "line.company_id.currency_id",
|
||||
"display_currency": "user_id.partner_id.property_product_pricelist.currency_id"
|
||||
}'/>&nbsp;
|
||||
<span t-field="line.price_reduce" style="white-space: nowrap;" t-field-options='{
|
||||
"widget": "monetary",
|
||||
"from_currency": "website_sale_order.pricelist_id.currency_id",
|
||||
"display_currency": "user_id.partner_id.property_product_pricelist.currency_id"
|
||||
}'/>
|
||||
</td>
|
||||
</tr>
|
||||
</t>
|
||||
</tbody>
|
||||
@@ -987,8 +987,8 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="2" width="80">Product</th>
|
||||
<th width="100">Price</th>
|
||||
<th width="120">Quantity</th>
|
||||
<th width="100">Price</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -1003,6 +1003,9 @@
|
||||
<td t-if="line.product_id.product_tmpl_id">
|
||||
<strong t-field="line.product_id.with_context(display_default_code=False).display_name"/>
|
||||
</td>
|
||||
<td>
|
||||
<div t-esc="line.product_uom_qty"/>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<span t-field="line.price_unit" style="white-space: nowrap;" t-field-options='{
|
||||
"widget": "monetary",
|
||||
@@ -1010,9 +1013,6 @@
|
||||
"display_currency": "user_id.partner_id.property_product_pricelist.currency_id"
|
||||
}'/>
|
||||
</td>
|
||||
<td>
|
||||
<div t-esc="line.product_uom_qty"/>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -11,13 +11,13 @@
|
||||
</template>
|
||||
|
||||
<template id="optional_products" inherit_id="website_sale.cart" name="Optional products">
|
||||
<xpath expr="//table[@id='cart_products']/tbody//td[last()]/div" position="attributes">
|
||||
<xpath expr="//table[@id='cart_products']/tbody//td[@id='td-qty']/div" position="attributes">
|
||||
<attribute name="t-if">not line.linked_line_id</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//table[@id='cart_products']/tbody//tr" position="attributes">
|
||||
<attribute name="t-att-class">'optional_product info' if line.linked_line_id else ''</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//table[@id='cart_products']/tbody//td[last()]" position="inside">
|
||||
<xpath expr="//table[@id='cart_products']/tbody//td[@id='td-qty']" position="inside">
|
||||
<t t-if="line.linked_line_id">
|
||||
<span class="js_quantity text-muted" t-att-data-line-id="line.id" t-att-data-product-id="line.product_id.id" t-esc="int(line.product_uom_qty)"/>
|
||||
</t>
|
||||
|
||||
Reference in New Issue
Block a user