diff --git a/addons/account/test/account_report.yml b/addons/account/test/account_report.yml index 7fe3095d47f..0064a1d2556 100644 --- a/addons/account/test/account_report.yml +++ b/addons/account/test/account_report.yml @@ -13,7 +13,8 @@ In order to test the PDF reports defined on an invoice, we will print an Invoice Report - !python {model: account.invoice}: | - import netsvc, tools, os + import os + from openerp import netsvc, tools (data, format) = netsvc.LocalService('report.account.invoice').create(cr, uid, [ref('account.account_invoice_customer0')], {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'account-invoice.'+format), 'wb+').write(data) @@ -22,7 +23,8 @@ In order to test the PDF reports defined on a partner, we will print the Overdue Report - !python {model: res.partner}: | - import netsvc, tools, os + 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')], {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'account-report_overdue.'+format), 'wb+').write(data) @@ -32,7 +34,7 @@ !python {model: account.account}: | ctx={} data_dict = {'chart_account_id':ref('account.chart0')} - from tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'action_account_aged_balance_view',wiz_data=data_dict, context=ctx, our_module='account') - Print the Account Balance Sheet in Normal mode @@ -40,7 +42,7 @@ !python {model: account.account}: | ctx={} data_dict = {'chart_account_id':ref('account.chart0'), 'account_report_id': ref('account_financial_report_balancesheet0')} - from tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'action_account_report',wiz_data=data_dict, context=ctx, our_module='account') - Print the Account Balance Report in Normal mode through the wizard - From Account Chart @@ -48,7 +50,7 @@ !python {model: account.account}: | ctx={} data_dict = {'chart_account_id':ref('account.chart0')} - from tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'action_account_balance_menu',wiz_data=data_dict, context=ctx, our_module='account') - Print the Central Journal Report - From Account @@ -58,7 +60,7 @@ ref('account.bank_journal'),ref('account.check_journal'),ref('account.cash_journal')] ctx={} data_dict = {'chart_account_id':ref('account.chart0')} - from tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'action_account_central_journal',wiz_data=data_dict, context=ctx, our_module='account') - Print the General Journal Report - From Journal @@ -68,7 +70,7 @@ ref('account.bank_journal'),ref('account.check_journal'),ref('account.cash_journal')] ctx={} data_dict = {'chart_account_id':ref('account.chart0')} - from tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'action_account_general_journal',wiz_data=data_dict, context=ctx, our_module='account') - Print the General Ledger Report in Normal Mode @@ -76,7 +78,7 @@ !python {model: account.account}: | ctx={} data_dict = {'chart_account_id':ref('account.chart0'),'landscape':False} - from tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'action_account_general_ledger_menu',wiz_data=data_dict, context=ctx, our_module='account') - Print the General Ledger Report in Landscape Mode @@ -84,7 +86,7 @@ !python {model: account.account}: | ctx={} data_dict = {'chart_account_id':ref('account.chart0'),'landscape':True} - from tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'action_account_general_ledger_menu',wiz_data=data_dict, context=ctx, our_module='account') - Print Journal Report - From Model @@ -93,7 +95,7 @@ journal_ids = [ref('account.sales_journal'),ref('account.refund_sales_journal'),ref('account.expenses_journal'),ref('account.refund_expenses_journal'),ref('account.bank_journal'),ref('account.check_journal'),ref('account.cash_journal')] ctx={} data_dict = {'chart_account_id':ref('account.chart0'), 'period_from':ref('period_1'), 'period_to':ref('period_12')} - from tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'action_account_print_journal',wiz_data=data_dict, context=ctx, our_module='account') - Print the Partner Balance Report @@ -101,7 +103,7 @@ !python {model: account.account}: | ctx={} data_dict = {'chart_account_id':ref('account.chart0')} - from tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'action_account_partner_balance',wiz_data=data_dict, context=ctx, our_module='account') - Print the Partner Ledger Report @@ -109,7 +111,7 @@ !python {model: account.account}: | ctx={} data_dict = {'chart_account_id':ref('account.chart0'),'page_split': True} - from tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'action_account_partner_ledger',wiz_data=data_dict, context=ctx, our_module='account') - Print the Partner Ledger-Other Report @@ -117,7 +119,7 @@ !python {model: res.partner}: | ctx={} data_dict = {'chart_account_id':ref('account.chart0'),'page_split': False} - from tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'action_account_partner_ledger',wiz_data=data_dict, context=ctx, our_module='account') - Print the Profit-Loss Report in Normal Mode @@ -125,7 +127,7 @@ !python {model: account.account}: | ctx={} data_dict = {'chart_account_id':ref('account.chart0'), 'target_move': 'all', 'account_report_id': ref('account_financial_report_balancesheet0')} - from tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'action_account_report',wiz_data=data_dict, context=ctx, our_module='account') - Print the Analytic Balance Report through the wizard @@ -134,7 +136,7 @@ ctx={} ctx.update({'model': 'account.analytic.account','active_ids': [ref('account.analytic_root')]}) data_dict = {} - from tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'action_account_analytic_balance',wiz_data=data_dict, context=ctx, our_module='account') - @@ -144,7 +146,7 @@ ctx={} ctx.update({'model': 'account.analytic.account','active_ids': [ref('account.analytic_root'),ref('account.analytic_absences'),ref('account.analytic_internal'),ref('account.analytic_our_super_product')]}) data_dict = {} - from tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'action_account_analytic_cost',wiz_data=data_dict, context=ctx, our_module='account') - @@ -154,7 +156,7 @@ ctx={} ctx.update({'model': 'account.analytic.account','active_ids': [ref('account.analytic_root'),ref('account.analytic_absences'),ref('account.analytic_internal'),ref('account.analytic_our_super_product')]}) data_dict = {} - from tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'action_account_analytic_cost_ledger_journal',wiz_data=data_dict, context=ctx, our_module='account') - @@ -164,7 +166,7 @@ ctx={} ctx.update({'model': 'account.analytic.journal','active_ids': [ref('account.cose_journal_sale'), ref('account.exp'), ref('account.sit')]}) data_dict = {} - from tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'action_account_analytic_journal',wiz_data=data_dict, context=ctx, our_module='account') - @@ -174,5 +176,5 @@ ctx={} ctx.update({'model': 'account.analytic.account','active_ids': [ref('account.analytic_root')]}) data_dict = {} - from tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'action_account_analytic_invert_balance',wiz_data=data_dict, context=ctx, our_module='account') 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 40b0175f045..80ab9b36b34 100644 --- a/addons/account_budget/test/account_budget_report.yml +++ b/addons/account_budget/test/account_budget_report.yml @@ -2,32 +2,35 @@ 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 = {} - from tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'action_account_budget_analytic',wiz_data=data_dict, context=ctx, our_module='account_budget') - 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 = {} - from tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'action_account_budget_report',wiz_data=data_dict, context=ctx, our_module='account_budget') - 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 = {} - from tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'action_account_budget_crossvered_report',wiz_data=data_dict, context=ctx, our_module='account_budget') diff --git a/addons/account_payment/test/account_payment_report.yml b/addons/account_payment/test/account_payment_report.yml index 8786841bf1a..055e2804ee3 100644 --- a/addons/account_payment/test/account_payment_report.yml +++ b/addons/account_payment/test/account_payment_report.yml @@ -2,7 +2,8 @@ In order to test the PDF reports defined on Account Payment, I print a Payment Order report. - !python {model: payment.order}: | - import netsvc, tools, os + import os + from openerp import netsvc, tools (data, format) = netsvc.LocalService('report.payment.order').create(cr, uid, [ref('payment_order_1')], {}, {}) 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 60dc4103553..e8dbde413f2 100644 --- a/addons/account_voucher/test/account_voucher_report.yml +++ b/addons/account_voucher/test/account_voucher_report.yml @@ -19,7 +19,8 @@ In order to test the PDF reports defined on a account_voucher, we will print account voucher Report - !python {model: account.voucher}: | - import netsvc, tools, os + import os + from openerp import netsvc, tools (data, format) = netsvc.LocalService('report.voucher.cash_receipt.drcr').create(cr, uid, [ref("account_voucher_voucheraxelor0again")], {}, {}) 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/account_voucher/test/case1_usd_usd.yml b/addons/account_voucher/test/case1_usd_usd.yml index 0f4c2058fc7..8e9bd5de584 100644 --- a/addons/account_voucher/test/case1_usd_usd.yml +++ b/addons/account_voucher/test/case1_usd_usd.yml @@ -159,7 +159,8 @@ I fill amounts 180 for the invoice of 200$ and 70 for the invoice of 100$> - !python {model: account.voucher}: | - import netsvc, time + import time + from openerp import netsvc vals = {} voucher_id = self.browse(cr, uid, ref('account_voucher_1_case1')) data = [] @@ -182,7 +183,7 @@ I confirm the voucher - !python {model: account.voucher}: | - import netsvc + from openerp import netsvc voucher = self.search(cr, uid, [('name', '=', 'First payment: Case 1 USD/USD'), ('partner_id', '=', ref('base.res_partner_19'))]) wf_service = netsvc.LocalService("workflow") wf_service.trg_validate(uid, 'account.voucher', voucher[0], 'proforma_voucher', cr) @@ -256,7 +257,8 @@ I fill amounts 20 for the invoice of 200$ and 30 for the invoice of 100$ - !python {model: account.voucher}: | - import netsvc, time + import time + from openerp import netsvc vals = {} voucher_id = self.browse(cr, uid, ref('account_voucher_2_case1')) data = [] @@ -279,7 +281,7 @@ I confirm the voucher - !python {model: account.voucher}: | - import netsvc + from openerp import netsvc voucher = self.search(cr, uid, [('name', '=', 'Second payment: Case 1'), ('partner_id', '=', ref('base.res_partner_19'))]) wf_service = netsvc.LocalService("workflow") wf_service.trg_validate(uid, 'account.voucher', voucher[0], 'proforma_voucher', cr) diff --git a/addons/account_voucher/test/case2_suppl_usd_eur.yml b/addons/account_voucher/test/case2_suppl_usd_eur.yml index b32228032d3..194bd1be2de 100644 --- a/addons/account_voucher/test/case2_suppl_usd_eur.yml +++ b/addons/account_voucher/test/case2_suppl_usd_eur.yml @@ -131,7 +131,8 @@ I fill amounts 180 for the invoice of 200$ and 70 for the invoice of 100$ - !python {model: account.voucher}: | - import netsvc, time + import time + from openerp import netsvc vals = {} voucher_id = self.browse(cr, uid, ref('account_voucher_1_case2_suppl')) data = [] @@ -161,7 +162,7 @@ I confirm the voucher - !python {model: account.voucher}: | - import netsvc + from openerp import netsvc voucher = self.search(cr, uid, [('name', '=', 'First payment: Case 2 SUPPL USD/EUR'), ('partner_id', '=', ref('base.res_partner_19'))]) wf_service = netsvc.LocalService("workflow") wf_service.trg_validate(uid, 'account.voucher', voucher[0], 'proforma_voucher', cr) @@ -236,7 +237,8 @@ I fill amounts 20 for the invoice of 200$ and 30 for the invoice of 100$> - !python {model: account.voucher}: | - import netsvc, time + import time + from openerp import netsvc vals = {} voucher_id = self.browse(cr, uid, ref('account_voucher_2_case2_suppl')) data = [] @@ -266,7 +268,7 @@ I confirm the voucher - !python {model: account.voucher}: | - import netsvc + from openerp import netsvc voucher = self.search(cr, uid, [('name', '=', 'Second payment: Case 2 SUPPL USD/EUR'), ('partner_id', '=', ref('base.res_partner_19'))]) wf_service = netsvc.LocalService("workflow") wf_service.trg_validate(uid, 'account.voucher', voucher[0], 'proforma_voucher', cr) diff --git a/addons/account_voucher/test/case2_usd_eur_debtor_in_eur.yml b/addons/account_voucher/test/case2_usd_eur_debtor_in_eur.yml index 275e4c58835..bf785376613 100644 --- a/addons/account_voucher/test/case2_usd_eur_debtor_in_eur.yml +++ b/addons/account_voucher/test/case2_usd_eur_debtor_in_eur.yml @@ -163,7 +163,8 @@ I fill amounts 130 for the invoice of 200$ and 70 for the invoice of 100$ - !python {model: account.voucher}: | - import netsvc, time + import time + from openerp import netsvc vals = {} voucher_id = self.browse(cr, uid, ref('account_voucher_1_case2a')) data = [] @@ -179,7 +180,7 @@ I confirm the voucher - !python {model: account.voucher}: | - import netsvc + from openerp import netsvc voucher = self.search(cr, uid, [('name', '=', 'First payment: Case 2 USD/EUR DR EUR'), ('partner_id', '=', ref('base.res_partner_19'))]) wf_service = netsvc.LocalService("workflow") wf_service.trg_validate(uid, 'account.voucher', voucher[0], 'proforma_voucher', cr) @@ -231,7 +232,8 @@ and I fully reconcile the 2 previous invoices - !python {model: account.voucher}: | - import netsvc, time + import time + from openerp import netsvc vals = {} voucher_id = self.browse(cr, uid, ref('account_voucher_2_case2a')) data = [] @@ -254,7 +256,7 @@ I confirm the voucher - !python {model: account.voucher}: | - import netsvc + from openerp import netsvc voucher = self.search(cr, uid, [('name', '=', 'Second payment: Case 2 SUPPL USD/EUR DR EUR'), ('partner_id', '=', ref('base.res_partner_19'))]) wf_service = netsvc.LocalService("workflow") wf_service.trg_validate(uid, 'account.voucher', voucher[0], 'proforma_voucher', cr) diff --git a/addons/account_voucher/test/case2_usd_eur_debtor_in_usd.yml b/addons/account_voucher/test/case2_usd_eur_debtor_in_usd.yml index 667882e3a32..3caf0a747c6 100644 --- a/addons/account_voucher/test/case2_usd_eur_debtor_in_usd.yml +++ b/addons/account_voucher/test/case2_usd_eur_debtor_in_usd.yml @@ -163,7 +163,8 @@ I fill amounts 130 for the invoice of 200$ and 70 for the invoice of 100$> - !python {model: account.voucher}: | - import netsvc, time + import time + from openerp import netsvc vals = {} voucher_id = self.browse(cr, uid, ref('account_voucher_1_case2b')) data = [] @@ -179,7 +180,7 @@ I confirm the voucher - !python {model: account.voucher}: | - import netsvc + from openerp import netsvc voucher = self.search(cr, uid, [('name', '=', 'First payment: Case 2 USD/EUR DR USD'), ('partner_id', '=', ref('base.res_partner_19'))]) wf_service = netsvc.LocalService("workflow") wf_service.trg_validate(uid, 'account.voucher', voucher[0], 'proforma_voucher', cr) @@ -246,7 +247,8 @@ and I fully reconcil the 2 previous invoices - !python {model: account.voucher}: | - import netsvc, time + import time + from openerp import netsvc vals = {} voucher_id = self.browse(cr, uid, ref('account_voucher_2_case2b')) data = [] @@ -269,7 +271,7 @@ I confirm the voucher - !python {model: account.voucher}: | - import netsvc + from openerp import netsvc voucher = self.search(cr, uid, [('name', '=', 'Second payment: Case 2 SUPPL USD/EUR DR USD'), ('partner_id', '=', ref('base.res_partner_19'))]) wf_service = netsvc.LocalService("workflow") wf_service.trg_validate(uid, 'account.voucher', voucher[0], 'proforma_voucher', cr) diff --git a/addons/account_voucher/test/case3_eur_eur.yml b/addons/account_voucher/test/case3_eur_eur.yml index f2f9461c31e..5d1c1eb18a3 100644 --- a/addons/account_voucher/test/case3_eur_eur.yml +++ b/addons/account_voucher/test/case3_eur_eur.yml @@ -118,7 +118,8 @@ I fill amounts 100 for the invoice of 150€ and 20 for the invoice of 80€ - !python {model: account.voucher}: | - import netsvc, time + import time + from openerp import netsvc vals = {} voucher_id = self.browse(cr, uid, ref('account_voucher_1_case3')) data = [] @@ -141,7 +142,7 @@ I confirm the voucher - !python {model: account.voucher}: | - import netsvc + from openerp import netsvc voucher = self.search(cr, uid, [('name', '=', 'First payment: Case 3'),('partner_id', '=', ref('base.res_partner_19'))]) wf_service = netsvc.LocalService("workflow") wf_service.trg_validate(uid, 'account.voucher', voucher[0], 'proforma_voucher', cr) @@ -208,7 +209,8 @@ I fill amounts 50 for the invoice of 150€ and 70 for the invoice of 80€ - !python {model: account.voucher}: | - import netsvc, time + import time + from openerp import netsvc vals = {} voucher_id = self.browse(cr, uid, ref('account_voucher_2_case3')) data = [] @@ -231,7 +233,7 @@ I confirm the voucher - !python {model: account.voucher}: | - import netsvc + from openerp import netsvc voucher = self.search(cr, uid, [('name', '=', 'Second payment: Case 3'), ('partner_id', '=', ref('base.res_partner_19'))]) wf_service = netsvc.LocalService("workflow") wf_service.trg_validate(uid, 'account.voucher', voucher[0], 'proforma_voucher', cr) diff --git a/addons/account_voucher/test/case4_cad_chf.yml b/addons/account_voucher/test/case4_cad_chf.yml index bc33e387a85..a5deb8877c9 100644 --- a/addons/account_voucher/test/case4_cad_chf.yml +++ b/addons/account_voucher/test/case4_cad_chf.yml @@ -118,7 +118,8 @@ I completly pay the invoice of 200 CAD - !python {model: account.voucher}: | - import netsvc, time + import time + from openerp import netsvc vals = {} voucher_id = self.browse(cr, uid, ref('account_voucher_1_case4')) data = [] @@ -141,7 +142,7 @@ I confirm the voucher - !python {model: account.voucher}: | - import netsvc + from openerp import netsvc voucher = self.search(cr, uid, [('name', '=', 'First payment: Case 4'), ('partner_id', '=', ref('base.res_partner_19'))]) wf_service = netsvc.LocalService("workflow") wf_service.trg_validate(uid, 'account.voucher', voucher[0], 'proforma_voucher', cr) diff --git a/addons/account_voucher/test/case5_suppl_usd_usd.yml b/addons/account_voucher/test/case5_suppl_usd_usd.yml index 3ef6d1269b7..ace88e0bd4d 100644 --- a/addons/account_voucher/test/case5_suppl_usd_usd.yml +++ b/addons/account_voucher/test/case5_suppl_usd_usd.yml @@ -124,7 +124,8 @@ I fill $1000 for the previously encoded invoice - !python {model: account.voucher}: | - import netsvc, time + import time + from openerp import netsvc vals = {} voucher_id = self.browse(cr, uid, ref('account_voucher_case_5_supplier_flow')) for item in voucher_id.line_dr_ids: diff --git a/addons/account_voucher/test/sales_payment.yml b/addons/account_voucher/test/sales_payment.yml index b71e42add0b..25382a49d68 100644 --- a/addons/account_voucher/test/sales_payment.yml +++ b/addons/account_voucher/test/sales_payment.yml @@ -37,7 +37,7 @@ I will create and post an account voucher of amount 450.0 for the partner Seagate. - !python {model: account.voucher}: | - import netsvc + from openerp import netsvc vals = {} journal_id = self.default_get(cr, uid, ['journal_id']).get('journal_id',None) res = self.onchange_partner_id(cr, uid, [], ref("base.res_partner_19"), journal_id, 0.0, 1, ttype='receipt', date=False) diff --git a/addons/account_voucher/test/sales_receipt.yml b/addons/account_voucher/test/sales_receipt.yml index cf4bc5c46d3..b30e1263cdd 100644 --- a/addons/account_voucher/test/sales_receipt.yml +++ b/addons/account_voucher/test/sales_receipt.yml @@ -45,7 +45,7 @@ I create and post a voucher payment of amount 30000.0 for the partner Seagate - !python {model: account.voucher}: | - import netsvc + from openerp import netsvc vals = {} journal_id = self.default_get(cr, uid, ['journal_id']).get('journal_id',None) res = self.onchange_partner_id(cr, uid, [], ref("base.res_partner_19"), journal_id, 0.0, 1, ttype='receipt', date=False) diff --git a/addons/crm/test/process/communication_with_customer.yml b/addons/crm/test/process/communication_with_customer.yml index 148d08dfc49..221a4ab634f 100644 --- a/addons/crm/test/process/communication_with_customer.yml +++ b/addons/crm/test/process/communication_with_customer.yml @@ -4,7 +4,7 @@ Mail script will fetch his request from mail server. Then I process that mail after read EML file. - !python {model: mail.thread}: | - import addons + from openerp import addons request_file = open(addons.get_module_resource('crm','test', 'customer_request.eml'),'rb') request_message = request_file.read() self.message_process(cr, uid, 'crm.lead', request_message) diff --git a/addons/crm_claim/test/process/claim.yml b/addons/crm_claim/test/process/claim.yml index 45ca7cf2962..bacb073b4b9 100644 --- a/addons/crm_claim/test/process/claim.yml +++ b/addons/crm_claim/test/process/claim.yml @@ -4,7 +4,7 @@ Mail script will be fetched him request from mail server. so I process that mail after read EML file - !python {model: mail.thread}: | - import addons + from openerp import addons request_file = open(addons.get_module_resource('crm_claim','test', 'customer_claim.eml'),'rb') request_message = request_file.read() self.message_process(cr, uid, 'crm.claim', request_message) diff --git a/addons/crm_helpdesk/test/process/help-desk.yml b/addons/crm_helpdesk/test/process/help-desk.yml index 4fd6a9ee9d7..e2be4a64ca3 100644 --- a/addons/crm_helpdesk/test/process/help-desk.yml +++ b/addons/crm_helpdesk/test/process/help-desk.yml @@ -4,7 +4,7 @@ Mail script will be fetched him request from mail server. so I process that mail after read EML file - !python {model: mail.thread}: | - import addons + from openerp import addons request_file = open(addons.get_module_resource('crm_helpdesk','test', 'customer_question.eml'),'rb') request_message = request_file.read() self.message_process(cr, uid, 'crm.helpdesk', request_message) diff --git a/addons/delivery/test/delivery_cost.yml b/addons/delivery/test/delivery_cost.yml index 22b8bc3b375..8fc7a8b7afe 100644 --- a/addons/delivery/test/delivery_cost.yml +++ b/addons/delivery/test/delivery_cost.yml @@ -31,7 +31,8 @@ I print a Delivery Order report. - !python {model: stock.picking}: | - import netsvc, tools, os + import os + from openerp import netsvc, 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] diff --git a/addons/document_ftp/test/document_ftp_test.yml b/addons/document_ftp/test/document_ftp_test.yml index b3ff2a89250..fafd5026ebf 100644 --- a/addons/document_ftp/test/document_ftp_test.yml +++ b/addons/document_ftp/test/document_ftp_test.yml @@ -42,8 +42,8 @@ - !python {model: ir.attachment}: | from ftplib import FTP - from tools.misc import detect_ip_addr - from tools import config + from openerp.tools.misc import detect_ip_addr + from openerp.tools import config ftp = FTP() if detect_ip_addr: host = config.get('ftp_server_host', detect_ip_addr()) @@ -71,8 +71,8 @@ - !python {model: ir.attachment}: | from ftplib import FTP - from tools.misc import detect_ip_addr - from tools import config + from openerp.tools.misc import detect_ip_addr + from openerp.tools import config ftp = FTP() if detect_ip_addr: host = config.get('ftp_server_host', detect_ip_addr()) diff --git a/addons/hr_attendance/test/hr_attendance_report.yml b/addons/hr_attendance/test/hr_attendance_report.yml index f9d78ebbecc..a5276b775d8 100644 --- a/addons/hr_attendance/test/hr_attendance_report.yml +++ b/addons/hr_attendance/test/hr_attendance_report.yml @@ -2,7 +2,7 @@ Print the HR Attendance Report By Month through the wizard - !python {model: hr.employee}: | - from tools import test_reports + from openerp.tools import test_reports ctx = {'model': 'hr.employee','active_ids': [ref('hr.employee_fp'),ref('hr.employee_qdp'),ref('hr.employee_al')]} data_dict = {} test_reports.try_report_action(cr, uid, 'action_hr_attendance_month',wiz_data=data_dict, context=ctx, our_module='hr_attendance') @@ -11,7 +11,7 @@ - !python {model: hr.employee}: | import time - from tools import test_reports + from openerp.tools import test_reports ctx = {'model': 'hr.employee','active_ids': [ref('hr.employee_fp')]} data_dict = {'init_date': time.strftime('%Y-01-01')} test_reports.try_report_action(cr, uid, 'action_hr_attendance_error',wiz_data=data_dict, context=ctx, our_module='hr_attendance') diff --git a/addons/hr_evaluation/test/test_hr_evaluation.yml b/addons/hr_evaluation/test/test_hr_evaluation.yml index a66731531fa..ba0a77221c9 100644 --- a/addons/hr_evaluation/test/test_hr_evaluation.yml +++ b/addons/hr_evaluation/test/test_hr_evaluation.yml @@ -100,8 +100,9 @@ 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 tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'hr_evaluation_evaluation_0',wiz_data=data_dict, context=ctx, our_module='hr_evaluation') \ No newline at end of file diff --git a/addons/hr_expense/test/expense_process.yml b/addons/hr_expense/test/expense_process.yml index eae63c460fc..b563f30afa9 100644 --- a/addons/hr_expense/test/expense_process.yml +++ b/addons/hr_expense/test/expense_process.yml @@ -41,7 +41,8 @@ I print a report of the expenses. - !python {model: hr.expense.expense}: | - import netsvc, tools, os + import os + from openerp import netsvc, tools (data, format) = netsvc.LocalService('report.hr.expense').create(cr, uid, [ref('hr_expense.sep_expenses')], {}, {}) 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_holidays/test/hr_holidays_report.yml b/addons/hr_holidays/test/hr_holidays_report.yml index 854ad34d5ff..19189e34461 100644 --- a/addons/hr_holidays/test/hr_holidays_report.yml +++ b/addons/hr_holidays/test/hr_holidays_report.yml @@ -6,7 +6,7 @@ ctx={} ctx.update({'model': 'hr.department','active_ids': [ref('hr.employee_fp'),ref('hr.employee_qdp'),ref('hr.employee_al')]}) data_dict = {'date_from': time.strftime('%Y-%m-01'), 'depts' : [(6,0,[ref('hr.dep_sales')])],'holiday_type' : 'Approved'} - from tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'action_hr_holidays_summary_dept',wiz_data=data_dict, context=ctx, our_module='hr_holidays') - @@ -17,6 +17,6 @@ ctx={} ctx.update({'model': 'hr.employee','active_ids': [ref('hr.employee_fp'),ref('hr.employee_qdp'),ref('hr.employee_al')]}) data_dict = {'date_from': time.strftime('%Y-%m-01'), 'emp' : [(6,0,[ref('hr.employee_fp'),ref('hr.employee_qdp'),ref('hr.employee_al')])],'holiday_type' : 'Approved'} - from tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'action_hr_holidays_summary_employee',wiz_data=data_dict, context=ctx, our_module='hr_holidays') diff --git a/addons/hr_holidays/test/test_hr_holiday.yml b/addons/hr_holidays/test/test_hr_holiday.yml index f0e85d552cb..cb62cffa263 100644 --- a/addons/hr_holidays/test/test_hr_holiday.yml +++ b/addons/hr_holidays/test/test_hr_holiday.yml @@ -18,10 +18,10 @@ I again set to draft and then confirm. - !python {model: hr.holidays}: | - import netsvc - wf_service = netsvc.LocalService("workflow") - self.set_to_draft(cr, uid, [ref('hr_holidays_employee1_cl')]) - wf_service.trg_validate(uid, 'hr.holidays', ref('hr_holidays_employee1_cl'), 'confirm', cr) + from openerp import netsvc + wf_service = netsvc.LocalService("workflow") + self.set_to_draft(cr, uid, [ref('hr_holidays_employee1_cl')]) + wf_service.trg_validate(uid, 'hr.holidays', ref('hr_holidays_employee1_cl'), 'confirm', cr) - I validate the holiday request by clicking on "To Approve" button. - diff --git a/addons/hr_payroll/test/hr_payroll_report.yml b/addons/hr_payroll/test/hr_payroll_report.yml index 5b86bacf693..9681134f270 100644 --- a/addons/hr_payroll/test/hr_payroll_report.yml +++ b/addons/hr_payroll/test/hr_payroll_report.yml @@ -4,7 +4,8 @@ Print HR Payslip - !python {model: hr.payslip}: | - import netsvc, tools, os + import os + from openerp import netsvc, tools (data, format) = netsvc.LocalService('report.payslip.pdf').create(cr, uid, [ref('hr_payroll.hr_payslip_salaryslipofbonamyforjune0')], {}, {}) 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 diff --git a/addons/hr_payroll/test/payslip.yml b/addons/hr_payroll/test/payslip.yml index c3ad3a1a85c..0e60a5b6af4 100644 --- a/addons/hr_payroll/test/payslip.yml +++ b/addons/hr_payroll/test/payslip.yml @@ -68,7 +68,7 @@ I verify that the payslip is in done state - !python {model: hr.payslip}: | - from tools.translate import _ + from openerp.tools.translate import _ payslip_brw=self.browse(cr, uid, ref("hr_payslip_0")) assert(payslip_brw.state == 'done'), _('State not changed!') - diff --git a/addons/hr_payroll_account/test/hr_payroll_account.yml b/addons/hr_payroll_account/test/hr_payroll_account.yml index 5abf7d5dffa..5b20bf03a91 100644 --- a/addons/hr_payroll_account/test/hr_payroll_account.yml +++ b/addons/hr_payroll_account/test/hr_payroll_account.yml @@ -89,7 +89,7 @@ I verify the payslip is in draft state. - !python {model: hr.payslip}: | - from tools.translate import _ + from openerp.tools.translate import _ payslip_brw=self.browse(cr, uid, ref("hr_payslip_0")) assert(payslip_brw.state == 'draft'), _('State not changed!') - @@ -104,7 +104,7 @@ I want to check cancel button. So I first cancel the sheet then make it set to draft. - !python {model: hr.payslip}: | - import netsvc + from openerp import netsvc wf_service = netsvc.LocalService("workflow") self.cancel_sheet(cr, uid, [ref("hr_payslip_0")], None) wf_service.trg_validate(uid, 'hr.payslip', ref("hr_payslip_0"), 'draft', cr) @@ -122,7 +122,7 @@ I verify that the payslip is in done state. - !python {model: hr.payslip}: | - from tools.translate import _ + from openerp.tools.translate import _ payslip_brw=self.browse(cr, uid, ref("hr_payslip_0")) assert(payslip_brw.state == 'done'), _('State not changed!') diff --git a/addons/hr_recruitment/test/recruitment_process.yml b/addons/hr_recruitment/test/recruitment_process.yml index 5f0a005939d..f2d4e4736fa 100644 --- a/addons/hr_recruitment/test/recruitment_process.yml +++ b/addons/hr_recruitment/test/recruitment_process.yml @@ -4,7 +4,7 @@ An applicant is interested in the job position. So he sends a resume by email. - !python {model: mail.thread}: | - import addons + from openerp import addons request_file = open(addons.get_module_resource('hr_recruitment','test', 'resume.eml'),'rb') request_message = request_file.read() self.message_process(cr, uid, 'hr.applicant', request_message) diff --git a/addons/hr_timesheet/test/hr_timesheet_report.yml b/addons/hr_timesheet/test/hr_timesheet_report.yml index ae5b294aa16..ec8a8954cca 100644 --- a/addons/hr_timesheet/test/hr_timesheet_report.yml +++ b/addons/hr_timesheet/test/hr_timesheet_report.yml @@ -2,20 +2,22 @@ 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')} - from tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'action_hr_timesheet_employee',wiz_data=data_dict, context=ctx, our_module='hr_timesheet') - 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')])]} - from tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'action_hr_timesheet_users',wiz_data=data_dict, context=ctx, our_module='hr_timesheet') 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/hr_timesheet_invoice/test/test_hr_timesheet_invoice.yml b/addons/hr_timesheet_invoice/test/test_hr_timesheet_invoice.yml index de19ea8fb3a..0991b64cbd1 100644 --- a/addons/hr_timesheet_invoice/test/test_hr_timesheet_invoice.yml +++ b/addons/hr_timesheet_invoice/test/test_hr_timesheet_invoice.yml @@ -115,6 +115,6 @@ I click on "Create Invoice" button to create Invoice and validate the invoice. - !python {model: hr.timesheet.invoice.create.final}: | - import netsvc + from openerp import netsvc wkf_service = netsvc.LocalService("workflow") res = self.do_create(cr, uid, [ref("hr_timesheet_invoice_create_final_0")], {"active_ids": [ref("account.analytic_agrolait")]}) diff --git a/addons/hr_timesheet_invoice/test/test_hr_timesheet_invoice_no_prod_tax.yml b/addons/hr_timesheet_invoice/test/test_hr_timesheet_invoice_no_prod_tax.yml index 68e827e79f1..53f6808c8b5 100644 --- a/addons/hr_timesheet_invoice/test/test_hr_timesheet_invoice_no_prod_tax.yml +++ b/addons/hr_timesheet_invoice/test/test_hr_timesheet_invoice_no_prod_tax.yml @@ -114,6 +114,6 @@ I click on "Create Invoice" button to create Invoice and validate the invoice. - !python {model: hr.timesheet.invoice.create.final}: | - import netsvc + from openerp import netsvc wkf_service = netsvc.LocalService("workflow") res = self.do_create(cr, uid, [ref("hr_timesheet_invoice_create_final_0")], {"active_ids": [ref("account.analytic_agrolait")]}) diff --git a/addons/hr_timesheet_sheet/test/test_hr_timesheet_sheet.yml b/addons/hr_timesheet_sheet/test/test_hr_timesheet_sheet.yml index 71776af61ba..f2477b7c3f0 100644 --- a/addons/hr_timesheet_sheet/test/test_hr_timesheet_sheet.yml +++ b/addons/hr_timesheet_sheet/test/test_hr_timesheet_sheet.yml @@ -59,14 +59,14 @@ if the difference between Timesheet hour and attendance hour is more than 1 hour it will give message. - !python {model: hr_timesheet_sheet.sheet}: | - uid = ref('base.user_root') - import netsvc - try: - self.button_confirm(cr, uid, [ref('hr_timesheet_sheet_sheet_deddk0')], {"active_ids": - [ref("hr_timesheet_sheet.menu_act_hr_timesheet_sheet_form")],"active_id": ref("hr_timesheet_sheet.menu_act_hr_timesheet_sheet_form"), - }) - except: - pass + uid = ref('base.user_root') + from openerp import netsvc + try: + self.button_confirm(cr, uid, [ref('hr_timesheet_sheet_sheet_deddk0')], {"active_ids": + [ref("hr_timesheet_sheet.menu_act_hr_timesheet_sheet_form")],"active_id": ref("hr_timesheet_sheet.menu_act_hr_timesheet_sheet_form"), + }) + except: + pass - I Modified the timesheet record and make the difference less than 1 hour. - diff --git a/addons/l10n_fr/test/l10n_fr_report.yml b/addons/l10n_fr/test/l10n_fr_report.yml index aadd2c97311..44db53d0a77 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 + 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) @@ -11,7 +12,8 @@ In order to test the PDF reports defined on a l10n_fr, we will print a Compute Resultant Report for l10n_fr - !python {model: account.move.line}: | - import netsvc, tools, os,time + 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')}}, {}) 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 20b45830c5e..ff391dd5363 100644 --- a/addons/l10n_in_hr_payroll/test/payment_advice.yml +++ b/addons/l10n_in_hr_payroll/test/payment_advice.yml @@ -35,7 +35,8 @@ In order to test the PDF report defined on a Payment Advice, we will print a Print Advice Report when NEFT is checked - !python {model: hr.payroll.advice}: | - import netsvc, tools, os + 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')], {}) 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 diff --git a/addons/l10n_lu/test/l10n_lu_report.yml b/addons/l10n_lu/test/l10n_lu_report.yml index f3a35253850..cacb3015ab2 100644 --- a/addons/l10n_lu/test/l10n_lu_report.yml +++ b/addons/l10n_lu/test/l10n_lu_report.yml @@ -8,7 +8,8 @@ In order to test the PDF reports defined on a l10u_lu, we will print a VAT Report - !python {model: res.partner}: | - import netsvc, tools, os + 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')}}, {}) 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/membership/test/test_membership.yml b/addons/membership/test/test_membership.yml index 357fcbcfc3e..cc5e0ed30a9 100644 --- a/addons/membership/test/test_membership.yml +++ b/addons/membership/test/test_membership.yml @@ -31,19 +31,19 @@ I'm Opening that Invoice which is created for "Seagate". - !python {model: res.partner}: | - import netsvc - from tools.translate import _ - invoice_pool = self.pool.get('account.invoice') - partner_pool = self.pool.get('res.partner') - membership_line_pool = self.pool.get('membership.membership_line') - membership_pool = self.pool.get('product.product') + from openerp import netsvc + from openerp.tools.translate import _ + invoice_pool = self.pool.get('account.invoice') + partner_pool = self.pool.get('res.partner') + membership_line_pool = self.pool.get('membership.membership_line') + membership_pool = self.pool.get('product.product') - membership_line_ids = membership_line_pool.search(cr, uid, [('membership_id','=',ref('product_product_membershipproduct0')),('partner','=',ref('base.res_partner_19'))]) - membership_lines = membership_line_pool.browse(cr, uid, membership_line_ids) - assert membership_lines, _('Membership is not registrated.') - membership_line = membership_lines[0] - wf_service = netsvc.LocalService("workflow") - wf_service.trg_validate(uid, 'account.invoice', membership_line.account_invoice_id.id, 'invoice_open', cr) + membership_line_ids = membership_line_pool.search(cr, uid, [('membership_id','=',ref('product_product_membershipproduct0')),('partner','=',ref('base.res_partner_19'))]) + membership_lines = membership_line_pool.browse(cr, uid, membership_line_ids) + assert membership_lines, _('Membership is not registrated.') + membership_line = membership_lines[0] + wf_service = netsvc.LocalService("workflow") + wf_service.trg_validate(uid, 'account.invoice', membership_line.account_invoice_id.id, 'invoice_open', cr) - | I'm checking "Current membership state" of "Seagate". It is an "Invoiced Member" or not. - @@ -106,7 +106,7 @@ I'm doing to make credit note of invoice which is paid by "Seagate" to cancel membership. - !python {model: account.invoice}: | - from tools.translate import _ + from openerp.tools.translate import _ invoice_pool = self.pool.get('account.invoice') partner_pool = self.pool.get('res.partner') membership_line_pool = self.pool.get('membership.membership_line') diff --git a/addons/mrp/test/order_process.yml b/addons/mrp/test/order_process.yml index e672517c5a0..89331d5c255 100644 --- a/addons/mrp/test/order_process.yml +++ b/addons/mrp/test/order_process.yml @@ -14,7 +14,7 @@ Now I check workcenter lines. - !python {model: mrp.production}: | - from tools import float_compare + from openerp.tools import float_compare def assert_equals(value1, value2, msg, float_compare=float_compare): assert float_compare(value1, value2, precision_digits=2) == 0, msg order = self.browse(cr, uid, ref("mrp_production_test1"), context=context) @@ -214,7 +214,8 @@ I print a "BOM Structure". - !python {model: mrp.production}: | - import netsvc, tools, os + import os + from openerp import netsvc, tools order = self.browse(cr, uid, ref("mrp_production_test1")) (data, format) = netsvc.LocalService('report.bom.structure').create(cr, uid, [order.bom_id.id], {}, {}) if tools.config['test_report_directory']: @@ -223,7 +224,8 @@ I print "Production Order". - !python {model: mrp.production}: | - import netsvc, tools, os + import os + from openerp import netsvc, tools (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) @@ -234,6 +236,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 tools import test_reports + from openerp.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') diff --git a/addons/mrp_operations/test/workcenter_operations.yml b/addons/mrp_operations/test/workcenter_operations.yml index c1449657967..795e3998459 100644 --- a/addons/mrp_operations/test/workcenter_operations.yml +++ b/addons/mrp_operations/test/workcenter_operations.yml @@ -39,7 +39,7 @@ Production start on first work center, so I start work operation on first work center. - !python {model: mrp.production}: | - import netsvc + from openerp import netsvc order = self.browse(cr, uid, ref("mrp.mrp_production_1"), context=context) wf_service = netsvc.LocalService("workflow") wf_service.trg_validate(uid, 'mrp.production.workcenter.line', order.workcenter_lines[0].id, 'button_start_working', cr) @@ -47,7 +47,7 @@ Now I pause first work operation due to technical fault of work center. - !python {model: mrp.production}: | - import netsvc + from openerp import netsvc order = self.browse(cr, uid, ref("mrp.mrp_production_1"), context=context) wf_service = netsvc.LocalService("workflow") wf_service.trg_validate(uid, 'mrp.production.workcenter.line', order.workcenter_lines[0].id, 'button_pause', cr) @@ -55,7 +55,7 @@ I resume first work operation. - !python {model: mrp.production}: | - import netsvc + from openerp import netsvc order = self.browse(cr, uid, ref("mrp.mrp_production_1"), context=context) wf_service = netsvc.LocalService("workflow") wf_service.trg_validate(uid, 'mrp.production.workcenter.line', order.workcenter_lines[0].id, 'button_resume', cr) @@ -64,7 +64,7 @@ I cancel first work operation. - !python {model: mrp.production}: | - import netsvc + from openerp import netsvc order = self.browse(cr, uid, ref("mrp.mrp_production_1"), context=context) wf_service = netsvc.LocalService("workflow") wf_service.trg_validate(uid, 'mrp.production.workcenter.line', order.workcenter_lines[0].id, 'button_cancel', cr) @@ -72,7 +72,7 @@ I reset first work operation and start after resolving techninal fault of work center. - !python {model: mrp.production}: | - import netsvc + from openerp import netsvc order = self.browse(cr, uid, ref("mrp.mrp_production_1"), context=context) wf_service = netsvc.LocalService("workflow") wf_service.trg_validate(uid, 'mrp.production.workcenter.line', order.workcenter_lines[0].id, 'button_draft', cr) @@ -81,7 +81,7 @@ I close first work operation as this work center completed its process. - !python {model: mrp.production}: | - import netsvc + from openerp import netsvc order = self.browse(cr, uid, ref("mrp.mrp_production_1"), context=context) wf_service = netsvc.LocalService("workflow") wf_service.trg_validate(uid, 'mrp.production.workcenter.line', order.workcenter_lines[0].id, 'button_done', cr) @@ -89,7 +89,7 @@ Now I close other operations one by one which are in start state. - !python {model: mrp.production}: | - import netsvc + from openerp import netsvc order = self.browse(cr, uid, ref("mrp.mrp_production_1"), context=context) wf_service = netsvc.LocalService("workflow") for work_line in order.workcenter_lines[1:]: @@ -106,7 +106,8 @@ I print a Barcode Report of Operation line. - !python {model: mrp_operations.operation.code}: | - import netsvc, tools, os + import os + from openerp import netsvc, tools (data, format) = netsvc.LocalService('report.mrp.code.barcode').create(cr, uid, [ref('mrp_operations.mrp_op_1'),ref('mrp_operations.mrp_op_2'),ref('mrp_operations.mrp_op_3'),ref('mrp_operations.mrp_op_4'),ref('mrp_operations.mrp_op_5')], {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'mrp_operations-barcode_report.'+format), 'wb+').write(data) @@ -115,7 +116,8 @@ I print Workcenter's Barcode Report. - !python {model: mrp.workcenter}: | - import netsvc, tools, os + import os + from openerp import netsvc, tools (data, format) = netsvc.LocalService('report.mrp.wc.barcode').create(cr, uid, [ref('mrp.mrp_workcenter_0'),ref('mrp.mrp_workcenter_1')], {}, {}) 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_repair/test/mrp_repair_report.yml b/addons/mrp_repair/test/mrp_repair_report.yml index 3b8e05108c8..5d66064f61d 100644 --- a/addons/mrp_repair/test/mrp_repair_report.yml +++ b/addons/mrp_repair/test/mrp_repair_report.yml @@ -2,7 +2,8 @@ In order to test the PDF reports defined on a MRP Repair, we will print an Order Report - !python {model: mrp.repair}: | - import netsvc, tools, os + import os + from openerp import netsvc, tools (data, format) = netsvc.LocalService('report.repair.order').create(cr, uid, [ref('mrp_repair.mrp_repair_rmrp0')], {}, {}) 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 0d6d458e02f..00a675ac152 100644 --- a/addons/point_of_sale/test/point_of_sale_report.yml +++ b/addons/point_of_sale/test/point_of_sale_report.yml @@ -2,7 +2,8 @@ In order to test the PDF reports defined on a Point Of Sale,we will print a POS Detail Summary Report - !python {model: pos.order}: | - import netsvc, tools, os + 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')], {}, {}) 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) @@ -11,7 +12,8 @@ In order to test the PDF reports defined on a Point Of Sale, we will print a POS Invoice Report - !python {model: pos.order}: | - import netsvc, tools, os + import os + from openerp import netsvc, tools (data, format) = netsvc.LocalService('report.pos.invoice').create(cr, uid, [ref('point_of_sale.pos_order_pos1')], {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-invoice report'+format), 'wb+').write(data) @@ -20,7 +22,8 @@ In order to test the PDF reports defined on a Point Of Sale, we will print a POS Lines Report - !python {model: pos.order}: | - import netsvc, tools, os + import os + from openerp import netsvc, tools (data, format) = netsvc.LocalService('report.pos.lines').create(cr, uid, [ref('point_of_sale.pos_order_pos1')], {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-lines report'+format), 'wb+').write(data) @@ -29,7 +32,8 @@ In order to test the PDF reports defined on a Point of Sale, we will print a POS Receipt Report - !python {model: pos.order}: | - import netsvc, tools, os + import os + from openerp import netsvc, tools (data, format) = netsvc.LocalService('report.pos.receipt').create(cr, uid, [ref('point_of_sale.pos_order_pos1')], {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-receipt report'+format), 'wb+').write(data) @@ -42,14 +46,15 @@ ctx={} ctx.update({'model': 'ir.ui.menu','active_ids': []}) data_dict = {'date_start': time.strftime('%Y-%m-%d'), 'date_end': time.strftime('%Y-%m-%d'), 'user_ids': [(6,0,[ref('base.user_root')])]} - from tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'action_report_pos_details',wiz_data=data_dict, context=ctx, our_module='point_of_sale') - 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 +63,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 +72,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']: diff --git a/addons/product/test/product_pricelist.yml b/addons/product/test/product_pricelist.yml index 66e256d4cd1..0b4bed18a82 100644 --- a/addons/product/test/product_pricelist.yml +++ b/addons/product/test/product_pricelist.yml @@ -71,5 +71,5 @@ 'qty5': 30, 'price_list':ref('customer_pricelist'), } - from tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'action_product_price_list',wiz_data=data_dict, context=ctx, our_module='product') diff --git a/addons/project_issue/test/subscribe_issue.yml b/addons/project_issue/test/subscribe_issue.yml index 4ba472b41ed..9f16dc80b97 100644 --- a/addons/project_issue/test/subscribe_issue.yml +++ b/addons/project_issue/test/subscribe_issue.yml @@ -2,7 +2,7 @@ In Order to test process of Issue in OpenERP, Custmer send the issue by email. - !python {model: mail.thread}: | - import addons + from openerp import addons request_file = open(addons.get_module_resource('project_issue','test', 'issue.eml'),'rb') request_message = request_file.read() self.message_process(cr, uid, 'project.issue', request_message) diff --git a/addons/purchase/test/process/rfq2order2done.yml b/addons/purchase/test/process/rfq2order2done.yml index 4bf55d61973..4308ffb8be4 100644 --- a/addons/purchase/test/process/rfq2order2done.yml +++ b/addons/purchase/test/process/rfq2order2done.yml @@ -59,7 +59,7 @@ I Validate Invoice of Purchase Order. - !python {model: purchase.order}: | - import netsvc + from openerp import netsvc invoice_ids = [x.id for x in self.browse(cr, uid, ref("purchase_order_1")).invoice_ids] wf_service = netsvc.LocalService("workflow") for invoice in invoice_ids: diff --git a/addons/purchase/test/ui/print_report.yml b/addons/purchase/test/ui/print_report.yml index 75c6d21e036..c5a9448e497 100644 --- a/addons/purchase/test/ui/print_report.yml +++ b/addons/purchase/test/ui/print_report.yml @@ -2,7 +2,8 @@ In order to test the PDF reports defined on a Purchase Order, I print a Request Quotation report - !python {model: purchase.order}: | - import netsvc, tools, os + 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')], {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'purchase-request_quotation'+format), 'wb+').write(data) @@ -10,7 +11,8 @@ I print Purchase Order report - !python {model: purchase.order}: | - import netsvc, tools, os + 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')], {}, {}) 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 38e66788dcf..bf0b7cdc400 100644 --- a/addons/purchase_requisition/test/purchase_requisition.yml +++ b/addons/purchase_requisition/test/purchase_requisition.yml @@ -69,7 +69,7 @@ I confirmed RFQ which has best price. - !python {model: purchase.order}: | - import netsvc + from openerp import netsvc wf_service = netsvc.LocalService("workflow") purchase = self.browse(cr, uid, ref('rfq2'), context=context) wf_service.trg_validate(uid, 'purchase.order', purchase.id, 'purchase_confirm', cr) @@ -84,7 +84,8 @@ I print a Requisition report - !python {model: purchase.requisition}: | - import netsvc, tools, os + import os + from openerp import netsvc, tools (data, format) = netsvc.LocalService('report.purchase.requisition').create(cr, uid, [ref('purchase_requisition.requisition1')], {}, {}) 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 626f2fde186..e51bfbbe748 100644 --- a/addons/report_intrastat/test/report_intrastat_report.yml +++ b/addons/report_intrastat/test/report_intrastat_report.yml @@ -13,7 +13,8 @@ In order to test the PDF reports defined using report_intrastat module, we print a Intrastat Report - !python {model: account.invoice}: | - import netsvc, tools, os + import os + from openerp import netsvc, tools (data, format) = netsvc.LocalService('report.account.invoice.intrastat').create(cr, uid, [ref('test_invoice_1')], {}, {}) 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/test/cancel_order.yml b/addons/sale/test/cancel_order.yml index cde3a5b34f2..7ad349cc1fa 100644 --- a/addons/sale/test/cancel_order.yml +++ b/addons/sale/test/cancel_order.yml @@ -51,7 +51,7 @@ I cancel all the invoices. - !python {model: sale.order}: | - import netsvc + from openerp import netsvc invoice_ids = self.browse(cr, uid, ref("sale_order_8")).invoice_ids wf_service = netsvc.LocalService("workflow") for invoice in invoice_ids: diff --git a/addons/sale/test/manual_order_policy.yml b/addons/sale/test/manual_order_policy.yml index 5fe29950176..8e88fb187a0 100644 --- a/addons/sale/test/manual_order_policy.yml +++ b/addons/sale/test/manual_order_policy.yml @@ -41,7 +41,7 @@ I open the Invoice. - !python {model: sale.order}: | - import netsvc + from openerp import netsvc wf_service = netsvc.LocalService("workflow") so = self.browse(cr, uid, ref("sale_order_2")) for invoice in so.invoice_ids: diff --git a/addons/sale_mrp/test/sale_mrp.yml b/addons/sale_mrp/test/sale_mrp.yml index 6fd64301af2..ee0669367ad 100644 --- a/addons/sale_mrp/test/sale_mrp.yml +++ b/addons/sale_mrp/test/sale_mrp.yml @@ -92,7 +92,7 @@ I verify that a procurement has been generated for sale order - !python {model: procurement.order}: | - from tools.translate import _ + from openerp.tools.translate import _ sale_order_obj = self.pool.get('sale.order') so = sale_order_obj.browse(cr, uid, ref("sale_order_so0")) proc_ids = self.search(cr, uid, [('origin','=',so.name)]) @@ -103,7 +103,7 @@ !python {model: procurement.order}: | sale_order_obj = self.pool.get('sale.order') so = sale_order_obj.browse(cr, uid, ref("sale_order_so0")) - import netsvc + from openerp import netsvc wf_service = netsvc.LocalService("workflow") proc_ids = self.search(cr, uid, [('origin','=',so.name)]) for proc in proc_ids: diff --git a/addons/sale_stock/test/cancel_order_sale_stock.yml b/addons/sale_stock/test/cancel_order_sale_stock.yml index 6805a90ca80..f3dd28f1564 100644 --- a/addons/sale_stock/test/cancel_order_sale_stock.yml +++ b/addons/sale_stock/test/cancel_order_sale_stock.yml @@ -17,7 +17,7 @@ Now I cancel latest shipment. - !python {model: stock.picking}: | - import netsvc + from openerp import netsvc delivery_orders = self.search(cr, uid, [('sale_id','=',ref("sale.sale_order_8"))]) last_delivery_order_id = delivery_orders[0] wf_service = netsvc.LocalService("workflow") @@ -50,7 +50,7 @@ To cancel the sale order from Invoice Exception, I have to cancel the invoice of sale order. - !python {model: sale.order}: | - import netsvc + from openerp import netsvc invoice_ids = self.browse(cr, uid, ref("sale.sale_order_8")).invoice_ids wf_service = netsvc.LocalService("workflow") first_invoice_id = invoice_ids[0] diff --git a/addons/sale_stock/test/picking_order_policy.yml b/addons/sale_stock/test/picking_order_policy.yml index 800c131e288..7b29afa3875 100644 --- a/addons/sale_stock/test/picking_order_policy.yml +++ b/addons/sale_stock/test/picking_order_policy.yml @@ -22,7 +22,7 @@ !python {model: sale.order}: | from datetime import datetime, timedelta from dateutil.relativedelta import relativedelta - from tools import DEFAULT_SERVER_DATE_FORMAT, DEFAULT_SERVER_DATETIME_FORMAT + from openerp.tools import DEFAULT_SERVER_DATE_FORMAT, DEFAULT_SERVER_DATETIME_FORMAT order = self.browse(cr, uid, ref("sale.sale_order_6")) for order_line in order.order_line: procurement = order_line.procurement_id @@ -44,7 +44,7 @@ !python {model: sale.order}: | from datetime import datetime, timedelta from dateutil.relativedelta import relativedelta - from tools import DEFAULT_SERVER_DATE_FORMAT, DEFAULT_SERVER_DATETIME_FORMAT + from openerp.tools import DEFAULT_SERVER_DATE_FORMAT, DEFAULT_SERVER_DATETIME_FORMAT sale_order = self.browse(cr, uid, ref("sale.sale_order_6")) assert sale_order.picking_ids, "Delivery order is not created." for picking in sale_order.picking_ids: @@ -132,7 +132,7 @@ I open the Invoice. - !python {model: sale.order}: | - import netsvc + from openerp import netsvc wf_service = netsvc.LocalService("workflow") so = self.browse(cr, uid, ref("sale.sale_order_6")) for invoice in so.invoice_ids: @@ -162,7 +162,8 @@ I print a sale order report. - !python {model: sale.order}: | - import netsvc, tools, os + import os + from openerp import netsvc, tools (data, format) = netsvc.LocalService('report.sale.order').create(cr, uid, [ref('sale.sale_order_6')], {}, {}) 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 5c5932446eb..b1590a4d819 100644 --- a/addons/stock/test/stock_report.yml +++ b/addons/stock/test/stock_report.yml @@ -2,7 +2,8 @@ I print a stock overview report of location. - !python {model: stock.location}: | - import netsvc, tools, os + import os + from openerp import netsvc, tools (data, format) = netsvc.LocalService('report.lot.stock.overview').create(cr, uid, [ref('location_refrigerator')], {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'stock-overview'+format), 'wb+').write(data) @@ -10,7 +11,8 @@ I print a Stock Overview report of location with child location. - !python {model: stock.location}: | - import netsvc, tools, os + import os + from openerp import netsvc, tools (data, format) = netsvc.LocalService('report.lot.stock.overview_all').create(cr, uid, [ref('location_refrigerator')], {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'stock-overviewall'+format), 'wb+').write(data) @@ -18,7 +20,8 @@ I print a Stock Inventory report. - !python {model: stock.inventory}: | - import netsvc, tools, os + import os + from openerp import netsvc, tools (data, format) = netsvc.LocalService('report.stock.inventory.move').create(cr, uid, [ref('stock_inventory_icecream')], {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'stock-stock_inventory_move.'+format), 'wb+').write(data) @@ -26,7 +29,8 @@ I print a outgoing shipment report. - !python {model: stock.picking}: | - import netsvc, tools, os + import os + from openerp import netsvc, tools (data, format) = netsvc.LocalService('report.stock.picking.list').create(cr, uid, [ref('outgoing_shipment')], {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'stock-picking_list'+format), 'wb+').write(data) @@ -34,7 +38,8 @@ I print stock Report. - !python {model: product.product}: | - import netsvc, tools, os + import os + from openerp import netsvc, tools (data, format) = netsvc.LocalService('report.stock.product.history').create(cr, uid, [ref('product_icecream')], {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'stock-product_stock_report.'+format), 'wb+').write(data) diff --git a/addons/stock_location/test/stock_location_pull_flow.yml b/addons/stock_location/test/stock_location_pull_flow.yml index 0ff1b5d3af8..a87ed2cb30c 100644 --- a/addons/stock_location/test/stock_location_pull_flow.yml +++ b/addons/stock_location/test/stock_location_pull_flow.yml @@ -192,13 +192,13 @@ I check the new procurement order has been created . - !python {model: procurement.order }: | - from tools.translate import _ + from openerp.tools.translate import _ procurement_ids=self.search(cr, uid, [('name','=','E001')]) assert len(procurement_ids), "Procurement order hasn't Created." - I check the Outgoing Picking is created for source location Birmingham Shop and destination Chicago shop. - !python {model: stock.picking }: | - from tools.translate import _ + from openerp.tools.translate import _ picking_id = self.search(cr, uid, [('origin','=','Testing pulled flow:E001'),('type','=','out')]) assert len(picking_id), "Picking hasn't Created." diff --git a/addons/stock_location/test/stock_location_push_flow.yml b/addons/stock_location/test/stock_location_push_flow.yml index efd2daaf272..27164848f77 100644 --- a/addons/stock_location/test/stock_location_push_flow.yml +++ b/addons/stock_location/test/stock_location_push_flow.yml @@ -94,7 +94,7 @@ I check the move is in waiting state. - !python {model: stock.picking }: | - from tools.translate import _ + from openerp.tools.translate import _ picking_id = self.search(cr, uid, [('origin','=','Pushed Flow Test'),('type','=','out')]) if picking_id: pick=self.browse(cr,uid,picking_id[0]) @@ -123,7 +123,7 @@ I check the Outgoing Orders is automatically done. - !python {model: stock.picking }: | - from tools.translate import _ + from openerp.tools.translate import _ picking_id = self.search(cr, uid, [('origin','=','Pushed Flow Test'),('type','=','out')]) if picking_id: pick=self.browse(cr,uid,picking_id[0]) diff --git a/addons/survey/test/survey_report.yml b/addons/survey/test/survey_report.yml index cf225dfcf6e..36eff699075 100644 --- a/addons/survey/test/survey_report.yml +++ b/addons/survey/test/survey_report.yml @@ -4,7 +4,7 @@ !python {model: survey}: | ctx = {'model': 'survey','active_ids': [(6,0,[ref('survey_partner_feedback')])]} data_dict = {'response_ids' : [(6,0,[ref('survey.survey_partner_feedback')])], 'page_number' : True, 'without_pagebreak': True} - from tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'action_view_survey_print_answer',wiz_data=data_dict, context=ctx, our_module='survey') - @@ -13,7 +13,7 @@ !python {model: survey}: | ctx = {'model': 'survey','active_ids': [(6,0,[ref('survey_partner_feedback')])]} data_dict = {'survey_ids' : [(6,0,[ref('survey.survey_partner_feedback')])]} - from tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'action_view_survey_print_statistics',wiz_data=data_dict, context=ctx, our_module='survey') - @@ -22,5 +22,5 @@ !python {model: survey}: | ctx = {'model': 'survey','active_ids': [(6,0,[ref('survey_partner_feedback')])]} data_dict = {'survey_ids' : [(6,0,[ref('survey.survey_partner_feedback')])], 'page_number' : True, 'without_pagebreak': True} - from tools import test_reports + from openerp.tools import test_reports test_reports.try_report_action(cr, uid, 'action_view_survey_print',wiz_data=data_dict, context=ctx, our_module='survey')