[FIX] import openerp.netsvc instead of netsvc in YML tests.

bzr revid: vmt@openerp.com-20130209062436-e2wfh3sgoufrh77t
This commit is contained in:
Vo Minh Thu 2013-02-09 07:24:36 +01:00
parent 9f93fdac95
commit 37dec8326d
18 changed files with 50 additions and 50 deletions

View File

@ -32,7 +32,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 +40,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 +48,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 +58,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 +68,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 +76,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 +84,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 +93,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 +101,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 +109,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 +117,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 +125,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 +134,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 +144,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 +154,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 +164,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 +174,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')

View File

@ -6,7 +6,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_budget_analytic',wiz_data=data_dict, context=ctx, our_module='account_budget')
-
@ -17,7 +17,7 @@
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')
-
@ -28,6 +28,6 @@
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')

View File

@ -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())

View File

@ -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')

View File

@ -103,5 +103,5 @@
import netsvc, tools, os, time
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')

View File

@ -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')

View File

@ -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!')
-

View File

@ -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!')
-
@ -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!')

View File

@ -6,7 +6,7 @@
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')
-
@ -17,5 +17,5 @@
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')

View File

@ -32,7 +32,7 @@
-
!python {model: res.partner}: |
import netsvc
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')
@ -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')

View File

@ -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)
@ -234,6 +234,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')

View File

@ -42,7 +42,7 @@
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')
-

View File

@ -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')

View File

@ -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)])

View File

@ -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:

View File

@ -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."

View File

@ -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])

View File

@ -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')