[IMP] stock: report consitency

Some pdf reports are renamed to be identified as pdf reports (to
be distinguished with zpl ones). The old layout become similar with
the label one.

Task ID:1837175
This commit is contained in:
William Henrotin
2018-08-09 14:33:03 +02:00
committed by Simon Lejeune
parent 77d8d45d7f
commit 3cebe88d8d
6 changed files with 159 additions and 98 deletions
@@ -1,48 +1,75 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="UTF-8"?>
<odoo> <odoo>
<data> <data>
<template id="report_simple_label"> <template id="report_simple_label">
<div class="col-4" style="padding:0;"> <div class="col-4" style="padding:0;">
<table style="border-spacing:0;margin-bottom:0;height:122px;" class="table"> <table class="table table-condensed" style="border-bottom: 0px solid white !important;width: 3in;">
<thead> <tr>
<tr style="width: 3in;"> <th style="text-align: left;">
<td style="border: 2px solid black;width: 2.63in;" colspan="2" class="col-8 danger"> <strong t-field="product.display_name"/>
<t t-if="product.default_code"> </th>
[<strong t-field="product.default_code"/>] </tr>
</t> <tr>
<strong t-field="product.name"/> <td>
</td> <strong>Price:</strong>
</tr>
</thead>
<tbody>
<tr style="width: 1in;">
<td style="border: 2px solid black;text-align: center; vertical-align: middle;" class="col-5">
<img alt="Barcode" t-if="product.barcode and len(product.barcode) == 13" t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s' % ('EAN13', product.barcode, 600, 150)" style="width:100%;height:20%;"/>
<img alt="Barcode" t-elif="product.barcode and len(product.barcode) == 8" t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s' % ('EAN8', product.barcode, 600, 150)" style="width:100%;height:20%;"/>
<img alt="Barcode" t-else="" t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s' % ('Code128', product.barcode, 600, 150)" style="width:100%;height:20%;"/>
<span t-field="product.barcode"/>
</td>
<td style="border: 2px solid black; text-align: center;" class="col-7">
<h4>
<strong t-field="product.list_price" t-options="{'widget': 'monetary', 'display_currency': product.company_id.currency_id}"/> <strong t-field="product.list_price" t-options="{'widget': 'monetary', 'display_currency': product.company_id.currency_id}"/>
</h4> </td>
</td> </tr>
</tr> <t t-if="product.barcode">
</tbody> <tr>
</table> <td style="text-align: center; vertical-align: middle;" class="col-5">
</div> <img alt="Barcode" t-if="len(product.barcode) == 13" t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s' % ('EAN13', product.barcode, 600, 150)" style="width:100%;height:20%;"/>
</template> <img alt="Barcode" t-elif="len(product.barcode) == 8" t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s' % ('EAN8', product.barcode, 600, 150)" style="width:100%;height:20%;"/>
<img alt="Barcode" t-else="" t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s' % ('Code128', product.barcode, 600, 150)" style="width:100%;height:20%;"/>
<template id="report_productlabel"> <span t-field="product.barcode"/>
<t t-call="web.basic_layout"> </td>
<div class="page"> </tr>
<t t-foreach="docs" t-as="product"> </t>
<t t-call="product.report_simple_label"> </table>
<t t-set="product" t-value="product"/> </div>
</t> </template>
<template id="report_productlabel">
<t t-call="web.basic_layout">
<div class="page">
<t t-foreach="docs" t-as="product">
<t t-call="product.report_simple_label">
<t t-set="product" t-value="product"/>
</t>
</t>
</div>
</t> </t>
</div> </template>
</t> <template id="report_simple_barcode">
</template> <div class="col-4" style="padding:0;">
</data> <table class="table table-condensed" style="border-bottom: 0px solid white !important;width: 3in;">
<tr>
<th style="text-align: left;">
<strong t-field="product.display_name"/>
</th>
</tr>
<t t-if="product.barcode">
<tr>
<td style="text-align: center; vertical-align: middle;" class="col-5">
<img alt="Barcode" t-if="len(product.barcode) == 13" t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s' % ('EAN13', product.barcode, 600, 150)" style="width:100%;height:20%;"/>
<img alt="Barcode" t-elif="len(product.barcode) == 8" t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s' % ('EAN8', product.barcode, 600, 150)" style="width:100%;height:20%;"/>
<img alt="Barcode" t-else="" t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s' % ('Code128', product.barcode, 600, 150)" style="width:100%;height:20%;"/>
<span t-field="product.barcode"/>
</td>
</tr>
</t>
</table>
</div>
</template>
<template id="report_productbarcode">
<t t-call="web.basic_layout">
<div class="page">
<t t-foreach="docs" t-as="product">
<t t-call="product.report_simple_barcode">
<t t-set="product" t-value="product"/>
</t>
</t>
</div>
</t>
</template>
</data>
</odoo> </odoo>
+22 -2
View File
@@ -3,7 +3,7 @@
<data> <data>
<report <report
id="report_product_label" id="report_product_label"
string="Products Labels" string="Product Label (PDF)"
model="product.product" model="product.product"
report_type="qweb-pdf" report_type="qweb-pdf"
name="product.report_productlabel" name="product.report_productlabel"
@@ -13,7 +13,7 @@
<report <report
id="report_product_template_label" id="report_product_template_label"
string="Products Labels" string="Product Label (PDF)"
model="product.template" model="product.template"
report_type="qweb-pdf" report_type="qweb-pdf"
name="product.report_producttemplatelabel" name="product.report_producttemplatelabel"
@@ -21,6 +21,26 @@
print_report_name="'Products Labels - %s' % (object.name)" print_report_name="'Products Labels - %s' % (object.name)"
/> />
<report
id="report_product_product_barcode"
string="Product Barcode (PDF)"
model="product.product"
report_type="qweb-pdf"
name="product.report_productbarcode"
file="product.report_productbarcode"
print_report_name="'Products barcode - %s' % (object.name)"
/>
<report
id="report_product_template_barcode"
string="Product Barcode (PDF)"
model="product.template"
report_type="qweb-pdf"
name="product.report_producttemplatebarcode"
file="product.report_producttemplatebarcode"
print_report_name="'Products barcode - %s' % (object.name)"
/>
<report <report
id="action_report_pricelist" id="action_report_pricelist"
string="Pricelist" string="Pricelist"
@@ -13,4 +13,17 @@
</div> </div>
</t> </t>
</template> </template>
<template id="report_producttemplatebarcode">
<t t-call="web.basic_layout">
<div class="page">
<t t-foreach="docs" t-as="template">
<t t-foreach="template.product_variant_ids" t-as="product">
<t t-call="product.report_simple_barcode">
<t t-set="product" t-value="product"/>
</t>
</t>
</t>
</div>
</t>
</template>
</odoo> </odoo>
+15 -23
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<odoo> <odoo>
<data> <data>
<template id="report_lot_barcode"> <template id="report_lot_label">
<t t-call="web.basic_layout"> <t t-call="web.basic_layout">
<t t-foreach="docs" t-as="o"> <t t-foreach="docs" t-as="o">
<t> <t>
@@ -9,33 +9,25 @@
<div class="oe_structure"/> <div class="oe_structure"/>
<div class="row"> <div class="row">
<div class="col-8"> <div class="col-8">
<table class="table table-sm" style="border-bottom: 0px solid white !important;"> <table class="table table-condensed" style="border-bottom: 0px solid white !important;width: 3in;">
<thead> <tr>
<tr> <th style="text-align: left;">
<th>Product</th> <span t-field="o.product_id.display_name"/>
<th>Lot/Serial Number</th> </th>
</tr> </tr>
</thead> <tr>
<tbody>
<td>
<span t-field="o.product_id.name"/>
</td>
<td> <td>
LN/SN:
<span t-field="o.name"/> <span t-field="o.name"/>
</td> </td>
</tbody> </tr>
<tr>
<td style="text-align: center; vertical-align: middle;" class="col-5">
<img t-if="o.name" t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s' % ('EAN13', o.name, 600, 150)" style="width:100%;height:20%;"/>
</td>
</tr>
</table> </table>
</div> </div>
<div class="col-4">
<img class="image" t-att-src="'data:image/png;base64,%s' % to_text(res_company.logo)" style="border:auto;" alt="Logo"/>
</div>
</div>
<div class="row">
<div class="col-12 mt32">
<table class="table table-sm" style="border-bottom: 3px solid black !important;"><thead><th> </th></thead></table>
<img t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s' % ('Code128', o.name, 600, 100)" style="width:300px;height:50px" alt="Barcode"/>
<p class="text-center" t-field="o.name"></p>
</div>
</div> </div>
</div> </div>
</t> </t>
+16 -7
View File
@@ -7,9 +7,18 @@
<t> <t>
<div class="page"> <div class="page">
<div class="oe_structure"/> <div class="oe_structure"/>
<img t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s' % ('Code128', o.name, 600, 100)" alt="Barcode" <table class="table table-condensed" style="border-bottom: 0px solid white !important;">
style="width:300px;height:50px" class="float-right mb16"/> <tr>
<h1 t-field="o.name" class="mt0 float-left"/> <th>
<h1 t-field="o.name" class="mt0 float-left"/>
</th>
<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"
style="width:300px;height:50px"/>
<p t-field="o.name"/>
</th>
</tr>
</table>
<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-weight:bold;">Package Type: <span t-field="o.packaging_id.name"/></div> <div class="col-12" style="font-weight:bold;">Package Type: <span t-field="o.packaging_id.name"/></div>
</div> </div>
@@ -25,7 +34,7 @@
<tr> <tr>
<th>Product</th> <th>Product</th>
<th class="text-right">Quantity</th> <th class="text-right">Quantity</th>
<th>Lot/Serial Number</th> <th class="text-right">Lot/Serial Number</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@@ -57,15 +66,15 @@
<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"/>
<p t-field="o.name" style="font-size:20px;"></p> <p t-field="o.name" style="font-size:20px;"></p>
</div> </div>
</div> </div>
<div class="row o_package_name">
<div class="col-12" style="font-size:24px; font-weight:bold;">Package Reference: <span t-field="o.name"/></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" style="font-size:24px; font-weight:bold;">Package Type: <span t-field="o.packaging_id.name"/></div>
</div> </div>
+6 -6
View File
@@ -29,14 +29,14 @@
print_report_name="'Inventory - %s' % (object.name)" print_report_name="'Inventory - %s' % (object.name)"
/> />
<report <report
string="Package Barcode with Contents" string="Package Barcode with Content"
id="action_report_quant_package_barcode" id="action_report_quant_package_barcode"
model="stock.quant.package" model="stock.quant.package"
report_type="qweb-pdf" report_type="qweb-pdf"
name="stock.report_package_barcode" name="stock.report_package_barcode"
file="stock.report_package_barcode"/> file="stock.report_package_barcode"/>
<report <report
string="Package Barcode" string="Package Barcode (PDF)"
id="action_report_quant_package_barcode_small" id="action_report_quant_package_barcode_small"
model="stock.quant.package" model="stock.quant.package"
report_type="qweb-pdf" report_type="qweb-pdf"
@@ -52,12 +52,12 @@
print_report_name="'Location - %s' % object.name" print_report_name="'Location - %s' % object.name"
/> />
<report <report
string="Lot Barcode" string="Lot/Serial Number (PDF)"
id="action_report_lot_barcode" id="action_report_lot_label"
model="stock.production.lot" model="stock.production.lot"
report_type="qweb-pdf" report_type="qweb-pdf"
name="stock.report_lot_barcode" name="stock.report_lot_label"
file="stock.report_lot_barcode" file="stock.report_lot_label"
print_report_name="'Lot-Serial - %s' % object.name" print_report_name="'Lot-Serial - %s' % object.name"
/> />
</data> </data>