[IMP] Use the openerp namespace in YML tests.

bzr revid: vmt@openerp.com-20130209072723-nlr4znnp1zr8298v
This commit is contained in:
Vo Minh Thu 2013-02-09 08:27:23 +01:00
commit f47cf767bc
56 changed files with 215 additions and 162 deletions

View File

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

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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

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

View File

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

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

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

View File

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

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

View File

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

View File

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

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

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

View File

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

View File

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

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

View File

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

View File

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

View File

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

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

View File

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

View File

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

View File

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

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

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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

View File

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

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

View File

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

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