summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Henrotin <whe@odoo.com>2018-08-01 15:15:04 +0200
committerSimon Lejeune <sle@openerp.com>2018-08-09 14:33:03 +0200
commit3cebe88d8d9a1806cf0a2d949d36bd480d73312a (patch)
tree33a24bfa7b0f4254c69f4de526f54b5e0d6464fe
parent77d8d45d7fe90f3488e78775bdf480e4a51daf31 (diff)
[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
-rw-r--r--addons/product/report/product_product_templates.xml123
-rw-r--r--addons/product/report/product_reports.xml36
-rw-r--r--addons/product/report/product_template_templates.xml15
-rw-r--r--addons/stock/report/report_lot_barcode.xml38
-rw-r--r--addons/stock/report/report_package_barcode.xml23
-rw-r--r--addons/stock/report/stock_report_views.xml22
6 files changed, 159 insertions, 98 deletions
diff --git a/addons/product/report/product_product_templates.xml b/addons/product/report/product_product_templates.xml
index 49c4062d63b..bf8d0acfc10 100644
--- a/addons/product/report/product_product_templates.xml
+++ b/addons/product/report/product_product_templates.xml
@@ -1,48 +1,75 @@
-<?xml version="1.0" encoding="utf-8"?>
-<odoo>
-<data>
-<template id="report_simple_label">
- <div class="col-4" style="padding:0;">
- <table style="border-spacing:0;margin-bottom:0;height:122px;" class="table">
- <thead>
- <tr style="width: 3in;">
- <td style="border: 2px solid black;width: 2.63in;" colspan="2" class="col-8 danger">
- <t t-if="product.default_code">
- [<strong t-field="product.default_code"/>]
- </t>
- <strong t-field="product.name"/>
- </td>
- </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}"/>
- </h4>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
-</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>
-</template>
-</data>
-</odoo>
+<?xml version="1.0" encoding="UTF-8"?>
+<odoo>
+ <data>
+ <template id="report_simple_label">
+ <div class="col-4" style="padding:0;">
+ <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>
+ <tr>
+ <td>
+ <strong>Price:</strong>
+ <strong t-field="product.list_price" t-options="{'widget': 'monetary', 'display_currency': product.company_id.currency_id}"/>
+ </td>
+ </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_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>
+ </template>
+ <template id="report_simple_barcode">
+ <div class="col-4" style="padding:0;">
+ <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>
diff --git a/addons/product/report/product_reports.xml b/addons/product/report/product_reports.xml
index cf75e9513ee..2bfb5db3e71 100644
--- a/addons/product/report/product_reports.xml
+++ b/addons/product/report/product_reports.xml
@@ -3,7 +3,7 @@
<data>
<report
id="report_product_label"
- string="Products Labels"
+ string="Product Label (PDF)"
model="product.product"
report_type="qweb-pdf"
name="product.report_productlabel"
@@ -13,7 +13,7 @@
<report
id="report_product_template_label"
- string="Products Labels"
+ string="Product Label (PDF)"
model="product.template"
report_type="qweb-pdf"
name="product.report_producttemplatelabel"
@@ -21,12 +21,32 @@
print_report_name="'Products Labels - %s' % (object.name)"
/>
- <report
- id="action_report_pricelist"
- string="Pricelist"
- model="product.product"
- report_type="qweb-pdf"
- name="product.report_pricelist"
+ <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
+ id="action_report_pricelist"
+ string="Pricelist"
+ model="product.product"
+ report_type="qweb-pdf"
+ name="product.report_pricelist"
file="product.report_pricelist"
menu="False"/>
</data>
diff --git a/addons/product/report/product_template_templates.xml b/addons/product/report/product_template_templates.xml
index d196f3cab00..11178472904 100644
--- a/addons/product/report/product_template_templates.xml
+++ b/addons/product/report/product_template_templates.xml
@@ -13,4 +13,17 @@
</div>
</t>
</template>
-</odoo> \ No newline at end of file
+<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>
diff --git a/addons/stock/report/report_lot_barcode.xml b/addons/stock/report/report_lot_barcode.xml
index 04ee533942e..6a6b8cefb7a 100644
--- a/addons/stock/report/report_lot_barcode.xml
+++ b/addons/stock/report/report_lot_barcode.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
-<template id="report_lot_barcode">
+<template id="report_lot_label">
<t t-call="web.basic_layout">
<t t-foreach="docs" t-as="o">
<t>
@@ -9,33 +9,25 @@
<div class="oe_structure"/>
<div class="row">
<div class="col-8">
- <table class="table table-sm" style="border-bottom: 0px solid white !important;">
- <thead>
- <tr>
- <th>Product</th>
- <th>Lot/Serial Number</th>
- </tr>
- </thead>
- <tbody>
- <td>
- <span t-field="o.product_id.name"/>
- </td>
+ <table class="table table-condensed" style="border-bottom: 0px solid white !important;width: 3in;">
+ <tr>
+ <th style="text-align: left;">
+ <span t-field="o.product_id.display_name"/>
+ </th>
+ </tr>
+ <tr>
<td>
+ LN/SN:
<span t-field="o.name"/>
</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>
</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>
</t>
diff --git a/addons/stock/report/report_package_barcode.xml b/addons/stock/report/report_package_barcode.xml
index 25d3bfb5cc7..1beca960d71 100644
--- a/addons/stock/report/report_package_barcode.xml
+++ b/addons/stock/report/report_package_barcode.xml
@@ -7,9 +7,18 @@
<t>
<div class="page">
<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"
- style="width:300px;height:50px" class="float-right mb16"/>
- <h1 t-field="o.name" class="mt0 float-left"/>
+ <table class="table table-condensed" style="border-bottom: 0px solid white !important;">
+ <tr>
+ <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="col-12" style="font-weight:bold;">Package Type: <span t-field="o.packaging_id.name"/></div>
</div>
@@ -25,7 +34,7 @@
<tr>
<th>Product</th>
<th class="text-right">Quantity</th>
- <th>Lot/Serial Number</th>
+ <th class="text-right">Lot/Serial Number</th>
</tr>
</thead>
<tbody>
@@ -57,15 +66,15 @@
<t>
<div class="page">
<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="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"/>
<p t-field="o.name" style="font-size:20px;"></p>
</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="col-12" style="font-size:24px; font-weight:bold;">Package Type: <span t-field="o.packaging_id.name"/></div>
</div>
diff --git a/addons/stock/report/stock_report_views.xml b/addons/stock/report/stock_report_views.xml
index 57bacfb09be..987d34c3db8 100644
--- a/addons/stock/report/stock_report_views.xml
+++ b/addons/stock/report/stock_report_views.xml
@@ -20,23 +20,23 @@
print_report_name="'Delivery Slip - %s - %s' % (object.partner_id.name or '', object.name)"
/>
<report
- string="Inventory"
- id="action_report_inventory"
- model="stock.inventory"
+ string="Inventory"
+ id="action_report_inventory"
+ model="stock.inventory"
report_type="qweb-pdf"
- name="stock.report_inventory"
+ name="stock.report_inventory"
file="stock.report_inventory"
print_report_name="'Inventory - %s' % (object.name)"
/>
<report
- string="Package Barcode with Contents"
+ string="Package Barcode with Content"
id="action_report_quant_package_barcode"
model="stock.quant.package"
report_type="qweb-pdf"
name="stock.report_package_barcode"
file="stock.report_package_barcode"/>
<report
- string="Package Barcode"
+ string="Package Barcode (PDF)"
id="action_report_quant_package_barcode_small"
model="stock.quant.package"
report_type="qweb-pdf"
@@ -47,17 +47,17 @@
id="action_report_location_barcode"
model="stock.location"
report_type="qweb-pdf"
- name="stock.report_location_barcode"
+ name="stock.report_location_barcode"
file="stock.report_location_barcode"
print_report_name="'Location - %s' % object.name"
/>
<report
- string="Lot Barcode"
- id="action_report_lot_barcode"
+ string="Lot/Serial Number (PDF)"
+ id="action_report_lot_label"
model="stock.production.lot"
report_type="qweb-pdf"
- name="stock.report_lot_barcode"
- file="stock.report_lot_barcode"
+ name="stock.report_lot_label"
+ file="stock.report_lot_label"
print_report_name="'Lot-Serial - %s' % object.name"
/>
</data>