summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThibault Delavallée <tde@odoo.com>2017-03-31 15:05:35 +0200
committerThibault Delavallée <tde@odoo.com>2017-05-10 17:16:09 +0200
commit00d5a2f0398340e4c055f8290d1058c4fe64b0cb (patch)
treec770331a87d6ab50a9de01636e2e11cbdb7c5abc
parentb380347b0b973307aec3f1af93c34bdb27ebd8d9 (diff)
[IMP] inventory related addons: improve report naming and use print_report_name
Purpose of this commit is to clean and uniformize report naming through various addons. It has been chosen to name them using a formatting like <report_name> - <object_name or suffix> . Improve report naming in product, stock, mrp and mrp repair.
-rw-r--r--addons/mrp/report/mrp_report_views_main.xml12
-rw-r--r--addons/mrp_repair/report/mrp_repair_reports.xml6
-rw-r--r--addons/product/report/product_reports.xml16
-rw-r--r--addons/stock/report/stock_report_views.xml56
4 files changed, 49 insertions, 41 deletions
diff --git a/addons/mrp/report/mrp_report_views_main.xml b/addons/mrp/report/mrp_report_views_main.xml
index 86dfc67ecba..a54a5209a1f 100644
--- a/addons/mrp/report/mrp_report_views_main.xml
+++ b/addons/mrp/report/mrp_report_views_main.xml
@@ -8,10 +8,8 @@
name="mrp.report_mrpbomstructure"
file="mrp.report.mrp_bom_templates"
report_type="qweb-pdf"
+ print_report_name="'BOM - %s' % (object.product_id.name or object.product_tmpl_id.name or '')"
/>
- <record id="action_report_bom_structure" model="ir.actions.report">
- <field name="print_report_name">'BOM'+'-'+(object.product_id.name or object.product_tmpl_id.name)</field>
- </record>
<report
string="Production Order"
@@ -20,10 +18,8 @@
name="mrp.report_mrporder"
file="mrp.report.mrp_production_templates"
report_type="qweb-pdf"
+ print_report_name="'Production Order - %s' % object.name"
/>
- <record id="action_report_production_order" model="ir.actions.report">
- <field name="print_report_name">'Production Order'+'-'+(object.name)</field>
- </record>
<report
string="BOM Cost"
@@ -32,9 +28,7 @@
name="mrp_bom_cost"
file="mrp_bom_cost"
report_type="qweb-html"
+ print_report_name="'BOM Cost - %s' % (object.product_id.name or object.product_tmpl_id.name or '')"
/>
- <record id="action_report_bom_price" model="ir.actions.report">
- <field name="print_report_name">'BOM Cost'+'-'+(object.product_id.name or object.product_tmpl_id.name)</field>
- </record>
</data>
</odoo>
diff --git a/addons/mrp_repair/report/mrp_repair_reports.xml b/addons/mrp_repair/report/mrp_repair_reports.xml
index 3cc755f5b73..ca9c966538c 100644
--- a/addons/mrp_repair/report/mrp_repair_reports.xml
+++ b/addons/mrp_repair/report/mrp_repair_reports.xml
@@ -8,9 +8,9 @@
name="mrp_repair.report_mrprepairorder2"
file="mrp_repair.report_mrprepairorder"
report_type="qweb-pdf"
+ print_report_name="(
+ object.state == 'draft' and 'Repair Quotation - %s' % (object.name) or
+ 'Repair Order - %s' % (object.name))"
/>
- <record id="action_report_mrp_repair_order" model="ir.actions.report">
- <field name="print_report_name">(object.state == 'draft' and 'Repair Quotation'+'-'+(object.name) or 'Repair Order'+'-'+(object.name))</field>
- </record>
</data>
</odoo>
diff --git a/addons/product/report/product_reports.xml b/addons/product/report/product_reports.xml
index 0e48f95aa27..cf75e9513ee 100644
--- a/addons/product/report/product_reports.xml
+++ b/addons/product/report/product_reports.xml
@@ -7,10 +7,9 @@
model="product.product"
report_type="qweb-pdf"
name="product.report_productlabel"
- file="product.report_productlabel"/>
- <record id="report_product_label" model="ir.actions.report">
- <field name="print_report_name">'Products Labels'+'-'+(object.name)</field>
- </record>
+ file="product.report_productlabel"
+ print_report_name="'Products Labels - %s' % (object.name)"
+ />
<report
id="report_product_template_label"
@@ -18,10 +17,9 @@
model="product.template"
report_type="qweb-pdf"
name="product.report_producttemplatelabel"
- file="product.report_producttemplatelabel"/>
- <record id="report_product_template_label" model="ir.actions.report">
- <field name="print_report_name">'Products Labels'+'-'+(object.name)</field>
- </record>
+ file="product.report_producttemplatelabel"
+ print_report_name="'Products Labels - %s' % (object.name)"
+ />
<report
id="action_report_pricelist"
@@ -30,6 +28,6 @@
report_type="qweb-pdf"
name="product.report_pricelist"
file="product.report_pricelist"
- menu="False"/>
+ menu="False"/>
</data>
</odoo>
diff --git a/addons/stock/report/stock_report_views.xml b/addons/stock/report/stock_report_views.xml
index 84988bfdb6a..e1f84bb2620 100644
--- a/addons/stock/report/stock_report_views.xml
+++ b/addons/stock/report/stock_report_views.xml
@@ -8,10 +8,8 @@
report_type="qweb-pdf"
name="stock.report_picking"
file="stock.report_picking_operations"
+ print_report_name="'Picking Operations - %s - %s' % (object.partner_id.name or '', object.name)"
/>
- <record id="action_report_picking" model="ir.actions.report">
- <field name="print_report_name">'Picking Operations'+'-'+(object.partner_id.name or '')+'-'+(object.name)</field>
- </record>
<report
string="Delivery Slip"
id="action_report_delivery"
@@ -19,30 +17,48 @@
report_type="qweb-pdf"
name="stock.report_deliveryslip"
file="stock.report_deliveryslip"
+ print_report_name="'Delivery Slip - %s - %s' % (object.partner_id.name or '', object.name)"
/>
- <record id="action_report_delivery" model="ir.actions.report">
- <field name="print_report_name">'Delivery Slip'+'-'+(object.partner_id.name or '')+'-'+(object.name)</field>
- </record>
<report
string="Inventory"
id="action_report_inventory"
model="stock.inventory"
report_type="qweb-pdf"
name="stock.report_inventory"
- file="stock.report_inventory"
+ file="stock.report_inventory"
+ print_report_name="'Inventory - %s' % (object.name)"
+ />
+ <report
+ string="Package BarCode with Contents"
+ 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"
+ id="action_report_quant_package_barcode_small"
+ model="stock.quant.package"
+ report_type="qweb-pdf"
+ name="stock.report_package_barcode_small"
+ file="stock.report_package_barcode"/>
+ <report
+ string="Location BarCode"
+ id="action_report_location_barcode"
+ model="stock.location"
+ report_type="qweb-pdf"
+ 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"
+ model="stock.production.lot"
+ report_type="qweb-pdf"
+ name="stock.report_lot_barcode"
+ file="stock.report_lot_barcode"
+ print_report_name="'Lot-Serial - %s' % object.name"
/>
- <record id="action_report_inventory" model="ir.actions.report">
- <field name="print_report_name">'Inventory'+'-'+(object.name)</field>
- </record>
- <report id="action_report_quant_package_barcode" model="stock.quant.package" report_type="qweb-pdf" name="stock.report_package_barcode" string="Package BarCode with Contents" file="stock.report_package_barcode"/>
- <report id="action_report_quant_package_barcode_small" model="stock.quant.package" report_type="qweb-pdf" name="stock.report_package_barcode_small" string="Package BarCode" file="stock.report_package_barcode"/>
- <report id="action_report_location_barcode" model="stock.location" report_type="qweb-pdf" name="stock.report_location_barcode" string="Location BarCode" file="stock.report_location_barcode"/>
- <record id="action_report_location_barcode" model="ir.actions.report">
- <field name="print_report_name">(object.name)+'-'+'Location'</field>
- </record>
- <report id="action_report_lot_barcode" model="stock.production.lot" report_type="qweb-pdf" name="stock.report_lot_barcode" string="Lot BarCode" file="stock.report_lot_barcode"/>
- <record id="action_report_lot_barcode" model="ir.actions.report">
- <field name="print_report_name">'Lot/Serial'+'-'+(object.name)</field>
- </record>
</data>
</odoo>