[FIX] Hr_timesheet,hr_timesheet_invoice : YML test corrections
bzr revid: jvo@tinyerp.com-20100917142323-737yl8uiblz2mzc7
This commit is contained in:
parent
8cfba5e4ab
commit
56eed34030
|
@ -51,7 +51,7 @@ to set up a management by affair.
|
||||||
],
|
],
|
||||||
'demo_xml': ['hr_timesheet_demo.xml'],
|
'demo_xml': ['hr_timesheet_demo.xml'],
|
||||||
'test': ['test/test_hr_timesheet.yml',
|
'test': ['test/test_hr_timesheet.yml',
|
||||||
'test/hr_timesheet_invoice_report.yml',
|
'test/hr_timesheet_report.yml',
|
||||||
],
|
],
|
||||||
'installable': True,
|
'installable': True,
|
||||||
'active': False,
|
'active': False,
|
||||||
|
|
|
@ -1,31 +1,23 @@
|
||||||
-
|
-
|
||||||
In order to test the PDF reports defined on a HR Timesheet User Report, we will print a HR Timesheet User Report
|
In order to test the PDF reports defined on HR Timesheet User Report, we will print a HR Timesheet User Report
|
||||||
-
|
-
|
||||||
!python {model: hr.employee}: |
|
!python {model: hr.employee}: |
|
||||||
import netsvc, tools, os, time
|
import netsvc, tools, os, time
|
||||||
import datetime
|
month = time.gmtime()[1]
|
||||||
from mx.DateTime import *
|
year = time.gmtime()[0]
|
||||||
start = datetime.date.fromtimestamp(time.mktime(time.strptime(time.strftime('%Y-%m-%d'), "%Y-%m-%d")))
|
data_dict = {'model': 'ir.ui.menu', 'form': {'month': month, 'year' : year, 'user_id' : uid }}
|
||||||
start = DateTime(int(start.year), int(start.month), int(start.day))
|
(data, format) = netsvc.LocalService('report.hr.analytical.timesheet').create(cr, uid, [], data_dict, {})
|
||||||
month=start.month
|
|
||||||
year=start.year
|
|
||||||
data_dict = {'model': 'ir.ui.menu', 'form': {'month': month, 'year' : year, 'user_id' : ref('base.user_root') }}
|
|
||||||
(data, format) = netsvc.LocalService('report.hr.analytical.timesheet').create(cr, uid, [], data_dict, {'periods': []})
|
|
||||||
if tools.config['test_report_directory']:
|
if tools.config['test_report_directory']:
|
||||||
file(os.path.join(tools.config['test_report_directory'], 'hr_timesheet-user_report.'+format), 'wb+').write(data)
|
file(os.path.join(tools.config['test_report_directory'], 'hr_timesheet-user_report.'+format), 'wb+').write(data)
|
||||||
|
|
||||||
-
|
-
|
||||||
In order to test the PDF reports defined on a HR Timesheet Users Report, we will print a HR Timesheet Users Report
|
In order to test the PDF reports defined on HR Timesheet Users Report, we will print a HR Timesheet Users Report
|
||||||
-
|
-
|
||||||
!python {model: hr.employee}: |
|
!python {model: hr.employee}: |
|
||||||
import netsvc, tools, os, time
|
import netsvc, tools, os, time
|
||||||
import datetime
|
month = time.gmtime()[1]
|
||||||
from mx.DateTime import *
|
year = time.gmtime()[0]
|
||||||
start = datetime.date.fromtimestamp(time.mktime(time.strptime(time.strftime('%Y-%m-%d'), "%Y-%m-%d")))
|
data_dict = {'model': 'ir.ui.menu', 'form': {'month': month, 'year' : year, 'user_ids' : [uid] }}
|
||||||
start = DateTime(int(start.year), int(start.month), int(start.day))
|
(data, format) = netsvc.LocalService('report.hr.analytical.timesheet_users').create(cr, uid, [], data_dict, {})
|
||||||
month=start.month
|
|
||||||
year=start.year
|
|
||||||
data_dict = {'model': 'ir.ui.menu', 'form': {'month': month, 'year' : year, 'user_ids' : [ref('base.user_root')] }}
|
|
||||||
(data, format) = netsvc.LocalService('report.hr.analytical.timesheet_users').create(cr, uid, [], data_dict, {'periods': []})
|
|
||||||
if tools.config['test_report_directory']:
|
if tools.config['test_report_directory']:
|
||||||
file(os.path.join(tools.config['test_report_directory'], 'hr_timesheet-users_report.'+format), 'wb+').write(data)
|
file(os.path.join(tools.config['test_report_directory'], 'hr_timesheet-users_report.'+format), 'wb+').write(data)
|
|
@ -47,7 +47,7 @@ reports, eso.""",
|
||||||
],
|
],
|
||||||
'demo_xml': ['hr_timesheet_invoice_demo.xml',
|
'demo_xml': ['hr_timesheet_invoice_demo.xml',
|
||||||
],
|
],
|
||||||
'test': ['test/test_hr_timesheet_invoice.yml'
|
'test': ['test/test_hr_timesheet_invoice.yml',
|
||||||
'test/hr_timesheet_invoice_report.yml',
|
'test/hr_timesheet_invoice_report.yml',
|
||||||
],
|
],
|
||||||
'installable': True,
|
'installable': True,
|
||||||
|
|
|
@ -1,23 +1,20 @@
|
||||||
-
|
-
|
||||||
In order to test the PDF reports defined on a HR Timesheet Account Analytic Profit, we will print a HR Timesheet Account Analytic Profit
|
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}: |
|
!python {model: account.analytic.line}: |
|
||||||
import netsvc, tools, os, time
|
import netsvc, tools, os, time
|
||||||
data_dict = {'model': 'ir.ui.menu', 'form': {'date_from': '2010-09-01', 'employee_ids': [[6, 0, [1, ref('hr.employee2')]]], 'journal_ids': [[6, 0, [1, 2, 3, 4]]], 'date_to': '2010-09-16'}}
|
data_dict = {'model': 'ir.ui.menu', 'form': {'date_from': time.strftime('%Y-%m-01'), 'employee_ids': [[6,0,[ref('hr.employee1'), ref('hr.employee2'),ref('hr.employee3')]]], 'journal_ids': [[6,0,[ref('account.cose_journal_sale'),ref('account.exp'),ref('account.sit')]]], 'date_to': time.strftime('%Y-%m-%d')}}
|
||||||
(data, format) = netsvc.LocalService('report.account.analytic.profit').create(cr, uid, [], data_dict, {'periods': []})
|
(data, format) = netsvc.LocalService('report.account.analytic.profit').create(cr, uid, [], data_dict, {})
|
||||||
if tools.config['test_report_directory']:
|
if tools.config['test_report_directory']:
|
||||||
file(os.path.join(tools.config['test_report_directory'], 'hr_timesheet_invoice-account_analytic_profit_report.'+format), 'wb+').write(data)
|
file(os.path.join(tools.config['test_report_directory'], 'hr_timesheet_invoice-account_analytic_profit_report.'+format), 'wb+').write(data)
|
||||||
|
|
||||||
-
|
-
|
||||||
In order to test the PDF reports defined on a HR Cost Ledger, we will print a HR Cost Ledger
|
In order to test the PDF reports defined on HR Cost Ledger, we will print report of HR Cost Ledger
|
||||||
-
|
-
|
||||||
!python {model: account.analytic.account}: |
|
!python {model: account.analytic.account}: |
|
||||||
import netsvc, tools, os, time
|
import netsvc, tools, os, time
|
||||||
import datetime
|
acc_ids = [ref('account.analytic_absences'),ref('account.analytic_internal'),ref('account.analytic_sednacom'),ref('account.analytic_thymbra'),ref('account.analytic_partners_camp_to_camp')]
|
||||||
from mx.DateTime import *
|
data_dict = {'model': 'ir.ui.menu', 'form': {'date1': time.strftime('%Y-01-01'), 'date2': time.strftime('%Y-%m-%d')}}
|
||||||
start = datetime.date.fromtimestamp(time.mktime(time.strptime(time.strftime('%Y-%m-%d'), "%Y-%m-%d")))
|
(data, format) = netsvc.LocalService('report.hr.timesheet.invoice.account.analytic.account.cost_ledger').create(cr, uid, acc_ids, data_dict, {'active_ids': acc_ids})
|
||||||
start = DateTime(int(start.year), int(start.month), int(start.day))
|
|
||||||
data_dict = {'model': 'ir.ui.menu', 'form': {'date1': start.strftime('%Y-%m-%d'), 'date2': start.strftime('%Y-%m-%d')}}
|
|
||||||
(data, format) = netsvc.LocalService('report.hr.timesheet.invoice.account.analytic.account.cost_ledger').create(cr, uid, [], data_dict, {'periods': []})
|
|
||||||
if tools.config['test_report_directory']:
|
if tools.config['test_report_directory']:
|
||||||
file(os.path.join(tools.config['test_report_directory'], 'hr_timesheet_invoice-cost_ledger_report.'+format), 'wb+').write(data)
|
file(os.path.join(tools.config['test_report_directory'], 'hr_timesheet_invoice-cost_ledger_report.'+format), 'wb+').write(data)
|
||||||
|
|
Loading…
Reference in New Issue