From a386aea7d3790f15337fc4a55ea14f635bd4ab5e Mon Sep 17 00:00:00 2001 From: Lionel Sausin Date: Fri, 4 Apr 2014 14:40:36 +0200 Subject: [PATCH] [FIX] revert to v7 report API bzr revid: ls@numerigraphe.com-20140404124036-1vt0fkakfllj1qax --- addons/mrp/test/order_process.yml | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/addons/mrp/test/order_process.yml b/addons/mrp/test/order_process.yml index c4050208570..bbafe5b6b27 100644 --- a/addons/mrp/test/order_process.yml +++ b/addons/mrp/test/order_process.yml @@ -231,21 +231,17 @@ uid: 'res_users_mrp_user' - !python {model: mrp.production}: | - import os - import openerp.report - from openerp import tools + import netsvc, tools, os order = self.browse(cr, uid, ref("mrp_production_test1")) - data, format = openerp.report.render_report(cr, uid, [order.bom_id.id], 'bom.structure', {}, {}) + (data, format) = netsvc.LocalService('report.bom.structure').create(cr, uid, [order.bom_id.id], {}, {}) 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', {}, {}) + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.mrp.production.order').create(cr, uid, [ref("mrp_production_test1")], {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'mrp-production_order_report.'+format), 'wb+').write(data) - @@ -255,6 +251,6 @@ ctx = context.copy() ctx.update({'model': 'mrp.workcenter','active_ids': [ref('mrp_workcenter_0'),ref('mrp_workcenter_1')]}) data_dict = {'time_unit': 'day', 'measure_unit': 'hours'} - from openerp.tools import test_reports + from tools import test_reports test_reports.try_report_action(cr, uid, 'action_mrp_workcenter_load_wizard',wiz_data=data_dict, context=ctx, our_module='mrp')