[FIX] import openerp.{netsvc,tools} instead of {netsvc,tools} in YML tests.

bzr revid: vmt@openerp.com-20130209062821-9zx3hf0zwljeepyd
This commit is contained in:
Vo Minh Thu 2013-02-09 07:28:21 +01:00
parent 37dec8326d
commit c92b76740f
7 changed files with 24 additions and 12 deletions

View File

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

View File

@ -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 = {}

View File

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

View File

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

View File

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

View File

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

View File

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