mirror of
https://github.com/bringout/oca-ocb-mrp.git
synced 2026-04-26 16:12:07 +02:00
19.0 vanilla
This commit is contained in:
parent
accf5918df
commit
6e65e8c877
688 changed files with 225434 additions and 199401 deletions
|
|
@ -8,47 +8,47 @@
|
|||
<div class="oe_structure"/>
|
||||
<div class="row">
|
||||
<div class="col-7">
|
||||
<h2><span t-field="o.name"/></h2>
|
||||
<h2><span t-field="o.name">MRP-001</span></h2>
|
||||
</div>
|
||||
<div class="col-5">
|
||||
<span class="text-end">
|
||||
<div t-field="o.name" t-options="{'widget': 'barcode', 'width': 600, 'height': 100, 'img_style': 'width:350px;height:60px'}"/>
|
||||
<span t-field="o.name" t-options="{'widget': 'barcode', 'width': 600, 'height': 100, 'img_style': 'width:350px;height:60px'}">Package barcode</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt32 mb32">
|
||||
<div class="col-3" t-if="o.origin">
|
||||
<strong>Source:</strong><br/>
|
||||
<span t-field="o.origin"/>
|
||||
<span t-field="o.origin">Vendor ABC</span>
|
||||
</div>
|
||||
<div class="col-3" t-if="o.user_id">
|
||||
<strong>Responsible:</strong><br/>
|
||||
<span t-field="o.user_id"/>
|
||||
<span t-field="o.user_id">John Doe</span>
|
||||
</div>
|
||||
<div class="col-3" t-if="o.state not in ('done', 'cancel') and o.date_deadline">
|
||||
<strong>Deadline:</strong><br/>
|
||||
<span t-field="o.date_deadline"/>
|
||||
<span t-field="o.date_deadline">2023-09-15</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt32 mb32">
|
||||
<div class="col-3">
|
||||
<strong>Product:</strong><br/>
|
||||
<span t-field="o.product_id"/>
|
||||
<span t-field="o.product_id">Laptop Model X</span>
|
||||
</div>
|
||||
<div class="col-3" t-if="o.product_description_variants">
|
||||
<strong>Description:</strong><br/>
|
||||
<span t-field="o.product_description_variants"/>
|
||||
<span t-field="o.product_description_variants">Laptop with 16GB RAM</span>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<strong>Quantity to Produce:</strong><br/>
|
||||
<span t-field="o.product_qty"/>
|
||||
<span t-field="o.product_uom_id.name" groups="uom.group_uom"/>
|
||||
<span t-field="o.product_qty">100</span>
|
||||
<span t-field="o.product_uom_id.name" groups="uom.group_uom">Units</span>
|
||||
</div>
|
||||
<div class="col-3" t-if="o.qty_producing">
|
||||
<div class="col-3" t-if="o.qty_producing">
|
||||
<strong>Quantity Producing:</strong><br/>
|
||||
<span t-field="o.qty_producing"/>
|
||||
<span t-field="o.product_uom_id.name" groups="uom.group_uom"/>
|
||||
<span t-field="o.qty_producing">50</span>
|
||||
<span t-field="o.product_uom_id.name" groups="uom.group_uom">Units</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -64,23 +64,29 @@
|
|||
<th><strong>WorkCenter</strong></th>
|
||||
<th><strong>Duration (minutes)</strong></th>
|
||||
<th t-if="o.state in ('progress', 'to_close')"><strong>Actual Duration (minutes)</strong></th>
|
||||
<th style="width:30%"><strong>Barcode</strong></th>
|
||||
</tr>
|
||||
<tr t-foreach="o.workorder_ids" t-as="line2">
|
||||
<td><span t-field="line2.name"/></td>
|
||||
<td><span t-field="line2.workcenter_id.name"/></td>
|
||||
<td><span t-field="line2.name">Assembling</span></td>
|
||||
<td><span t-field="line2.workcenter_id.name">Center A</span></td>
|
||||
<td>
|
||||
<span t-if="o.state != 'done'" t-field="line2.duration_expected"/>
|
||||
<span t-if="o.state == 'done'" t-field="line2.duration"/>
|
||||
<span t-if="o.state != 'done'" t-field="line2.duration_expected">60</span>
|
||||
<span t-if="o.state == 'done'" t-field="line2.duration">58</span>
|
||||
</td>
|
||||
<td t-if="o.state in ('progress', 'to_close')">
|
||||
<span t-field="line2.duration"/>
|
||||
<span t-field="line2.duration">58</span>
|
||||
</td>
|
||||
<td>
|
||||
<span t-field="line2.barcode" t-options="{'widget': 'barcode', 'width': 600, 'height': 100, 'img_style': 'width:100%;height:35px'}">987654321098</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<t t-call="mrp.report_mrp_production_components" t-if="o.move_raw_ids"/>
|
||||
<div t-if="o.move_raw_ids">
|
||||
<t t-call="mrp.report_mrp_production_components"/>
|
||||
|
||||
</div>
|
||||
<div class="oe_structure"/>
|
||||
</div>
|
||||
</t>
|
||||
|
|
@ -95,6 +101,7 @@
|
|||
</span>
|
||||
</h3>
|
||||
<table class="table table-sm">
|
||||
<div class="oe_structure"></div>
|
||||
<t t-set="has_product_barcode" t-value="any(m.product_id.barcode for m in o.move_raw_ids)"/>
|
||||
<thead>
|
||||
<tr>
|
||||
|
|
@ -107,20 +114,20 @@
|
|||
<tbody>
|
||||
<tr t-foreach="o.move_raw_ids" t-as="raw_line">
|
||||
<td>
|
||||
<span t-field="raw_line.product_id"/>
|
||||
<span t-field="raw_line.product_id">8 GB RAM</span>
|
||||
</td>
|
||||
<td t-attf-class="{{ 'text-end' if not has_product_barcode else '' }}" t-if="o.state in ('progress', 'to_close','done')">
|
||||
<div>
|
||||
<span t-field="raw_line.quantity_done"/>
|
||||
<span t-field="raw_line.quantity">2</span>
|
||||
</div>
|
||||
</td>
|
||||
<td t-attf-class="{{ 'text-end' if not has_product_barcode else '' }}">
|
||||
<span t-field="raw_line.product_uom_qty"/>
|
||||
<span t-field="raw_line.product_uom" groups="uom.group_uom"/>
|
||||
<span t-field="raw_line.product_uom_qty">25</span>
|
||||
<span t-field="raw_line.product_uom" groups="uom.group_uom">Pieces</span>
|
||||
</td>
|
||||
<td t-if="has_product_barcode" width="15%" class="text-center">
|
||||
<t t-if="raw_line.product_id.barcode">
|
||||
<div t-field="raw_line.product_id.barcode" t-options="{'widget': 'barcode', 'width': 600, 'height': 100, 'img_style': 'width:100%;height:35px'}"/>
|
||||
<span t-field="raw_line.product_id.barcode" t-options="{'widget': 'barcode', 'width': 600, 'height': 100, 'img_style': 'width:100%;height:35px'}">12345678901</span>
|
||||
</t>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
@ -132,13 +139,14 @@
|
|||
<t t-call="web.basic_layout">
|
||||
<t t-set='nRows' t-value='12'/>
|
||||
<t t-set='nCols' t-value='4'/>
|
||||
<t t-set="uom_categ_unit" t-value="env.ref('uom.product_uom_categ_unit')"/>
|
||||
<t t-set="move_lines" t-value="docs.move_finished_ids.move_line_ids.filtered(lambda ml: ml.move_id.production_id.state == 'done' and ml.state == 'done' and ml.qty_done)"/>
|
||||
<t t-set="uom_unit" t-value="env.ref('uom.product_uom_unit')"/>
|
||||
<div class="oe_structure"></div>
|
||||
<t t-set="move_lines" t-value="docs.move_finished_ids.move_line_ids.filtered(lambda ml: ml.move_id.production_id.state == 'done' and ml.state == 'done' and ml.quantity)"/>
|
||||
<t t-set="move_line_qtys" t-value="[]"/>
|
||||
<t t-foreach="move_lines" t-as="move_line">
|
||||
<t t-if="move_line.product_uom_id.category_id == uom_categ_unit">
|
||||
<t t-if="move_line.product_id.uom_id._has_common_reference(uom_unit)">
|
||||
<!-- print 1 label per 1 uom when uom category = units -->
|
||||
<t t-set="move_line_qtys" t-value="move_line_qtys + [int(move_line.qty_done)]"/>
|
||||
<t t-set="move_line_qtys" t-value="move_line_qtys + [int(move_line.quantity)]"/>
|
||||
</t>
|
||||
<t t-else="">
|
||||
<t t-set="move_line_qtys" t-value="move_line_qtys + [1]"/>
|
||||
|
|
@ -146,7 +154,9 @@
|
|||
</t>
|
||||
<t t-set="index_to_qtys" t-value="{i: qty for i, qty in zip(range(0, len(move_line_qtys)), move_line_qtys)}"/>
|
||||
<t t-set="num_pages" t-value="sum(move_line_qtys)// (nRows * nCols) + 1"/>
|
||||
<div class="oe_structure"></div>
|
||||
<div t-foreach="range(num_pages)" t-as="page" class="o_label_sheet" t-att-style="'padding: 20mm 8mm'">
|
||||
<div class="oe_structure"></div>
|
||||
<table class="my-0 table table-sm table-borderless">
|
||||
<t t-foreach="range(nRows)" t-as="row">
|
||||
<tr>
|
||||
|
|
@ -166,20 +176,20 @@
|
|||
<td t-att-style="make_invisible and 'visibility:hidden'">
|
||||
<div t-if="move_line" t-translation="off" t-att-style="'position:relative; width:43mm; height:19mm; border: 1px solid %s;' % (move_line.env.user.company_id.primary_color or 'black')">
|
||||
<div class="o_label_name o_label_4x12 fw-bold">
|
||||
<div t-out="move_line.product_id.display_name"/>
|
||||
<span t-out="move_line.product_id.display_name">Product</span>
|
||||
<div><span>Quantity: </span>
|
||||
<span t-if="move_line.product_uom_id.category_id == uom_categ_unit">1.0</span>
|
||||
<span t-else="" t-out="move_line.qty_done"/>
|
||||
<span t-field="move_line.product_uom_id" groups="uom.group_uom"/>
|
||||
<span t-if="move_line.product_id.uom_id._has_common_reference(uom_unit)">1.0</span>
|
||||
<span t-else="" t-out="move_line.quantity">5</span>
|
||||
<span t-field="move_line.product_uom_id" groups="uom.group_uom">UOM id</span>
|
||||
</div>
|
||||
</div>
|
||||
<t t-if="move_line.product_id.tracking != 'none' and (move_line.lot_name or move_line.lot_id)">
|
||||
<div t-field="move_line.lot_name or move_line.lot_id.name" t-options="{'widget': 'barcode', 'img_style': 'width:100%;height:35%'}"/>
|
||||
<div class="o_label_4x12 text-center" t-out="move_line.lot_name or move_line.lot_id.name"/>
|
||||
<div class="o_label_4x12 text-center"><span t-out="move_line.lot_name or move_line.lot_id.name">Demo Barcode</span></div>
|
||||
</t>
|
||||
<t t-elif="move_line.product_id.tracking == 'none' and move_line.product_id.barcode">
|
||||
<div t-field="move_line.product_id.barcode" t-options="{'widget': 'barcode', 'img_style': 'width:100%;height:35%'}"/>
|
||||
<div class="o_label_4x12 text-center" t-out="move_line.product_id.barcode"/>
|
||||
<div class="o_label_4x12 text-center"><span t-out="move_line.product_id.barcode">12345678901</span></div>
|
||||
</t>
|
||||
<t t-else="">
|
||||
<span class="text-muted">No barcode available</span>
|
||||
|
|
@ -190,6 +200,7 @@
|
|||
</tr>
|
||||
</t>
|
||||
</table>
|
||||
<div class="oe_structure"></div>
|
||||
</div>
|
||||
</t>
|
||||
</template>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue