[IMP] sale(_management): ux improvements on preview quotations

Purpose of this commit is,
-To hide taxes column in preview quotations if no taxes on any SO line,
-Change the size of fa-cart to be bigger for optional products,
-Change the lable of optional product as its compitibale with b2b and b2c tax display mode
-Fix the glitch of optional product quantity update

task-2002587
Closes: #34009

Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
This commit is contained in:
Mitali Patel
2019-06-24 10:28:55 +00:00
parent 7e298c86e6
commit dbf9aac272
3 changed files with 15 additions and 12 deletions
+3 -1
View File
@@ -433,7 +433,9 @@
<th t-if="display_discount" t-attf-class="text-right {{ 'd-none d-sm-table-cell' if report_type == 'html' else '' }}">
<span>Disc.%</span>
</th>
<th t-attf-class="text-right {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">Taxes</th>
<th t-attf-class="text-right {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
<span>Taxes</span>
</th>
<th class="text-right" >
<span groups="account.group_show_line_subtotals_tax_excluded">Amount</span>
<span groups="account.group_show_line_subtotals_tax_included">Total Price</span>
@@ -11,7 +11,7 @@
<thead>
<tr>
<th class="text-left">Description</th>
<th t-if="has_option_discount" groups="sale.group_discount_per_so_line" class="text-left"></th>
<th t-if="has_option_discount" groups="sale.group_discount_per_so_line" class="text-left">Disc.%</th>
<th class="text-right">Unit Price</th>
</tr>
</thead>
@@ -22,7 +22,7 @@
</td>
<td t-if="has_option_discount" groups="sale.group_discount_per_so_line">
<strong t-if="option.discount != 0.0" class="text-info">
<t t-esc="((option.discount % 1) and '%s' or '%d') % option.discount"/>% discount
<t t-esc="((option.discount % 1) and '%s' or '%d') % option.discount"/>%
</strong>
</td>
<td>
@@ -10,17 +10,18 @@
<template id="sale_order_portal_content_inherit_sale_management" name="Order Options" inherit_id="sale.sale_order_portal_content">
<xpath expr="//section[@id='details']//t[@t-set='display_discount']" position="after">
<t t-set="display_remove" t-value="any([line.sale_order_option_ids for line in sale_order.order_line])"/>
<t t-set="display_remove" t-value="sale_order.state in ('draft', 'sent') and any([line.sale_order_option_ids for line in sale_order.order_line])"/>
</xpath>
<xpath expr="//section[@id='details']//table[@id='sales_order_table']/thead/tr" position="inside">
<!-- add blank Tr in thead for layout conciseness -->
<th t-if="display_remove">
</th>
</xpath>
<xpath expr="//section[@id='details']//t[@t-if='not line.display_type']" position="inside">
<td class="text-center" t-if="display_remove">
<a t-att-href="sale_order.get_portal_url(suffix='/update_line/%s' % line.id, query_string='&amp;unlink=True')" class="mb8 js_update_line_json d-print-none" t-if="line.sale_order_option_ids" aria-label="Remove" title="Remove">
<a t-att-href="sale_order.get_portal_url(suffix='/update_line/%s' % line.id, query_string='&amp;unlink=True')" class="mb8 js_update_line_json d-print-none" t-if="sale_order.state in ('draft', 'sent') and line.sale_order_option_ids" aria-label="Remove" title="Remove">
<span class="fa fa-trash-o"></span>
</a>
</td>
@@ -35,9 +36,9 @@
<thead>
<tr>
<th class="text-left">Product</th>
<th t-if="display_discount" class="text-right">
<th t-if="display_discount" class="text-right">Disc.%
</th>
<th class="text-right">Price</th>
<th class="text-right">Unit Price</th>
<th t-if="sale_order.state in ['draft', 'sent'] and report_type == 'html'"></th>
</tr>
</thead>
@@ -49,7 +50,7 @@
</td>
<td t-if="display_discount" class="text-right">
<strong t-if="option.discount" class="text-info">
<t t-esc="((option.discount % 1) and '%s' or '%d') % option.discount"/>% discount
<t t-esc="((option.discount % 1) and '%s' or '%d') % option.discount"/>%
</strong>
</td>
<td>
@@ -65,7 +66,7 @@
</td>
<td class="text-center" t-if="sale_order.state in ['draft', 'sent'] and report_type == 'html'">
<a t-att-href="sale_order.get_portal_url(suffix='/add_option/%s' % option.id)" class="mb8 d-print-none" aria-label="Add to cart" title="Add to cart">
<span class="fa fa-shopping-cart"/>
<span class="fa fa-lg fa-shopping-cart"/>
</a>
</td>
</t>
@@ -78,11 +79,11 @@
<xpath expr="//section[@id='details']//div[@id='quote_qty']" position="replace">
<t t-if="sale_order.state in ['draft', 'sent'] and line.sale_order_option_ids">
<div class="input-group oe_website_spinner">
<div class="input-group oe_website_spinner w-50 pull-right">
<div class="input-group-prepend d-print-none">
<span class="input-group-text">
<a t-att-href="sale_order.get_portal_url(suffix='/update_line/%s' % line.id, query_string='&amp;remove=True')" class="mb8 js_update_line_json" aria-label="Remove one" title="Remove one">
<a t-att-href="sale_order.get_portal_url(suffix='/update_line/%s' % line.id, query_string='&amp;remove=True')" class="js_update_line_json" aria-label="Remove one" title="Remove one">
<span class="fa fa-minus"/>
</a>
</span>
@@ -91,7 +92,7 @@
<input type="text" class="js_quantity form-control" t-att-data-id="line.id" t-att-value="line.product_uom_qty"/>
<div class="input-group-append d-print-none">
<span class="input-group-text">
<a t-att-href="sale_order.get_portal_url(suffix='/update_line/%s' % line.id)" class="mb8 js_update_line_json" aria-label="Add one" title="Add one">
<a t-att-href="sale_order.get_portal_url(suffix='/update_line/%s' % line.id)" class="js_update_line_json" aria-label="Add one" title="Add one">
<span class="fa fa-plus"/>
</a>
</span>