[IMP] repair: adapt to report layout

task-3447407

Part-of: odoo/odoo#135739
Co-authored-by: Prakash Prajapati <ppr@odoo.com>, Dheeraj Pandey <padh@odoo.com>
This commit is contained in:
Aditya Dubey
2023-10-27 14:21:55 +00:00
committed by Prakash Prajapati
co-authored by Prakash Prajapati <ppr@odoo.com>, Dheeraj Pandey <padh@odoo.com>
parent e95ea1ab3d
commit a50ffd4fa6
@@ -6,36 +6,39 @@
<t t-call="web.external_layout"> <t t-call="web.external_layout">
<t t-set="o" t-value="o.with_context(lang=o.partner_id.lang)" /> <t t-set="o" t-value="o.with_context(lang=o.partner_id.lang)" />
<div class="page"> <div class="page">
<div class="oe_structure"/>
<h2> <h2>
<span>Repair Order #:</span> <span>Repair Order #:</span>
<span t-field="o.name"/> <span t-field="o.name">RO123456</span>
</h2> </h2>
<div class="oe_structure"/>
<div id="informations" class="row mb-3"> <div id="informations" class="row mb-3">
<div class="col-6"> <div class="col-6">
<p t-if="o.partner_id" class="m-0"> <p t-if="o.partner_id" class="m-0">
<strong>Customer:</strong> <strong>Customer:</strong>
<span t-field="o.partner_id"/> <span t-field="o.partner_id">John Doe</span>
</p> </p>
<p t-if="o.product_id" class="m-0"> <p t-if="o.product_id" class="m-0">
<strong>Product:</strong> <strong>Product:</strong>
<span t-field="o.product_id"/> <span t-field="o.product_id">Laptop</span>
</p> </p>
<p t-if="o.lot_id" class="m-0" groups="stock.group_production_lot"> <p t-if="o.lot_id" class="m-0" groups="stock.group_production_lot">
<strong>Lot/Serial:</strong> <strong>Lot/Serial:</strong>
<span t-field="o.lot_id"/> <span t-field="o.lot_id">L12345</span>
</p> </p>
</div> </div>
<div class="col-6"> <div class="col-6">
<p class="m-0"> <p class="m-0">
<strong>Status:</strong> <strong>Status:</strong>
<span t-field="o.state"/> <span t-field="o.state">Pending</span>
</p> </p>
<p t-if="o.user_id" class="m-0"> <p t-if="o.user_id" class="m-0">
<strong>Responsible:</strong> <strong>Responsible:</strong>
<span t-field="o.user_id"/> <span t-field="o.user_id">Jane Smith</span>
</p> </p>
</div> </div>
</div> </div>
<div class="oe_structure"/>
<h2 class="mb-3 border-bottom border-2 border-dark">Parts</h2> <h2 class="mb-3 border-bottom border-2 border-dark">Parts</h2>
<table class="table table-sm o_main_table"> <table class="table table-sm o_main_table">
<thead> <thead>
@@ -45,24 +48,23 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<t t-if="o.move_ids"> <tr t-foreach="o.move_ids" t-as="line">
<tr t-foreach="o.move_ids" t-as="line"> <td>
<td> <p t-if="line.repair_line_type == 'add'"><i>(Add)</i> <span t-field="line.product_id">Product A</span></p>
<p t-if="line.repair_line_type == 'add'"><i>(Add)</i> <span t-field="line.product_id" /></p> <p t-if="line.repair_line_type == 'remove'">(<i>Remove</i>) <span t-field="line.product_id">Product B</span></p>
<p t-if="line.repair_line_type == 'remove'">(<i>Remove</i>) <span t-field="line.product_id"/></p> </td>
</td> <td class="text-end">
<td class="text-end"> <span t-field="line.product_uom_qty">5</span>
<span t-field="line.product_uom_qty"/> <span groups="uom.group_uom" t-field="line.product_uom.name">Units</span>
<span groups="uom.group_uom" t-field="line.product_uom.name"/> </td>
</td> </tr>
</tr>
</t>
</tbody> </tbody>
</table> </table>
<div class="oe_structure"/>
<div t-if="o.internal_notes"> <div t-if="o.internal_notes">
<h2 class="mb-3 border-bottom border-2 border-dark">Repair Notes</h2> <h2 class="mb-3 border-bottom border-2 border-dark">Repair Notes</h2>
<p t-field="o.internal_notes"/> <span t-field="o.internal_notes">This is a repair note.</span>
</div> </div>
<div class="oe_structure"/> <div class="oe_structure"/>
</div> </div>