From c92b76740f2ac4d9bb45ba798f7abb0d7aaa45bb Mon Sep 17 00:00:00 2001 From: Vo Minh Thu Date: Sat, 9 Feb 2013 07:28:21 +0100 Subject: [PATCH] [FIX] import openerp.{netsvc,tools} instead of {netsvc,tools} in YML tests. bzr revid: vmt@openerp.com-20130209062821-9zx3hf0zwljeepyd --- .../test/acount_analytic_plans_report.yml | 3 ++- addons/account_budget/test/account_budget_report.yml | 9 ++++++--- addons/hr_evaluation/test/test_hr_evaluation.yml | 3 ++- addons/hr_timesheet/test/hr_timesheet_report.yml | 6 ++++-- .../test/hr_timesheet_invoice_report.yml | 3 ++- addons/l10n_fr/test/l10n_fr_report.yml | 3 ++- addons/point_of_sale/test/point_of_sale_report.yml | 9 ++++++--- 7 files changed, 24 insertions(+), 12 deletions(-) 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 0990b9ba5f9..7f891332aeb 100644 --- a/addons/account_analytic_plans/test/acount_analytic_plans_report.yml +++ b/addons/account_analytic_plans/test/acount_analytic_plans_report.yml @@ -2,7 +2,8 @@ Print the Crossovered Analytic Report in Normal mode - !python {model: account.analytic.account}: | - import netsvc, tools, os, time + import os, time + from openerp import netsvc, 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, {}) if tools.config['test_report_directory']: diff --git a/addons/account_budget/test/account_budget_report.yml b/addons/account_budget/test/account_budget_report.yml index bb8b8d36666..80ab9b36b34 100644 --- a/addons/account_budget/test/account_budget_report.yml +++ b/addons/account_budget/test/account_budget_report.yml @@ -2,7 +2,8 @@ Print the Analytic Budget Report through wizard - !python {model: account.analytic.account}: | - import netsvc, tools, os, time + import os, time + from openerp import netsvc, tools ctx={} ctx.update({'model': 'account.analytic.account','active_ids': [ref('account.analytic_root')]}) data_dict = {} @@ -13,7 +14,8 @@ Print the Budget Report through wizard - !python {model: account.budget.post}: | - import netsvc, tools, os, time + import os, time + from openerp import netsvc, tools ctx={} ctx.update({'model': 'account.budget.post','active_ids': [ref('account_budget.account_budget_post_sales0')]}) data_dict = {} @@ -24,7 +26,8 @@ Print the CrossOvered Budget Report mode through wizard - !python {model: crossovered.budget}: | - import netsvc, tools, os, time + import os, time + from openerp import netsvc, tools ctx={} ctx.update({'model': 'account.budget.post','active_ids': [ref('account_budget.crossovered_budget_budgetoptimistic0')]}) data_dict = {} diff --git a/addons/hr_evaluation/test/test_hr_evaluation.yml b/addons/hr_evaluation/test/test_hr_evaluation.yml index 4997f4109c5..ba0a77221c9 100644 --- a/addons/hr_evaluation/test/test_hr_evaluation.yml +++ b/addons/hr_evaluation/test/test_hr_evaluation.yml @@ -100,7 +100,8 @@ Print Evaluations Statistics Report - !python {model: hr.evaluation.report}: | - import netsvc, tools, os, time + import os, time + from openerp import netsvc, tools ctx={} data_dict={'state': 'done', 'rating': 2, 'employee_id': ref("hr.employee_fp")} from openerp.tools import test_reports diff --git a/addons/hr_timesheet/test/hr_timesheet_report.yml b/addons/hr_timesheet/test/hr_timesheet_report.yml index 30fb1c642ba..ec8a8954cca 100644 --- a/addons/hr_timesheet/test/hr_timesheet_report.yml +++ b/addons/hr_timesheet/test/hr_timesheet_report.yml @@ -2,7 +2,8 @@ Print the HR Timesheet By Employee report through the wizard - !python {model: hr.employee}: | - import netsvc, tools, os, time + import os, time + from openerp import netsvc, tools ctx={} ctx.update({'model': 'hr.employee','active_ids': []}) data_dict = {'month': time.gmtime()[1], 'year': time.gmtime()[0], 'employee_id' : ref('hr.employee_fp')} @@ -13,7 +14,8 @@ Print the HR Timesheet By Employee report through the wizard - !python {model: hr.employee}: | - import netsvc, tools, os, time + import os, time + from openerp import netsvc, tools ctx={} ctx.update({'model': 'hr.employee','active_ids': []}) data_dict = {'month': time.gmtime()[1], 'year': time.gmtime()[0], 'employee_ids' : [(6,0,[ref('hr.employee_fp'),ref('hr.employee_qdp'),ref('hr.employee_al')])]} 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 adce0e97fa3..9f7be9e53b3 100644 --- a/addons/hr_timesheet_invoice/test/hr_timesheet_invoice_report.yml +++ b/addons/hr_timesheet_invoice/test/hr_timesheet_invoice_report.yml @@ -2,7 +2,8 @@ In order to test the PDF reports defined on HR Timesheet Account Analytic Profit, we will print report of HR Timesheet Account Analytic Profit - !python {model: account.analytic.line}: | - import netsvc, tools, os, time + import os, time + from openerp import netsvc, 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, {}) if tools.config['test_report_directory']: diff --git a/addons/l10n_fr/test/l10n_fr_report.yml b/addons/l10n_fr/test/l10n_fr_report.yml index aadd2c97311..6dd6a563525 100644 --- a/addons/l10n_fr/test/l10n_fr_report.yml +++ b/addons/l10n_fr/test/l10n_fr_report.yml @@ -2,7 +2,8 @@ In order to test the PDF reports defined on a l10n_fr, we will print an Account Move Line Report for l10n_fr - !python {model: account.move.line}: | - import netsvc, tools, os, time + import os, time + 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')}}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'l10n_fr-bilan_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 f89b34dbeba..4356d4e1d27 100644 --- a/addons/point_of_sale/test/point_of_sale_report.yml +++ b/addons/point_of_sale/test/point_of_sale_report.yml @@ -49,7 +49,8 @@ In order to test the PDF reports defined on a Point of Sale, we will print a POS Sales User Report - !python {model: pos.order}: | - import netsvc, tools, os, time + import os, time + from openerp import netsvc, 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, {}) if tools.config['test_report_directory']: @@ -58,7 +59,8 @@ In order to test the PDF reports defined on a Point of Sale, we will print a POS Payment Report - !python {model: pos.order}: | - import netsvc, tools, os, time + 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')], {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-payment_report'+format), 'wb+').write(data) @@ -66,7 +68,8 @@ In order to test the PDF reports defined on a Point of Sale, we will print a POS Payment User Report - !python {model: pos.order}: | - import netsvc, tools, os, time + import os, time + from openerp import netsvc, 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, {}) if tools.config['test_report_directory']: