From bccafbdae0e573c203d23e724aa042d3824a00e6 Mon Sep 17 00:00:00 2001 From: openerp-sle Date: Fri, 14 Feb 2014 19:00:52 +0100 Subject: [PATCH] [IMP] Converted the mrp production production order to QWeb bzr revid: openerp-sle@openerp-sle.home-20140214180052-pbluhvtg0ptl7m2c --- addons/mrp/__openerp__.py | 2 + addons/mrp/mrp_report.xml | 16 +- addons/mrp/report/__init__.py | 1 - addons/mrp/report/order.py | 34 -- addons/mrp/report/order.rml | 373 ------------------ addons/mrp/test/order_process.yml | 10 - addons/mrp/views/report_mrporder.xml | 135 +++++++ .../views/report_purchaserequisition.xml | 8 +- 8 files changed, 149 insertions(+), 430 deletions(-) delete mode 100644 addons/mrp/report/order.py delete mode 100644 addons/mrp/report/order.rml create mode 100644 addons/mrp/views/report_mrporder.xml diff --git a/addons/mrp/__openerp__.py b/addons/mrp/__openerp__.py index 99afd01707a..e5bd8171c60 100644 --- a/addons/mrp/__openerp__.py +++ b/addons/mrp/__openerp__.py @@ -72,6 +72,8 @@ Dashboard / Reports for MRP will include: 'report/mrp_production_order_view.xml', 'board_manufacturing_view.xml', 'res_config_view.xml', + + 'views/report_mrporder.xml', ], 'demo': ['mrp_demo.xml'], #TODO: This yml tests are needed to be completely reviewed again because the product wood panel is removed in product demo as it does not suit for new demo context of computer and consultant company diff --git a/addons/mrp/mrp_report.xml b/addons/mrp/mrp_report.xml index c37343f50db..781615588a7 100644 --- a/addons/mrp/mrp_report.xml +++ b/addons/mrp/mrp_report.xml @@ -4,14 +4,14 @@ - + ). -# -# 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 order(report_sxw.rml_parse): - def __init__(self, cr, uid, name, context): - super(order, self).__init__(cr, uid, name, context=context) - self.localcontext.update({ - 'time': time, - }) - -report_sxw.report_sxw('report.mrp.production.order','mrp.production','addons/mrp/report/order.rml',parser=order,header='internal') - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/mrp/report/order.rml b/addons/mrp/report/order.rml deleted file mode 100644 index f413a6cfc70..00000000000 --- a/addons/mrp/report/order.rml +++ /dev/null @@ -1,373 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Product - - - Quantity - - - Source Location - - - Destination Location - - - - - [[repeatIn(objects,'o')]] - - - - Production Order N° : [[ o.name ]] - - - - - - - Source Document - - - Product - - - Quantity - - - - - - - [[ o.origin ]] - - - [[ (o.product_id and o.product_id.code) or '' ]] [[ (o.product_id and o.product_id.name) or '' ]] - - - [[formatLang(o.product_qty) ]] [[ (o.product_id and o.product_uom and o.product_uom.name) or '']] - - - - - - - - - - Scheduled Date - - - Printing date - - - Partner Ref - - - SO Number - - - -
- - - - [[ formatLang(o.date_planned, date_time = True) ]] - - - [[ formatLang(time.strftime('%Y-%m-%d'),date = True) ]] - - - [[ ('sale_ref' in o._columns.keys() and o.sale_ref) or '' ]] - - - [[ ('sale_name' in o._columns.keys() and o.sale_name) or '' ]] - - - -
- - - - Work Orders [[ o.workcenter_lines ==[] and removeParentNode('para')]] - - - - - - - Sequence - - - Name [[ o.workcenter_lines ==[] and removeParentNode('blockTable')]] - - - WorkCenter - - - No. Of Cycles - - - No. Of Hours - - - -
- [[ repeatIn(o.workcenter_lines,'line2') ]] - - - - [[ str(line2.sequence) ]] - - - [[ line2.name ]] - - - [[ (line2.workcenter_id and line2.workcenter_id.name) or '' ]] - - - [[ formatLang(line2.cycle) ]] - - - [[ formatLang(line2.hour) ]] - - - - - - -
- - - - Bill Of Material - - - - - - - Product - - - Quantity - - - Source Location - - - Destination Location - - - -
- Products to Consume [[ o.move_lines ==[] and removeParentNode('section')]] -
- [[ repeatIn(o.move_lines,'line') ]] - - - - [[ (line.product_id and line.product_id.code) or '' ]] [[ (line.product_id and line.product_id.name) or '' ]] - - - [[ formatLang( line.product_qty) ]] [[ (line.product_uom and line.product_uom.name) or '']] - - - [[ (line.location_id and line.location_id.name) or '' ]] - - - [[ (line.location_dest_id and line.location_dest_id.name) or '' ]] - - - -
-
-
- - - - Consumed Products [[ o.move_lines2 ==[] and removeParentNode('section')]] -
- [[ repeatIn(o.move_lines2,'line2') ]] - - - - [[ (line2.product_id and line2.product_id.code) or '' ]] [[ (line2.product_id and line2.product_id.name) or '' ]] - - - [[ formatLang( line2.product_qty) ]] [[ (line2.product_uom and line2.product_uom.name) or '']] - - - [[ (line2.location_id and line2.location_id.name) or '' ]] - - - [[ (line2.location_dest_id and line2.location_dest_id.name) or '' ]] - - - -
- - - -
-
-
-
\ No newline at end of file diff --git a/addons/mrp/test/order_process.yml b/addons/mrp/test/order_process.yml index c4050208570..088cdf4311a 100644 --- a/addons/mrp/test/order_process.yml +++ b/addons/mrp/test/order_process.yml @@ -238,16 +238,6 @@ data, format = openerp.report.render_report(cr, uid, [order.bom_id.id], 'bom.structure', {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'mrp-bom_structure_report.'+format), 'wb+').write(data) -- - I print "Production Order". -- - !python {model: mrp.production}: | - import os - import openerp.report - from openerp import tools - data, format = openerp.report.render_report(cr, uid, [ref("mrp_production_test1")], 'mrp.production.order', {}, {}) - if tools.config['test_report_directory']: - file(os.path.join(tools.config['test_report_directory'], 'mrp-production_order_report.'+format), 'wb+').write(data) - I print "Work Center Load Report". - diff --git a/addons/mrp/views/report_mrporder.xml b/addons/mrp/views/report_mrporder.xml new file mode 100644 index 00000000000..52390f095d3 --- /dev/null +++ b/addons/mrp/views/report_mrporder.xml @@ -0,0 +1,135 @@ + + + + + + diff --git a/addons/purchase_requisition/views/report_purchaserequisition.xml b/addons/purchase_requisition/views/report_purchaserequisition.xml index 077772c8543..9568762b589 100644 --- a/addons/purchase_requisition/views/report_purchaserequisition.xml +++ b/addons/purchase_requisition/views/report_purchaserequisition.xml @@ -11,20 +11,20 @@

Purchase for Requisitions

-
+
Requisition Reference:
-
+
Requisition Date:
-
+
Type:
Purchase Requisitions (exclusive) Multiple Requisitions
-
+
Source: