[IMP] sale, sale_management, sale_stock: Improve in the portal view.

Small changes in quotation portal view:
* Reposition the 'Expiration Date'
* Added Incoterm info
* Added ":" after address
* Rename Details => Pricing
* Rename Optional Products => Options
* Remove "discount" in the column "discount" after the % In the
section "Options" add "10% discount" like in the printed report
* Add payment terms note

Purpose is to make it a little more beautiful and cleaner
for end user.

Task-1920476
This commit is contained in:
Prakash Prajapati
2019-04-04 08:59:01 +00:00
committed by jem-odoo
parent ed7efc1f3e
commit 4327fbebfd
5 changed files with 33 additions and 19 deletions
+1 -1
View File
@@ -175,7 +175,7 @@
<template id="portal_record_sidebar" name="My Portal Record Sidebar">
<div t-attf-class="col-12 col-lg flex-lg-grow-0 #{classes}">
<div class="card bg-white mb-4" id="sidebar_content">
<div class="card bg-white mb-4 sticky-top" id="sidebar_content">
<div t-if="title" class="card-body text-center pb-2 pt-3">
<t t-raw="title"/>
</div>
+20 -12
View File
@@ -135,7 +135,7 @@
<a t-if="sale_order.has_to_be_signed(True)" role="button" class="btn btn-primary btn-block mb8" data-toggle="modal" data-target="#modalaccept" href="#">
<i class="fa fa-check"/><t t-if="sale_order.has_to_be_paid(True)"> Sign &amp; Pay</t><t t-else=""> Accept &amp; Sign</t>
</a>
<a t-elif="sale_order.has_to_be_paid(True)" role="button" id="o_sale_portal_paynow" class="btn btn-primary btn-block mb8" data-toggle="modal" data-target="#modalaccept" href="#">
<a t-elif="sale_order.has_to_be_paid(True)" role="button" id="o_sale_portal_paynow" data-toggle="modal" data-target="#modalaccept" href="#" t-att-class="'btn-block mb8 %s' % ('btn btn-light' if sale_order.transaction_ids else 'btn btn-primary')" >
<i class="fa fa-check"/> <t t-if="not sale_order.signature">Accept &amp; Pay</t><t t-else="">Pay now</t>
</a>
<div class="o_download_pdf btn-toolbar flex-sm-nowrap">
@@ -330,7 +330,7 @@
</div>
</t>
<div t-elif="sale_order.has_to_be_paid(True)" class="col-sm-auto mt8">
<a role="button" class="btn btn-primary" data-toggle="modal" data-target="#modalaccept" href="#">
<a role="button" data-toggle="modal" data-target="#modalaccept" href="#" t-att-class="'%s' % ('btn btn-light' if sale_order.transaction_ids else 'btn btn-primary')">
<i class="fa fa-check"/> <t t-if="not sale_order.signature">Accept &amp; Pay</t><t t-else="">Pay now</t>
</a>
</div>
@@ -373,21 +373,23 @@
</t>
</t>
</div>
<div class="mb-3">
<strong>Date:</strong> <span t-field="sale_order.create_date" t-options='{"widget": "date"}'/>
</div>
<div class="mb-3" t-if="sale_order.validity_date">
<strong>Expiration Date:</strong> <span t-field="sale_order.validity_date" t-options='{"widget": "date"}'/>
<div class="row" id="so_date">
<div class="mb-3 col-6">
<strong>Date:</strong> <span t-field="sale_order.create_date" t-options='{"widget": "date"}'/>
</div>
<div class="mb-3 col-6" t-if="sale_order.validity_date">
<strong>Expiration Date:</strong> <span t-field="sale_order.validity_date" t-options='{"widget": "date"}'/>
</div>
</div>
<div class="row">
<div class="col-lg-6">
<strong t-if="sale_order.partner_shipping_id == sale_order.partner_invoice_id" class="d-block mb-1">Invoicing and Shipping Address</strong>
<strong t-if="sale_order.partner_shipping_id != sale_order.partner_invoice_id" class="d-block mb-1">Invoicing Address</strong>
<strong t-if="sale_order.partner_shipping_id == sale_order.partner_invoice_id" class="d-block mb-1">Invoicing and Shipping Address:</strong>
<strong t-if="sale_order.partner_shipping_id != sale_order.partner_invoice_id" class="d-block mb-1">Invoicing Address:</strong>
<address t-field="sale_order.partner_invoice_id" t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}'/>
</div>
<t t-if="sale_order.partner_shipping_id != sale_order.partner_invoice_id">
<div id="shipping_address" class="col-lg-6">
<strong class="d-block mb-1">Shipping Address</strong>
<strong class="d-block mb-1">Shipping Address:</strong>
<address t-field="sale_order.partner_shipping_id" t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}'/>
</div>
</t>
@@ -417,7 +419,7 @@
</div>
<section id="details" style="page-break-inside: auto;" class="mt32">
<h3 id="details">Details</h3>
<h3 id="details">Pricing</h3>
<t t-set="display_discount" t-value="True in [line.discount > 0 for line in sale_order.order_line]"/>
@@ -468,7 +470,7 @@
</td>
<td t-if="display_discount" t-attf-class="text-right {{ 'd-none d-sm-table-cell' if report_type == 'html' else '' }}">
<strong t-if="line.discount &gt; 0" class="text-info">
<t t-esc="((line.discount % 1) and '%s' or '%d') % line.discount"/>% discount
<t t-esc="((line.discount % 1) and '%s' or '%d') % line.discount"/>%
</strong>
</td>
<td t-attf-class="text-right {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
@@ -578,6 +580,12 @@
<hr class="mt-0 mb-1"/>
<em t-field="sale_order.note"/>
</section>
<section class="mt-5" t-if="sale_order.payment_term_id">
<h3 class="">Payment terms</h3>
<hr class="mt-0 mb-1"/>
<span t-field="sale_order.payment_term_id"/>
</section>
</div>
</template>
+1 -1
View File
@@ -540,7 +540,7 @@
</div>
<field name="amount_total" nolabel="1" class="oe_subtotal_footer_separator" widget='monetary' options="{'currency_field': 'currency_id'}"/>
</group>
<field name="note" class="oe_inline" placeholder="Terms and conditions... (note: you can setup default ones in the Configuration menu)"/>
<field name="note" class="oe_inline" placeholder="Terms and conditions... Configuration menu)"/>
<div class="oe_clear"/>
</group>
</page>
@@ -30,14 +30,13 @@
<xpath expr="//section[@id='signature']" position="after">
<t t-if="any([(not option.line_id) for option in sale_order.sale_order_option_ids])">
<section>
<h3>Optional Products</h3>
<t t-set="display_discount" t-value="True in [option.discount for option in sale_order.sale_order_option_ids]"/>
<h3>Options</h3>
<t t-set="display_discount" t-value="True in [option.discount > 0 for option in sale_order.sale_order_option_ids]"/>
<table class="table table-sm">
<thead>
<tr>
<th class="text-left">Product</th>
<th t-if="display_discount" class="text-right">
<span>Discount</span>
</th>
<th class="text-right">Price</th>
<th t-if="sale_order.state in ['draft', 'sent'] and report_type == 'html'"></th>
@@ -49,8 +48,8 @@
<td>
<div t-field="option.name"/>
</td>
<td t-if="display_discount">
<strong t-if="option.discount" class="text-info text-right">
<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
</strong>
</td>
@@ -1,6 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="sale_order_portal_content_inherit_sale_stock" name="Orders Shipping Followup" inherit_id="sale.sale_order_portal_content">
<xpath expr="//div[@id='so_date']" position="after">
<div class="row" t-if="sale_order.incoterm">
<div class="mb-3 col-6 ml-auto">
<strong>Incoterm: </strong> <span t-field="sale_order.incoterm"/>
</div>
</div>
</xpath>
<xpath expr="//div[@id='informations']" position="inside">
<t t-if="sale_order.picking_ids">
<div>