From 5029451905f9e90ca3b85c95505c73de7c2a40a9 Mon Sep 17 00:00:00 2001 From: Vo Minh Thu Date: Fri, 22 Feb 2013 14:35:11 +0100 Subject: [PATCH] [IMP] report yml test: use openerp.report.render_report() instead of LocalService().create(). bzr revid: vmt@openerp.com-20130222133511-y07w3etca8onb73x --- addons/account/test/account_report.yml | 10 +++--- .../test/acount_analytic_plans_report.yml | 7 ++-- .../test/account_payment_report.yml | 5 +-- .../test/account_voucher_report.yml | 5 +-- addons/delivery/test/delivery_cost.yml | 5 +-- addons/hr_expense/test/expense_process.yml | 5 +-- addons/hr_payroll/test/hr_payroll_report.yml | 7 ++-- .../test/hr_timesheet_invoice_report.yml | 5 +-- addons/l10n_fr/test/l10n_fr_report.yml | 10 +++--- .../test/payment_advice.yml | 7 ++-- addons/l10n_lu/test/l10n_lu_report.yml | 5 +-- addons/mrp/test/order_process.yml | 10 +++--- addons/mrp_repair/test/mrp_repair_report.yml | 5 +-- .../test/point_of_sale_report.yml | 35 +++++++++++-------- addons/purchase/test/ui/print_report.yml | 10 +++--- .../test/purchase_requisition.yml | 5 +-- .../test/report_intrastat_report.yml | 5 +-- .../sale_stock/test/picking_order_policy.yml | 5 +-- addons/stock/test/stock_report.yml | 25 +++++++------ 19 files changed, 102 insertions(+), 69 deletions(-) diff --git a/addons/account/test/account_report.yml b/addons/account/test/account_report.yml index 0064a1d2556..7a2d09486e4 100644 --- a/addons/account/test/account_report.yml +++ b/addons/account/test/account_report.yml @@ -14,8 +14,9 @@ - !python {model: account.invoice}: | import os - from openerp import netsvc, tools - (data, format) = netsvc.LocalService('report.account.invoice').create(cr, uid, [ref('account.account_invoice_customer0')], {}, {}) + import openerp.report + from openerp import tools + data, format = openerp.report.render_report(cr, uid, [ref('account.account_invoice_customer0')], 'account.invoice', {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'account-invoice.'+format), 'wb+').write(data) @@ -24,8 +25,9 @@ - !python {model: res.partner}: | import os - from openerp import netsvc, tools - (data, format) = netsvc.LocalService('report.account.overdue').create(cr, uid, [ref('base.res_partner_1'),ref('base.res_partner_2'),ref('base.res_partner_12')], {}, {}) + import openerp.report + from openerp import tools + data, format = openerp.report.render_report(cr, uid, [ref('base.res_partner_1'),ref('base.res_partner_2'),ref('base.res_partner_12')], 'account.overdue', {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'account-report_overdue.'+format), 'wb+').write(data) - diff --git a/addons/account_analytic_plans/test/acount_analytic_plans_report.yml b/addons/account_analytic_plans/test/acount_analytic_plans_report.yml index 7f891332aeb..6aa67a3052a 100644 --- a/addons/account_analytic_plans/test/acount_analytic_plans_report.yml +++ b/addons/account_analytic_plans/test/acount_analytic_plans_report.yml @@ -3,8 +3,9 @@ - !python {model: account.analytic.account}: | import os, time - from openerp import netsvc, tools + import openerp.report + from openerp import tools data_dict = {'model': 'account.analytic.account', 'form': {'date1':time.strftime("%Y-01-01"),'date2':time.strftime('%Y-%m-%d'),'journal_ids':[6,0,(ref('account.cose_journal_sale'))],'ref':ref('account.analytic_root'),'empty_line':True,'id':ref('account.analytic_root'),'context':{}}} - (data, format) = netsvc.LocalService('report.account.analytic.account.crossovered.analytic').create(cr, uid, [ref('account.analytic_root')], data_dict, {}) + data, format = openerp.report.render_report(cr, uid, [ref('account.analytic_root')], 'account.analytic.account.crossovered.analytic', data_dict, {}) if tools.config['test_report_directory']: - file(os.path.join(tools.config['test_report_directory'], 'account_analytic_plans-crossovered_analyitic.'+format), 'wb+').write(data) \ No newline at end of file + file(os.path.join(tools.config['test_report_directory'], 'account_analytic_plans-crossovered_analyitic.'+format), 'wb+').write(data) diff --git a/addons/account_payment/test/account_payment_report.yml b/addons/account_payment/test/account_payment_report.yml index 055e2804ee3..3def62de429 100644 --- a/addons/account_payment/test/account_payment_report.yml +++ b/addons/account_payment/test/account_payment_report.yml @@ -3,7 +3,8 @@ - !python {model: payment.order}: | import os - from openerp import netsvc, tools - (data, format) = netsvc.LocalService('report.payment.order').create(cr, uid, [ref('payment_order_1')], {}, {}) + import openerp.report + from openerp import tools + data, format = openerp.report.render_report(cr, uid, [ref('payment_order_1')], 'payment.order', {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'account_payment-payment_order_report.'+format), 'wb+').write(data) diff --git a/addons/account_voucher/test/account_voucher_report.yml b/addons/account_voucher/test/account_voucher_report.yml index e8dbde413f2..96e96e4bdfd 100644 --- a/addons/account_voucher/test/account_voucher_report.yml +++ b/addons/account_voucher/test/account_voucher_report.yml @@ -20,7 +20,8 @@ - !python {model: account.voucher}: | import os - from openerp import netsvc, tools - (data, format) = netsvc.LocalService('report.voucher.cash_receipt.drcr').create(cr, uid, [ref("account_voucher_voucheraxelor0again")], {}, {}) + import openerp.report + from openerp import tools + data, format = openerp.report.render_report(cr, uid, [ref("account_voucher_voucheraxelor0again")], 'voucher.cash_receipt.drcr', {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'account_voucher-report.'+format), 'wb+').write(data) diff --git a/addons/delivery/test/delivery_cost.yml b/addons/delivery/test/delivery_cost.yml index 8fc7a8b7afe..34ecb165ee1 100644 --- a/addons/delivery/test/delivery_cost.yml +++ b/addons/delivery/test/delivery_cost.yml @@ -32,11 +32,12 @@ - !python {model: stock.picking}: | import os - from openerp import netsvc, tools + import openerp.report + from openerp import tools sale = self.pool.get('sale.order') sale_order = sale.browse(cr, uid, ref("sale.sale_order_6")) ship_ids = [x.id for x in sale_order.picking_ids] - (data, format) = netsvc.LocalService('report.sale.shipping').create(cr, uid, ship_ids, {}, {}) + data, format = openerp.report.render_report(cr, uid, ship_ids, 'sale.shipping', {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'delivery-shipping'+format), 'wb+').write(data) - diff --git a/addons/hr_expense/test/expense_process.yml b/addons/hr_expense/test/expense_process.yml index b563f30afa9..e3fb635a9a3 100644 --- a/addons/hr_expense/test/expense_process.yml +++ b/addons/hr_expense/test/expense_process.yml @@ -42,7 +42,8 @@ - !python {model: hr.expense.expense}: | import os - from openerp import netsvc, tools - (data, format) = netsvc.LocalService('report.hr.expense').create(cr, uid, [ref('hr_expense.sep_expenses')], {}, {}) + import openerp.report + from openerp import tools + data, format = openerp.report.render_report(cr, uid, [ref('hr_expense.sep_expenses')], 'hr.expense', {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'hr_expense-report.'+format), 'wb+').write(data) diff --git a/addons/hr_payroll/test/hr_payroll_report.yml b/addons/hr_payroll/test/hr_payroll_report.yml index 9681134f270..ab4b0fa97e1 100644 --- a/addons/hr_payroll/test/hr_payroll_report.yml +++ b/addons/hr_payroll/test/hr_payroll_report.yml @@ -5,7 +5,8 @@ - !python {model: hr.payslip}: | import os - from openerp import netsvc, tools - (data, format) = netsvc.LocalService('report.payslip.pdf').create(cr, uid, [ref('hr_payroll.hr_payslip_salaryslipofbonamyforjune0')], {}, {}) + import openerp.report + from openerp import tools + data, format = openerp.report.render_report(cr, uid, [ref('hr_payroll.hr_payslip_salaryslipofbonamyforjune0')], 'payslip.pdf', {}, {}) if tools.config['test_report_directory']: - file(os.path.join(tools.config['test_report_directory'], 'hr_payroll-payslip_report.'+format), 'wb+').write(data) \ No newline at end of file + file(os.path.join(tools.config['test_report_directory'], 'hr_payroll-payslip_report.'+format), 'wb+').write(data) diff --git a/addons/hr_timesheet_invoice/test/hr_timesheet_invoice_report.yml b/addons/hr_timesheet_invoice/test/hr_timesheet_invoice_report.yml index 9f7be9e53b3..39c3161f244 100644 --- a/addons/hr_timesheet_invoice/test/hr_timesheet_invoice_report.yml +++ b/addons/hr_timesheet_invoice/test/hr_timesheet_invoice_report.yml @@ -3,8 +3,9 @@ - !python {model: account.analytic.line}: | import os, time - from openerp import netsvc, tools + import openerp.report + from openerp import tools data_dict = {'model': 'ir.ui.menu', 'form': {'date_from': time.strftime('%Y-%m-01'), 'employee_ids': [[6,0,[ref('hr.employee_fp'), ref('hr.employee_qdp'),ref('hr.employee_al')]]], 'journal_ids': [[6,0,[ref('hr_timesheet.analytic_journal')]]], 'date_to': time.strftime('%Y-%m-%d')}} - (data, format) = netsvc.LocalService('report.account.analytic.profit').create(cr, uid, [], data_dict, {}) + data, format = openerp.report.render_report(cr, uid, [], 'account.analytic.profit', data_dict, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'hr_timesheet_invoice-account_analytic_profit_report.'+format), 'wb+').write(data) diff --git a/addons/l10n_fr/test/l10n_fr_report.yml b/addons/l10n_fr/test/l10n_fr_report.yml index 44db53d0a77..25de74dd313 100644 --- a/addons/l10n_fr/test/l10n_fr_report.yml +++ b/addons/l10n_fr/test/l10n_fr_report.yml @@ -3,8 +3,9 @@ - !python {model: account.move.line}: | import os - from openerp import netsvc, tools - (data, format) = netsvc.LocalService('report.l10n.fr.bilan').create(cr, uid, [], {'model':'account.move.line', 'form':{'fiscalyear_id': ref('account.data_fiscalyear')}}, {}) + import openerp.report + from openerp import tools + data, format = openerp.report.render_report(cr, uid, [], 'l10n.fr.bilan', {'model':'account.move.line', 'form':{'fiscalyear_id': ref('account.data_fiscalyear')}}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'l10n_fr-bilan_report.'+format), 'wb+').write(data) @@ -13,7 +14,8 @@ - !python {model: account.move.line}: | import os - from openerp import netsvc, tools - (data, format) = netsvc.LocalService('report.l10n.fr.compute_resultant').create(cr, uid, [], {'model':'account.move.line', 'form':{'fiscalyear_id': ref('account.data_fiscalyear')}}, {}) + import openerp.report + from openerp import tools + data, format = openerp.report.render_report(cr, uid, [], 'l10n.fr.compute_resultant', {'model':'account.move.line', 'form':{'fiscalyear_id': ref('account.data_fiscalyear')}}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'l10n_fr-compute_resultant_report.'+format), 'wb+').write(data) diff --git a/addons/l10n_in_hr_payroll/test/payment_advice.yml b/addons/l10n_in_hr_payroll/test/payment_advice.yml index ff391dd5363..0b4b16a629c 100644 --- a/addons/l10n_in_hr_payroll/test/payment_advice.yml +++ b/addons/l10n_in_hr_payroll/test/payment_advice.yml @@ -36,7 +36,8 @@ - !python {model: hr.payroll.advice}: | import os - from openerp import netsvc, tools - (data, format) = netsvc.LocalService('report.payroll.advice').create(cr, uid, [ref('l10n_in_hr_payroll.payment_advice_1')], {}) + import openerp.report + from openerp import tools + data, format = openerp.report.render_report(cr, uid, [ref('l10n_in_hr_payroll.payment_advice_1')], 'payroll.advice', {}, {}) if tools.config['test_report_directory']: - file(os.path.join(tools.config['test_report_directory'], 'l10n_in_hr_payroll_summary report'+format), 'wb+').write(data) \ No newline at end of file + file(os.path.join(tools.config['test_report_directory'], 'l10n_in_hr_payroll_summary report'+format), 'wb+').write(data) diff --git a/addons/l10n_lu/test/l10n_lu_report.yml b/addons/l10n_lu/test/l10n_lu_report.yml index cacb3015ab2..0ee032d581c 100644 --- a/addons/l10n_lu/test/l10n_lu_report.yml +++ b/addons/l10n_lu/test/l10n_lu_report.yml @@ -9,8 +9,9 @@ - !python {model: res.partner}: | import os - from openerp import netsvc, tools - (data, format) = netsvc.LocalService('report.l10n_lu.tax.report.print').create(cr, uid, [], {'model':'ir.ui.menu', 'form':{'tax_code_id': ref('account_tax_code_id_r1'), 'period_id': ref('account.period_1')}}, {}) + import openerp.report + from openerp import tools + data, format = openerp.report.render_report(cr, uid, [], 'l10n_lu.tax.report.print', {'model':'ir.ui.menu', 'form':{'tax_code_id': ref('account_tax_code_id_r1'), 'period_id': ref('account.period_1')}}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'l10n_lu-vat_report.'+format), 'wb+').write(data) diff --git a/addons/mrp/test/order_process.yml b/addons/mrp/test/order_process.yml index 89331d5c255..acbfea48182 100644 --- a/addons/mrp/test/order_process.yml +++ b/addons/mrp/test/order_process.yml @@ -215,9 +215,10 @@ - !python {model: mrp.production}: | import os - from openerp import netsvc, tools + import openerp.report + from openerp import tools order = self.browse(cr, uid, ref("mrp_production_test1")) - (data, format) = netsvc.LocalService('report.bom.structure').create(cr, uid, [order.bom_id.id], {}, {}) + 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) - @@ -225,8 +226,9 @@ - !python {model: mrp.production}: | import os - from openerp import netsvc, tools - (data, format) = netsvc.LocalService('report.mrp.production.order').create(cr, uid, [ref("mrp_production_test1")], {}, {}) + 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) - diff --git a/addons/mrp_repair/test/mrp_repair_report.yml b/addons/mrp_repair/test/mrp_repair_report.yml index 5d66064f61d..166ace684d3 100644 --- a/addons/mrp_repair/test/mrp_repair_report.yml +++ b/addons/mrp_repair/test/mrp_repair_report.yml @@ -3,7 +3,8 @@ - !python {model: mrp.repair}: | import os - from openerp import netsvc, tools - (data, format) = netsvc.LocalService('report.repair.order').create(cr, uid, [ref('mrp_repair.mrp_repair_rmrp0')], {}, {}) + import openerp.report + from openerp import tools + data, format = openerp.report.render_report(cr, uid, [ref('mrp_repair.mrp_repair_rmrp0')], 'repair.order', {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'mrp_repair-order_report.'+format), 'wb+').write(data) diff --git a/addons/point_of_sale/test/point_of_sale_report.yml b/addons/point_of_sale/test/point_of_sale_report.yml index 00a675ac152..af034c8f23e 100644 --- a/addons/point_of_sale/test/point_of_sale_report.yml +++ b/addons/point_of_sale/test/point_of_sale_report.yml @@ -3,8 +3,9 @@ - !python {model: pos.order}: | import os - from openerp import netsvc, tools - (data, format) = netsvc.LocalService('report.pos.details_summary').create(cr, uid, [ref('point_of_sale.pos_order_pos1')], {}, {}) + import openerp.report + from openerp import tools + data, format = openerp.report.render_report(cr, uid, [ref('point_of_sale.pos_order_pos1')], 'pos.details_summary', {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-details_summary report'+format), 'wb+').write(data) @@ -13,8 +14,9 @@ - !python {model: pos.order}: | import os - from openerp import netsvc, tools - (data, format) = netsvc.LocalService('report.pos.invoice').create(cr, uid, [ref('point_of_sale.pos_order_pos1')], {}, {}) + import openerp.report + from openerp import tools + data, format = openerp.report.render_report(cr, uid, [ref('point_of_sale.pos_order_pos1')], 'pos.invoice', {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-invoice report'+format), 'wb+').write(data) @@ -23,8 +25,9 @@ - !python {model: pos.order}: | import os - from openerp import netsvc, tools - (data, format) = netsvc.LocalService('report.pos.lines').create(cr, uid, [ref('point_of_sale.pos_order_pos1')], {}, {}) + import openerp.report + from openerp import tools + data, format = openerp.report.render_report(cr, uid, [ref('point_of_sale.pos_order_pos1')], 'pos.lines', {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-lines report'+format), 'wb+').write(data) @@ -33,8 +36,9 @@ - !python {model: pos.order}: | import os - from openerp import netsvc, tools - (data, format) = netsvc.LocalService('report.pos.receipt').create(cr, uid, [ref('point_of_sale.pos_order_pos1')], {}, {}) + import openerp.report + from openerp import tools + data, format = openerp.report.render_report(cr, uid, [ref('point_of_sale.pos_order_pos1')], 'pos.receipt', {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-receipt report'+format), 'wb+').write(data) @@ -54,9 +58,10 @@ - !python {model: pos.order}: | import os, time - from openerp import netsvc, tools + import openerp.report + from openerp import tools data_dict = {'model':'ir.ui.menu', 'form':{'date_start': time.strftime('%Y-%m-%d'), 'date_end': time.strftime('%Y-%m-%d'),'user_id':[ref('base.user_root')] }} - (data, format) = netsvc.LocalService('report.pos.sales.user').create(cr, uid, [ref('point_of_sale.pos_order_pos1')], data_dict, {}) + data, format = openerp.report.render_report(cr, uid, [ref('point_of_sale.pos_order_pos1')], 'pos.sales.user', data_dict, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-sales_user_report'+format), 'wb+').write(data) - @@ -64,8 +69,9 @@ - !python {model: pos.order}: | import os, time - from openerp import netsvc, tools - (data, format) = netsvc.LocalService('report.pos.payment.report').create(cr, uid, [ref('point_of_sale.pos_order_pos0')], {}, {}) + import openerp.report + from openerp import tools + data, format = openerp.report.render_report(cr, uid, [ref('point_of_sale.pos_order_pos0')], 'pos.payment.report', {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-payment_report'+format), 'wb+').write(data) - @@ -73,8 +79,9 @@ - !python {model: pos.order}: | import os, time - from openerp import netsvc, tools + import openerp.report + from openerp import tools data_dict = {'model':'ir.ui.menu', 'form':{'user_id':[ref('base.user_root'),ref('base.user_demo')] }} - (data, format) = netsvc.LocalService('report.pos.payment.report.user').create(cr, uid, [ref('point_of_sale.pos_order_pos1')], data_dict, {}) + data, format = openerp.report.render_report(cr, uid, [ref('point_of_sale.pos_order_pos1')], 'pos.payment.report.user', data_dict, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-payment_user_report'+format), 'wb+').write(data) diff --git a/addons/purchase/test/ui/print_report.yml b/addons/purchase/test/ui/print_report.yml index c5a9448e497..5ab1854576a 100644 --- a/addons/purchase/test/ui/print_report.yml +++ b/addons/purchase/test/ui/print_report.yml @@ -3,8 +3,9 @@ - !python {model: purchase.order}: | import os - from openerp import netsvc, tools - (data, format) = netsvc.LocalService('report.purchase.quotation').create(cr, uid, [ref('purchase.purchase_order_1'),ref('purchase.purchase_order_2')], {}, {}) + import openerp.report + from openerp import tools + data, format = openerp.report.render_report(cr, uid, [ref('purchase.purchase_order_1'), ref('purchase.purchase_order_2')], 'purchase.quotation', {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'purchase-request_quotation'+format), 'wb+').write(data) - @@ -12,7 +13,8 @@ - !python {model: purchase.order}: | import os - from openerp import netsvc, tools - (data, format) = netsvc.LocalService('report.purchase.order').create(cr, uid, [ref('purchase.purchase_order_1'),ref('purchase.purchase_order_2')], {}, {}) + import openerp.report + from openerp import tools + data, format = openerp.report.render_report(cr, uid, [ref('purchase.purchase_order_1'),ref('purchase.purchase_order_2')], 'purchase.order', {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'purchase-purchase_order_report'+format), 'wb+').write(data) diff --git a/addons/purchase_requisition/test/purchase_requisition.yml b/addons/purchase_requisition/test/purchase_requisition.yml index 8fd36e07d71..ac1e4bea89c 100644 --- a/addons/purchase_requisition/test/purchase_requisition.yml +++ b/addons/purchase_requisition/test/purchase_requisition.yml @@ -83,7 +83,8 @@ - !python {model: purchase.requisition}: | import os - from openerp import netsvc, tools - (data, format) = netsvc.LocalService('report.purchase.requisition').create(cr, uid, [ref('purchase_requisition.requisition1')], {}, {}) + import openerp.report + from openerp import tools + data, format = openerp.report.render_report(cr, uid, [ref('purchase_requisition.requisition1')], 'purchase.requisition', {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'purchase_requisition-purchase_requisition_report.'+format), 'wb+').write(data) diff --git a/addons/report_intrastat/test/report_intrastat_report.yml b/addons/report_intrastat/test/report_intrastat_report.yml index e51bfbbe748..687f605b901 100644 --- a/addons/report_intrastat/test/report_intrastat_report.yml +++ b/addons/report_intrastat/test/report_intrastat_report.yml @@ -14,7 +14,8 @@ - !python {model: account.invoice}: | import os - from openerp import netsvc, tools - (data, format) = netsvc.LocalService('report.account.invoice.intrastat').create(cr, uid, [ref('test_invoice_1')], {}, {}) + import openerp.report + from openerp import tools + data, format = openerp.report.render_report(cr, uid, [ref('test_invoice_1')], 'account.invoice.intrastat', {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'report_intrastat-intrastat_report.'+format), 'wb+').write(data) diff --git a/addons/sale_stock/test/picking_order_policy.yml b/addons/sale_stock/test/picking_order_policy.yml index f761dfb65db..1df3626880f 100644 --- a/addons/sale_stock/test/picking_order_policy.yml +++ b/addons/sale_stock/test/picking_order_policy.yml @@ -162,8 +162,9 @@ - !python {model: sale.order}: | import os - from openerp import netsvc, tools - (data, format) = netsvc.LocalService('report.sale.order').create(cr, uid, [ref('sale.sale_order_6')], {}, {}) + import openerp.report + from openerp import tools + data, format = openerp.report.render_report(cr, uid, [ref('sale.sale_order_6')], 'sale.order', {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'sale-sale_order.'+format), 'wb+').write(data) diff --git a/addons/stock/test/stock_report.yml b/addons/stock/test/stock_report.yml index b1590a4d819..2b062742294 100644 --- a/addons/stock/test/stock_report.yml +++ b/addons/stock/test/stock_report.yml @@ -3,8 +3,9 @@ - !python {model: stock.location}: | import os - from openerp import netsvc, tools - (data, format) = netsvc.LocalService('report.lot.stock.overview').create(cr, uid, [ref('location_refrigerator')], {}, {}) + import openerp.report + from openerp import tools + data, format = openerp.report.render_report(cr, uid, [ref('location_refrigerator')], 'lot.stock.overview', {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'stock-overview'+format), 'wb+').write(data) - @@ -12,8 +13,9 @@ - !python {model: stock.location}: | import os - from openerp import netsvc, tools - (data, format) = netsvc.LocalService('report.lot.stock.overview_all').create(cr, uid, [ref('location_refrigerator')], {}, {}) + import openerp.report + from openerp import tools + data, format = openerp.report.render_report(cr, uid, [ref('location_refrigerator')], 'lot.stock.overview_all', {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'stock-overviewall'+format), 'wb+').write(data) - @@ -21,8 +23,9 @@ - !python {model: stock.inventory}: | import os - from openerp import netsvc, tools - (data, format) = netsvc.LocalService('report.stock.inventory.move').create(cr, uid, [ref('stock_inventory_icecream')], {}, {}) + import openerp.report + from openerp import tools + data, format = openerp.report.render_report(cr, uid, [ref('stock_inventory_icecream')], 'stock.inventory.move', {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'stock-stock_inventory_move.'+format), 'wb+').write(data) - @@ -30,8 +33,9 @@ - !python {model: stock.picking}: | import os - from openerp import netsvc, tools - (data, format) = netsvc.LocalService('report.stock.picking.list').create(cr, uid, [ref('outgoing_shipment')], {}, {}) + import openerp.report + from openerp import tools + data, format = openerp.report.render_report(cr, uid, [ref('outgoing_shipment')], 'stock.picking.list', {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'stock-picking_list'+format), 'wb+').write(data) - @@ -39,8 +43,9 @@ - !python {model: product.product}: | import os - from openerp import netsvc, tools - (data, format) = netsvc.LocalService('report.stock.product.history').create(cr, uid, [ref('product_icecream')], {}, {}) + import openerp.report + from openerp import tools + data, format = openerp.report.render_report(cr, uid, [ref('product_icecream')], 'stock.product.history', {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'stock-product_stock_report.'+format), 'wb+').write(data)