[IMP] product: 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 809abdf7a1
commit 63c1ccab81
2 changed files with 23 additions and 17 deletions
+9 -5
View File
@@ -4,25 +4,27 @@
<template id="report_packagingbarcode">
<t t-call="web.basic_layout">
<div class="page">
<div class="oe_structure"></div>
<t t-foreach="docs" t-as="packaging">
<div class="col-4" style="padding:0;">
<div class="oe_structure"></div>
<table class="table table-condensed" style="border-bottom: 0px solid white !important;width: 3in;">
<tr>
<th style="text-align: left;">
<strong t-field="packaging.name"/>
<strong><span t-field="packaging.name">Package Type A</span></strong>
</th>
</tr>
<tr>
<td>
<strong t-field="packaging.product_id.display_name"/>
<strong><span t-field="packaging.product_id.display_name">Eco-friendly Wooden Chair</span></strong>
</td>
</tr>
<tr>
<td>
<div class="o_row">
<strong>Qty: </strong>
<strong t-field="packaging.qty"/>
<strong t-field="packaging.product_uom_id" groups="uom.group_uom"/>
<strong><span t-field="packaging.qty">10</span></strong>
<strong><span t-field="packaging.product_uom_id" groups="uom.group_uom">Units</span></strong>
</div>
</td>
</tr>
@@ -30,13 +32,15 @@
<tr>
<td style="text-align: center; vertical-align: middle;" class="col-5">
<div t-field="packaging.barcode" t-options="{'widget': 'barcode', 'symbology': 'auto', 'width': 600, 'height': 150, 'img_style': 'width:100%;height:20%;'}"/>
<span t-field="packaging.barcode"/>
<span t-field="packaging.barcode">123456789012</span>
</td>
</tr>
</t>
</table>
<div class="oe_structure"></div>
</div>
</t>
<div class="oe_structure"></div>
</div>
</t>
</template>
@@ -3,19 +3,21 @@
<template id="report_pricelist_page">
<div class="container bg-white p-4 my-4">
<div class="oe_structure"></div>
<div class="row my-3" t-if="display_pricelist_title">
<div class="col-12">
<h2 t-if="is_html_type">
Pricelist:
<a href="#" class="o_action" data-model="product.pricelist" t-att-data-res-id="pricelist.id">
<t t-out="pricelist.display_name"/>
<span t-field="pricelist.display_name">Gold Member Pricelist</span>
</a>
</h2>
<h2 t-else="">
Pricelist: <t t-out="pricelist.display_name"/>
Pricelist: <span t-field="pricelist.display_name">Gold Member Pricelist</span>
</h2>
</div>
</div>
<div class="oe_structure"></div>
<div class="row">
<div class="col-12">
<table class="table table-sm">
@@ -23,9 +25,9 @@
<th class="text-end" colspan="100%">Quantities (Price)</th>
<tr>
<th>Products</th>
<th groups="uom.group_uom">UoM</th>
<th groups="uom.group_uom">UOM</th>
<t t-foreach="quantities" t-as="qty">
<th class="text-end"><t t-out="qty"/></th>
<th class="text-end"><span t-out="qty">10 Units</span></th>
</t>
</tr>
</thead>
@@ -34,16 +36,14 @@
<tr>
<td t-att-class="is_product_tmpl and 'fw-bold' or None">
<a t-if="is_html_type" href="#" class="o_action" t-att-data-model="is_product_tmpl and 'product.template' or 'product.product'" t-att-data-res-id="product['id']">
<t t-out="product['name']"/>
<span t-out="product['name']">Virtual Interior Design</span>
</a>
<t t-else="">
<t t-out="product['name']"/>
</t>
<span t-else="" t-out="product['name']">Acme Widget</span>
</td>
<td groups="uom.group_uom" t-out="product['uom']"/>
<t t-foreach="quantities" t-as="qty">
<td class="text-end">
<t t-out="product['price'][qty]" t-options='{"widget": "monetary", "display_currency": pricelist.currency_id}'/>
<span t-out="product['price'][qty]" t-options='{"widget": "monetary", "display_currency": pricelist.currency_id}'>$15.00</span>
</td>
</t>
</tr>
@@ -51,14 +51,14 @@
<tr t-foreach="product['variants']" t-as="variant">
<td>
<a t-if="is_html_type" href="#" class="o_action ms-4" data-model="product.product" t-att-data-res-id="variant['id']">
<t t-out="variant['name']"/>
<span t-out="variant['name']">Acme Widget - Blue</span>
</a>
<span t-else="" class="ms-4" t-out="variant['name']"/>
<span t-else="" class="ms-4" t-out="variant['name']">Acme Widget - Blue</span>
</td>
<td groups="uom.group_uom" t-out="product['uom']"/>
<t t-foreach="quantities" t-as="qty">
<td class="text-end">
<t t-out="variant['price'][qty]" t-options='{"widget": "monetary", "display_currency": pricelist.currency_id}'/>
<span t-out="variant['price'][qty]" t-options='{"widget": "monetary", "display_currency": pricelist.currency_id}'>$14.00</span>
</td>
</t>
</tr>
@@ -68,6 +68,7 @@
</table>
</div>
</div>
<div class="oe_structure"></div>
</div>
</template>
@@ -77,6 +78,7 @@
<t t-call="product.report_pricelist_page"/>
</div>
<p style="page-break-before:always;"> </p>
<div class="oe_structure"></div>
</t>
</template>