[IMP] mrp: production report improvements
- Remove 'Production Order #' - Don't diplay source field if empty - Change subtittle - If MO not done, only shown reserved products - If MO done, show what has been really consumed - Show product barcode - Show reserved product location - Show reserved product tracking data TASK-38741
This commit is contained in:
committed by
Pierre Masereel
parent
e0ed50a724
commit
f00c451f38
@@ -8,29 +8,34 @@
|
||||
<div class="oe_structure"/>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<h2>Production Order # : <span t-field="o.name"/></h2>
|
||||
<h2><span t-field="o.name"/></h2>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt32 mb32">
|
||||
<div class="col-xs-3">
|
||||
<div class="col-xs-3" t-if="o.origin">
|
||||
<strong>Source Document:</strong><br/>
|
||||
<span t-field="o.origin"/>
|
||||
</div>
|
||||
<div class="col-xs-3">
|
||||
<strong>Product:</strong><br/>
|
||||
<span t-field="o.product_id"/>
|
||||
<strong>Responsible:</strong><br/>
|
||||
<span t-field="o.user_id"/>
|
||||
</div>
|
||||
<div class="col-xs-3">
|
||||
<strong>Quantity:</strong><br/>
|
||||
<span t-field="o.product_qty"/>
|
||||
<span t-field="o.product_uom_id.name" groups="uom.group_uom"/>
|
||||
<strong>Scheduled Date:</strong><br/>
|
||||
<span t-field="o.date_planned_start"/>
|
||||
<span t-if="o.date_planned_finished"> - <span t-field="o.date_planned_finished"/></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt32 mb32">
|
||||
<div class="col-xs-3">
|
||||
<strong>Scheduled Date:</strong><br/>
|
||||
<span t-field="o.date_planned_start"/><span t-if="o.date_planned_finished"> - <span t-field="o.date_planned_finished"/></span>
|
||||
<strong>Finished Product:</strong><br/>
|
||||
<span t-field="o.product_id"/>
|
||||
</div>
|
||||
<div class="col-xs-3">
|
||||
<strong>Quantity to Produce:</strong><br/>
|
||||
<span t-field="o.product_qty"/>
|
||||
<span t-field="o.product_uom_id.name" groups="product.group_uom"/>
|
||||
</div>
|
||||
<div class="col-xs-3">
|
||||
<strong>Printing date:</strong><br/>
|
||||
@@ -40,47 +45,96 @@
|
||||
</div>
|
||||
|
||||
<div t-if="o.workorder_ids">
|
||||
<strong>Work Orders</strong>
|
||||
<h3>
|
||||
<t t-if="o.state == 'done'">Operations Done</t>
|
||||
<t t-else="">Operations Planned</t>
|
||||
</h3>
|
||||
<table class="table table-condensed">
|
||||
<tr>
|
||||
<td class="text-center"><strong>Name</strong></td>
|
||||
<td class="text-center"><strong>WorkCenter</strong></td>
|
||||
<td class="text-center"><strong>No. Of Minutes</strong></td>
|
||||
<th><strong>Operation</strong></th>
|
||||
<th><strong>WorkCenter</strong></th>
|
||||
<th><strong>No. Of Minutes</strong></th>
|
||||
</tr>
|
||||
<tr t-foreach="o.workorder_ids" t-as="line2">
|
||||
<td class="text-center"><span t-field="line2.name"/></td>
|
||||
<td class="text-center"><span t-field="line2.workcenter_id.name"/></td>
|
||||
<td class="text-center"><span t-field="line2.duration_expected"/></td>
|
||||
<td><span t-field="line2.name"/></td>
|
||||
<td><span t-field="line2.workcenter_id.name"/></td>
|
||||
<td>
|
||||
<span t-if="o.state != 'done'" t-field="line2.duration_expected"/>
|
||||
<span t-if="o.state == 'done'" t-field="line2.duration"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<h3 t-if="o.move_raw_ids">Bill Of Material</h3>
|
||||
<h3 t-if="o.move_raw_ids">
|
||||
<t t-if="o.state == 'done'">
|
||||
Consumed Products
|
||||
</t>
|
||||
<t t-else="">
|
||||
Products to Consume
|
||||
</t>
|
||||
</h3>
|
||||
|
||||
<table class="table table-condensed" t-if="o.move_raw_ids">
|
||||
<t t-set="has_location" t-value="any(o.move_raw_ids.filtered(lambda x: x.move_line_ids.filtered(lambda x: x.location_id.id)))" groups="stock.group_stock_multi_locations"/>
|
||||
<t t-set="has_serial_number" t-value="any(o.move_raw_ids.filtered(lambda x: x.move_line_ids.filtered(lambda x: x.lot_id or x.lot_name)))" groups="stock.group_production_lot"/>
|
||||
<t t-set="has_product_barcode" t-value="any(o.move_raw_ids.filtered(lambda x: x.product_id.barcode))"/>
|
||||
<t t-set="has_product_available" t-value="any(o.move_raw_ids.filtered(lambda x: x.move_line_ids.filtered(lambda x: x.product_qty)))"/>
|
||||
<t t-if="o.state=='done'">
|
||||
<t t-set="has_product_available" t-value="any(o.move_raw_ids.filtered(lambda x: x.move_line_ids.filtered(lambda x: x.qty_done)))"/>
|
||||
</t>
|
||||
<thead>
|
||||
<tr>
|
||||
<th><strong>Product</strong></th>
|
||||
<th class="text-right"><strong>Quantity</strong></th>
|
||||
<tr t-if="has_product_available">
|
||||
<th>Product</th>
|
||||
<th>Quantity</th>
|
||||
<th><span t-if="has_location">From</span></th>
|
||||
<th t-if="has_serial_number" width="15%">Lot/Serial barcode</th>
|
||||
<th t-if="has_product_barcode" width="15%" class="text-center">Barcode</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<t t-if="o.move_raw_ids">
|
||||
<tr>
|
||||
<td colspan="4"><strong>Products to Consume</strong></td>
|
||||
</tr>
|
||||
<tr t-foreach="o.move_raw_ids" t-as="line">
|
||||
<td>
|
||||
<span t-field="line.product_id"/>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<span t-field="line.product_uom_qty"/>
|
||||
<span t-field="line.product_uom.name" groups="uom.group_uom"/>
|
||||
</td>
|
||||
</tr>
|
||||
<t t-if="has_product_available and o.move_raw_ids" >
|
||||
<t t-set="lines" t-value="o.move_raw_ids"/>
|
||||
<t t-foreach="lines" t-as="line">
|
||||
<t t-set="move_lines" t-value="line.move_line_ids.filtered(lambda x: x.state != 'done' and x.product_qty)"/>
|
||||
<t t-if="o.state == 'done'">
|
||||
<t t-set="move_lines" t-value="line.move_line_ids.filtered(lambda x: x.state == 'done' and x.qty_done)"/>
|
||||
</t>
|
||||
<t t-foreach="move_lines" t-as="ml">
|
||||
<tr>
|
||||
<td>
|
||||
<span t-field="line.product_id"/>
|
||||
</td>
|
||||
<td>
|
||||
<span t-esc="ml.product_uom_qty" t-if="ml.state !='done'"/>
|
||||
<span t-esc="ml.qty_done" t-if="ml.state =='done'"/>
|
||||
<span t-field="ml.product_uom_id" groups="uom.group_uom"/>
|
||||
</td>
|
||||
<td>
|
||||
<span t-if="has_location">
|
||||
<span t-field="ml.location_id"/>
|
||||
</span>
|
||||
</td>
|
||||
<td t-if="has_serial_number" width="15%">
|
||||
<t t-if="has_serial_number and (ml.lot_id or ml.lot_name)">
|
||||
<img t-att-src="'/report/barcode/?type=%s&value=%s&width=%s&height=%s' % ('Code128', ml.lot_id.name, 600, 100)" style="width:100%;height:35px"/>
|
||||
</t>
|
||||
</td>
|
||||
<td t-if="has_product_barcode" width="15%" class="text-center">
|
||||
<t t-if="line.product_id.barcode">
|
||||
<img t-att-src="'/report/barcode/?type=%s&value=%s&width=%s&height=%s' % ('Code128', line.product_id.barcode, 600, 100)" style="width:100%;height:35px"/>
|
||||
</t>
|
||||
</td>
|
||||
</tr>
|
||||
</t>
|
||||
</t>
|
||||
</t>
|
||||
</tbody>
|
||||
</table>
|
||||
<t t-set="has_product_reserved" t-value="o.move_raw_ids.filtered(lambda x: x.product_uom_qty != x.reserved_availability)"/>
|
||||
<p t-if="o.state !='done' and (not has_product_available or has_product_reserved)" class="fa fa-exclamation-triangle">
|
||||
All components could not be reserved. Click on the "Check Availability button" to try to reserve components.
|
||||
</p>
|
||||
<div class="oe_structure"/>
|
||||
</div>
|
||||
</t>
|
||||
|
||||
Reference in New Issue
Block a user