From ea7cc4bf861e75f6253b2f14b7479edab11d14fa Mon Sep 17 00:00:00 2001 From: Jaydeep Barot Date: Tue, 5 Aug 2014 15:19:48 +0530 Subject: [PATCH] [IMP] mrp_operations : Convert mrp_wc_barcode.rml to qweb report. Set custom paperformat height and width. Also Improve yml test case --- addons/mrp_operations/__openerp__.py | 2 + .../data/report_paperformat.xml | 20 +++++++++ .../mrp_operations/mrp_operations_report.xml | 9 +++- addons/mrp_operations/report/__init__.py | 1 - .../mrp_operations/report/mrp_wc_barcode.py | 31 -------------- .../mrp_operations/report/mrp_wc_barcode.rml | 42 ------------------- .../test/workcenter_operations.yml | 2 +- .../mrp_operations/views/report_wcbarcode.xml | 19 +++++++++ 8 files changed, 49 insertions(+), 77 deletions(-) create mode 100644 addons/mrp_operations/data/report_paperformat.xml delete mode 100644 addons/mrp_operations/report/mrp_wc_barcode.py delete mode 100644 addons/mrp_operations/report/mrp_wc_barcode.rml create mode 100644 addons/mrp_operations/views/report_wcbarcode.xml diff --git a/addons/mrp_operations/__openerp__.py b/addons/mrp_operations/__openerp__.py index 1154df9bf40..bb19660418c 100644 --- a/addons/mrp_operations/__openerp__.py +++ b/addons/mrp_operations/__openerp__.py @@ -56,12 +56,14 @@ So, that we can compare the theoretic delay and real delay. 'website': 'https://www.odoo.com/page/manufacturing', 'depends': ['mrp'], 'data': [ + 'data/report_paperformat.xml', 'security/ir.model.access.csv', 'mrp_operation_data.xml', 'mrp_operations_workflow.xml', 'mrp_operations_view.xml', 'mrp_operations_report.xml', 'report/mrp_workorder_analysis_view.xml', + 'views/report_wcbarcode.xml', 'mrp_operations_workflow_instance.xml' ], 'demo': [ diff --git a/addons/mrp_operations/data/report_paperformat.xml b/addons/mrp_operations/data/report_paperformat.xml new file mode 100644 index 00000000000..97c70814dd5 --- /dev/null +++ b/addons/mrp_operations/data/report_paperformat.xml @@ -0,0 +1,20 @@ + + + + + WorkCenter BarCode + + custom + 195 + 100 + Landscape + 15 + 0 + 7 + 7 + + 35 + 90 + + + diff --git a/addons/mrp_operations/mrp_operations_report.xml b/addons/mrp_operations/mrp_operations_report.xml index b61b6078cfd..e1cc9872f92 100644 --- a/addons/mrp_operations/mrp_operations_report.xml +++ b/addons/mrp_operations/mrp_operations_report.xml @@ -6,8 +6,9 @@ id="report_wc_barcode" string="Work Centers Barcode" model="mrp.workcenter" - name="mrp.wc.barcode" - rml="mrp_operations/report/mrp_wc_barcode.rml" + report_type="qweb-pdf" + file="mrp_operations.report_wcbarcode" + name="mrp_operations.report_wcbarcode" header="False" /> + + + + diff --git a/addons/mrp_operations/report/__init__.py b/addons/mrp_operations/report/__init__.py index 0e1f26c3814..99133d17a47 100644 --- a/addons/mrp_operations/report/__init__.py +++ b/addons/mrp_operations/report/__init__.py @@ -19,6 +19,5 @@ # ############################################################################## -import mrp_wc_barcode import mrp_code_barcode import mrp_workorder_analysis diff --git a/addons/mrp_operations/report/mrp_wc_barcode.py b/addons/mrp_operations/report/mrp_wc_barcode.py deleted file mode 100644 index e6495519f26..00000000000 --- a/addons/mrp_operations/report/mrp_wc_barcode.py +++ /dev/null @@ -1,31 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (). -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -import time -from openerp.report import report_sxw - -class workcenter_code(report_sxw.rml_parse): - def __init__(self, cr, uid, name, context): - super(workcenter_code, self).__init__(cr, uid, name, context=context) - self.localcontext.update({ - 'time': time, - }) -report_sxw.report_sxw('report.mrp.wc.barcode', 'mrp.workcenter', 'addons/mrp_operations/report/mrp_wc_barcode.rml',parser=workcenter_code,header=False) diff --git a/addons/mrp_operations/report/mrp_wc_barcode.rml b/addons/mrp_operations/report/mrp_wc_barcode.rml deleted file mode 100644 index 2f9174e85b4..00000000000 --- a/addons/mrp_operations/report/mrp_wc_barcode.rml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - [[ repeatIn(objects,'o') ]] - - - - [[ str(o.name) ]] - [['ID'+str(o.id)]] - - - - - diff --git a/addons/mrp_operations/test/workcenter_operations.yml b/addons/mrp_operations/test/workcenter_operations.yml index d4533d6b3a5..a595fe7f624 100644 --- a/addons/mrp_operations/test/workcenter_operations.yml +++ b/addons/mrp_operations/test/workcenter_operations.yml @@ -130,6 +130,6 @@ from openerp import tools from openerp.report import render_report ids = [ref('mrp.mrp_workcenter_0'), ref('mrp.mrp_workcenter_1')] - data, format = render_report(cr, uid, ids, 'mrp.wc.barcode', {}) + data, format = render_report(cr, uid, ids, 'mrp_operations.report_wcbarcode', {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'mrp_operations-workcenter_barcode_report.'+format), 'wb+').write(data) diff --git a/addons/mrp_operations/views/report_wcbarcode.xml b/addons/mrp_operations/views/report_wcbarcode.xml new file mode 100644 index 00000000000..463d3665753 --- /dev/null +++ b/addons/mrp_operations/views/report_wcbarcode.xml @@ -0,0 +1,19 @@ + + + + + +