[IMP] sale,sale_stock,website_sale_delivery: SO portal

Change the design to let the delivery_tracking_ref beeing displayed
properly.
This commit is contained in:
Pierre Masereel
2019-03-15 09:10:43 +00:00
parent 86a454dae3
commit 6e77653eb4
3 changed files with 19 additions and 24 deletions
+7 -6
View File
@@ -400,15 +400,16 @@
<ul class="list-group mb-4">
<t t-foreach="invoices" t-as="i">
<t t-set="report_url" t-value="i.get_portal_url(report_type='pdf', download=True)"/>
<a class="list-group-item list-group-item-action d-flex flex-wrap align-items-center justify-content-between py-2 px-3" t-att-href="report_url">
<div class="d-flex flex-wrap align-items-center justify-content-between">
<div>
<i class="fa fa-download mr-1" role="img" aria-label="Download" title="Download"/>
<span t-esc="i.number" class="mr-lg-3"/>
<a t-att-href="report_url">
<span t-esc="i.number"/>
</a>
<div class="small d-lg-inline-block">Date: <span class="text-muted" t-field="i.date_invoice"/></div>
</div>
<span t-if="i.state == 'paid'" class="small text-success orders_label_text_align"><i class="fa fa-fw fa-check"/> <b>Paid</b></span>
<span t-else="" class="small text-info orders_label_text_align"><i class="fa fa-fw fa-clock-o"/> <b>Waiting Payment</b></span>
</a>
<span t-if="i.state == 'paid'" class="small badge badge-success orders_label_text_align"><i class="fa fa-fw fa-check"/> <b>Paid</b></span>
<span t-else="" class="small badge badge-info orders_label_text_align"><i class="fa fa-fw fa-clock-o"/> <b>Waiting Payment</b></span>
</div>
</t>
</ul>
</div>
@@ -9,22 +9,16 @@
<div>
<t t-foreach="sale_order.picking_ids.filtered(lambda picking: picking.picking_type_id.code != 'internal')" t-as="i">
<t t-set="delivery_report_url" t-value="'/my/picking/pdf/%s?%s' % (i.id, keep_query())"/>
<div id='picking_info'>
<a t-att-href="delivery_report_url"><span class="fa fa-download" role="img" aria-label="Download" title="Download"/></a>
<a t-att-href="delivery_report_url"><span t-field="i.name"/></a>
<span class="text-muted" t-field="i.date" t-options='{"widget": "date"}'/>
<t t-if="i.state == 'done'">
<span class="badge badge-success label-text-align"><i class="fa fa-fw fa-truck"/> Shipped</span>
</t>
<t t-if="i.state == 'partially_available'">
<span class="badge badge-warning label-text-align"><i class="fa fa-fw fa-clock-o"/> Partially Available</span>
</t>
<t t-if="i.state == 'cancel'">
<span class="badge badge-danger label-text-align"><i class="fa fa-fw fa-times"/> Cancelled</span>
</t>
<t t-if="i.state in ['draft', 'waiting', 'confirmed', 'assigned']">
<span class="badge badge-info label-text-align"><i class="fa fa-fw fa-clock-o"/> Preparation</span>
</t>
<div class="d-flex flex-wrap align-items-center justify-content-between o_sale_stock_picking">
<div>
<a t-att-href="delivery_report_url">
<span t-esc="i.name"/>
</a>
<div class="small d-lg-inline-block ml-3">Date: <span class="text-muted" t-field="i.date" t-options="{'date_only': True}"/></div>
</div>
<span t-if="i.state == 'done'" class="small badge badge-success orders_label_text_align"><i class="fa fa-fw fa-truck"/> <b>Shipped</b></span>
<span t-if="i.state == 'cancel'" class="small badge badge-danger orders_label_text_align"><i class="fa fa-fw fa-times"/> <b>Cancelled</b></span>
<span t-if="i.state in ['draft', 'waiting', 'confirmed', 'assigned']" class="small badge badge-info orders_label_text_align"><i class="fa fa-fw fa-clock-o"/> <b>Preparation</b></span>
</div>
</t>
</div>
@@ -71,8 +71,8 @@
</template>
<template id="sale_order_portal_content_inherit_sale_stock_inherit_website_sale_delivery" name="Shipping tracking on orders followup" inherit_id="sale_stock.sale_order_portal_content_inherit_sale_stock">
<xpath expr="//div[@id='picking_info']" position="after">
<div t-if="i.carrier_tracking_ref">
<xpath expr="//div[hasclass('o_sale_stock_picking')]/div" position="after">
<div t-if="i.carrier_tracking_ref" class="small d-lg-inline-block">
Tracking: <span t-field="i.carrier_id.name"/>
<t t-if="i.carrier_tracking_url">
<a t-att-href="i.carrier_tracking_url" target="_blank"><span t-field="i.carrier_tracking_ref"/></a>