[IMP] stock, delivery: usability changes in the package barcode report.

task-1889404

Closes #29209
This commit is contained in:
Prakash Prajapati
2019-07-31 08:04:38 +00:00
committed by William Henrotin
parent 8aebeb2f03
commit bdb61d2c2f
2 changed files with 43 additions and 57 deletions
@@ -1,28 +1,19 @@
<odoo> <odoo>
<template id="report_package_barcode_delivery" inherit_id="stock.report_package_barcode"> <template id="report_package_barcode_delivery" inherit_id="stock.report_package_barcode">
<xpath expr="//div[hasclass('o_packaging_type')]" position="after"> <xpath expr="//div[hasclass('o_packaging_type')]" position="after">
<table class="table table-sm"> <div t-if="o.shipping_weight" class="col-auto">
<thead> <strong>Shipping Weight:</strong>
<tr> <br/>
<th t-if="o.shipping_weight"><strong>Shipping Weight</strong></th> <span t-field="o.shipping_weight"/>
</tr> <span t-esc="env['product.template']._get_weight_uom_id_from_ir_config_parameter().display_name"/>
</thead> </div>
<tbody>
<tr>
<td t-if="o.shipping_weight">
<span t-field="o.shipping_weight"/>
<t t-esc="env['product.template']._get_weight_uom_id_from_ir_config_parameter().name"/>
</td>
</tr>
</tbody>
</table>
</xpath> </xpath>
</template> </template>
<template id="report_package_barcode_small_delivery" inherit_id="stock.report_package_barcode_small"> <template id="report_package_barcode_small_delivery" inherit_id="stock.report_package_barcode_small">
<xpath expr="//div[hasclass('o_packaging_type')]" position="after"> <xpath expr="//div[hasclass('o_packaging_type')]" position="after">
<div class="row o_package_shipping_weight" t-if="o.shipping_weight"> <div class="row o_package_shipping_weight" t-if="o.shipping_weight">
<div class="col-12" style="font-size:24px; font-weight:bold;">Shipping Weight: <span t-field="o.shipping_weight"/></div> <div class="col-12 text-center" style="font-size:24px; font-weight:bold;">Shipping Weight: <span t-field="o.shipping_weight"/> <t t-esc="env['product.template']._get_weight_uom_id_from_ir_config_parameter().display_name"/></div>
</div> </div>
</xpath> </xpath>
</template> </template>
+36 -41
View File
@@ -9,51 +9,49 @@
<div class="oe_structure"/> <div class="oe_structure"/>
<table class="table table-condensed" style="border-bottom: 0px solid white !important;"> <table class="table table-condensed" style="border-bottom: 0px solid white !important;">
<tr> <tr>
<th> <th>
<h1 t-field="o.name" class="mt0 float-left"/> <h1 t-field="o.name" class="mt0 float-left"/>
</th> </th>
<th style="text-align: center"> <th style="text-align: center">
<img t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s' % ('Code128', o.name, 600, 100)" alt="Barcode" <img t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s' % ('Code128', o.name, 600, 100)" alt="Barcode"
style="width:300px;height:50px"/> style="width:300px;height:50px"/>
<p t-field="o.name"/> <p t-field="o.name"/>
</th> </th>
</tr> </tr>
</table> </table>
<div class="row o_packaging_type" t-if="o.packaging_id"> <div class="row mt32 mb32">
<div class="col-12" style="font-weight:bold;">Package Type: <span t-field="o.packaging_id.name"/></div> <div t-if="o.packaging_id" class="o_packaging_type col-auto">
</div> <strong>Package Type:</strong>
<div class="row"> <p t-field="o.packaging_id.name"/>
<div class="col-12">
<h2>Package Content</h2>
</div>
</div>
<div class="row">
<div class="col-8">
<table class="table table-sm" style="border-bottom: 0px solid white !important;">
<thead>
<tr>
<th>Product</th>
<th class="text-right">Quantity</th>
<th class="text-right">Lot/Serial Number</th>
</tr>
</thead>
<tbody>
<tr t-foreach="o.quant_ids" t-as="l">
<td>
<span t-field="l.product_id.name"/>
</td>
<td class="text-right">
<span t-field="l.quantity"/>
<span groups="uom.group_uom" t-field="l.product_id.uom_id.name"/>
</td>
<td>
<t t-if="l.lot_id"><span t-field="l.lot_id.name"/></t>
</td>
</tr>
</tbody>
</table>
</div> </div>
</div> </div>
<table class="table table-sm" style="border-bottom: 0px solid white !important;">
<t t-set="has_serial_number" t-value="o.quant_ids.mapped('lot_id')" />
<thead>
<tr>
<th>Product</th>
<th class="text-right">Quantity</th>
<th groups="uom.group_uom"/>
<th class="text-right" t-if="has_serial_number">Lot/Serial Number</th>
</tr>
</thead>
<tbody>
<tr t-foreach="o.quant_ids" t-as="l">
<td>
<span t-field="l.product_id.name"/>
</td>
<td class="text-right">
<span t-field="l.quantity"/>
</td>
<td groups="uom.group_uom">
<span t-field="l.product_id.uom_id.name"/>
</td>
<td class="text-right" t-if="has_serial_number">
<t t-if="l.lot_id"><span t-field="l.lot_id.name"/></t>
</td>
</tr>
</tbody>
</table>
</div> </div>
</t> </t>
</t> </t>
@@ -66,9 +64,6 @@
<t> <t>
<div class="page"> <div class="page">
<div class="oe_structure"/> <div class="oe_structure"/>
<div class="row o_package_name text-center">
<div class="col-xs-12" style="font-size:24px; font-weight:bold;">Package Reference: <span t-field="o.name"/></div>
</div>
<div class="row"> <div class="row">
<div class="col-12 text-center"> <div class="col-12 text-center">
<img t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s' % ('Code128', o.name, 600, 100)" style="width:600px;height:100px" alt="Barcode"/> <img t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s' % ('Code128', o.name, 600, 100)" style="width:600px;height:100px" alt="Barcode"/>
@@ -76,7 +71,7 @@
</div> </div>
</div> </div>
<div class="row o_packaging_type" t-if="o.packaging_id"> <div class="row o_packaging_type" t-if="o.packaging_id">
<div class="col-12" style="font-size:24px; font-weight:bold;">Package Type: <span t-field="o.packaging_id.name"/></div> <div class="col-12 text-center" style="font-size:24px; font-weight:bold;">Package Type: <span t-field="o.packaging_id.name"/></div>
</div> </div>
</div> </div>
</t> </t>