diff --git a/addons/account/__openerp__.py b/addons/account/__openerp__.py index c432689de44..9bbddb1e050 100644 --- a/addons/account/__openerp__.py +++ b/addons/account/__openerp__.py @@ -134,6 +134,7 @@ module named account_voucher. 'test/account_use_model.yml', 'test/account_validate_account_move.yml', 'test/account_fiscalyear_close.yml', + 'test/account_report.yml', ], 'installable': True, 'active': False, diff --git a/addons/account/report/account_balance_sheet.py b/addons/account/report/account_balance_sheet.py index 49606dc2c6b..9b816b2ab5a 100644 --- a/addons/account/report/account_balance_sheet.py +++ b/addons/account/report/account_balance_sheet.py @@ -78,7 +78,7 @@ class report_balancesheet_horizontal(rml_parse.rml_parse, common_report_header): db_pool = pooler.get_pool(self.cr.dbname) #Getting Profit or Loss Balance from profit and Loss report - result_pl=self.obj_pl.get_data(data) + result_pl = self.obj_pl.get_data(data) self.res_bl = self.obj_pl.final_result() type_pool = db_pool.get('account.account.type') diff --git a/addons/account/report/account_general_journal.py b/addons/account/report/account_general_journal.py index 8cd3dad05ba..684a75b1f20 100644 --- a/addons/account/report/account_general_journal.py +++ b/addons/account/report/account_general_journal.py @@ -86,7 +86,7 @@ class journal_print(report_sxw.rml_parse, common_report_header): 'FROM account_move_line l ' 'LEFT JOIN account_journal j ON (l.journal_id=j.id) ' 'LEFT JOIN res_currency c on (l.currency_id=c.id)' - 'WHERE period_id=%s AND journal_id IN %s ' + self.query_get_clause + '' + 'WHERE period_id=%s AND journal_id IN %s ' + self.query_get_clause + ' ' 'GROUP BY j.id, j.code, j.name, l.amount_currency,c.code, l.currency_id ', (period_id, tuple(self.journal_ids))) return self.cr.dictfetchall() diff --git a/addons/account/report/tax_report.py b/addons/account/report/tax_report.py index 15607a79011..a89335f99c5 100644 --- a/addons/account/report/tax_report.py +++ b/addons/account/report/tax_report.py @@ -212,10 +212,8 @@ class tax_report(rml_parse.rml_parse): result_accounts.append(account_elem) ind+=1 - return result_accounts - report_sxw.report_sxw('report.account.vat.declaration', 'account.tax.code', 'addons/account/report/tax_report.rml', parser=tax_report, header="internal") diff --git a/addons/account/report/voucher_print.rml b/addons/account/report/voucher_print.rml index abfa714aa43..b1d7941068c 100644 --- a/addons/account/report/voucher_print.rml +++ b/addons/account/report/voucher_print.rml @@ -325,7 +325,7 @@ - [[ voucher.line_id and voucher.line_id.name and voucher.line_id.name[1] or removeParentNode('para') ]] + [[ voucher.line_id and voucher.line_id[0].name or removeParentNode('para') ]] diff --git a/addons/account/test/account_report.yml b/addons/account/test/account_report.yml new file mode 100644 index 00000000000..44899ec1d8d --- /dev/null +++ b/addons/account/test/account_report.yml @@ -0,0 +1,385 @@ +- + In order to test the PDF reports defined on an invoice, we will print an invoice +- + !python {model: account.invoice}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.account.invoice').create(cr, uid, [ref('account.test_invoice_1')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'account-invoice.'+format), 'wb+').write(data) + +- + 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 + (data, format) = netsvc.LocalService('report.account.overdue').create(cr, uid, [ref('base.res_partner_asus'),ref('base.res_partner_agrolait'),ref('base.res_partner_c2c')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'account-report_overdue.'+format), 'wb+').write(data) + +- + In order to test the PDF reports defined on Account Move, we will print the Voucher Report +- + !python {model: account.move}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.account.move.voucher').create(cr, uid, [ref('account.account_move_0')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'account-voucher-report.'+format), 'wb+').write(data) + +#- +# Demo data for Account tax code +#- +# !record {model: account.tax.code, id: account_tax_code_0}: +# name : Tax Code Test +#- +# Print Tax Code entries report +#- +# !python {model: account.tax.code}: | +# import netsvc, tools, os +# (data, format) = netsvc.LocalService('report.account.tax.code.entries').create(cr, uid, [ref('account.account_tax_code_0')], {}, {}) +# if tools.config['test_report_directory']: +# file(os.path.join(tools.config['test_report_directory'], 'account-tax-code-entries.'+format), 'wb+').write(data) + +#- +# Print Vat Declaration Report +#- +# !python {model: account.tax.code}: | +# import netsvc, tools, os +# data_dict = {'model': 'ir.ui.menu', 'form': {'based_on': 'invoices','company_id':ref('base.main_company'),'periods':[]}} +# (data, format) = netsvc.LocalService('report.account.vat.declaration').create(cr, uid, [ref("account.account_tax_code0")], data_dict, {}) +# if tools.config['test_report_directory']: +# file(os.path.join(tools.config['test_report_directory'], 'account-vat-declaration.'+format), 'wb+').write(data) +- + In order to test the PDF reports defined on an invoice, we will print an invoice +- + !python {model: account.invoice}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.account.invoice').create(cr, uid, [ref('account.test_invoice_1')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'account-invoice.'+format), 'wb+').write(data) + +- + Print the Aged Partner Balance Report +- + !python {model: res.partner}: | + import netsvc, tools, os, time + import datetime + from mx.DateTime import * + start = datetime.date.fromtimestamp(time.mktime(time.strptime(time.strftime('%Y-%m-%d'), "%Y-%m-%d"))) + start = DateTime(int(start.year), int(start.month), int(start.day)) + res = {} + for i in range(5)[::-1]: + stop = start - RelativeDateTime(days=30) + res[str(i)] = { + 'name': (i!=0 and (str((5-(i+1)) * 30) + '-' + str((5-i) * 30)) or ('+'+str(4 * 30))), + 'stop': start.strftime('%Y-%m-%d'), + 'start': (i!=0 and stop.strftime('%Y-%m-%d') or False), + } + start = stop - RelativeDateTime(days=1) + obj_move = self.pool.get('account.move.line') + ctx = {} + fy_id = ref('account.data_fiscalyear') + period_list = self.pool.get('account.period').search(cr, uid, [('fiscalyear_id', 'in', [fy_id])], context=context) + 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['fiscalyear'] = fy_id + ctx['journal_ids'] = journal_ids + ctx['chart_account_id'] = ref('account.chart0') + + query_line = obj_move._query_get(cr, uid, obj='l', context=ctx) + + data_dict = {'model': 'ir.ui.menu', 'form': {'chart_account_id':ref('account.chart0'),'initial_balance': 1, 'periods': period_list,'journal_ids':journal_ids, 'page_split': 0, 'date_from': time.strftime('%Y-%m-%d'), 'period_length': 30, 'amount_currency': 0,'query_line' : query_line, 'result_selection': 'customer','direction_selection': 'past','fiscalyear_id':fy_id}} + data_dict['form'].update(res) + (data, format) = netsvc.LocalService('report.account.aged_trial_balance').create(cr, uid, [], data_dict, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'account-aged_partner_balance.'+format), 'wb+').write(data) + +- + Print the Compare Account Balance Report in Normal mode +- + !python {model: account.account}: | + import netsvc, tools, os, time + data_dict = {'model': 'account.account', 'form': {'id':ref('account.bal'),'chart_account_id':ref('account.chart0'),'select_account': False,'format_perc':0,'show_columns' :0, 'compare_pattern': 'none','account_choice': 'moves','landscape':0,'period_manner': 'actual','fiscalyear': [ref('account.data_fiscalyear')] ,'target_move': 'all','periods': [],'context':{'state':'all'}}} + (data, format) = netsvc.LocalService('report.account.balance.account.balance').create(cr, uid, [ref('account.bal'),ref('account.gpf')], data_dict, {'periods': []}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'account-compare-account_balance.'+format), 'wb+').write(data) + +- + Print the Compare Account Balance Report in Landscape mode +- + !python {model: account.account}: | + import netsvc, tools, os, time + data_dict = {'model': 'account.account', 'form': {'id':ref('account.bal'),'chart_account_id':ref('account.chart0'),'select_account': False,'format_perc':0,'show_columns' :0, 'compare_pattern': 'none','account_choice': 'moves','landscape':1,'period_manner': 'actual','fiscalyear': [ref('account.data_fiscalyear')] ,'target_move': 'all','periods': [],'context':{'state':'all'}}} + (data, format) = netsvc.LocalService('report.account.account.balance.landscape').create(cr, uid, [ref('account.bal'),ref('account.gpf')], data_dict, {'periods': []}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'account-compare-account_balance-landscape.'+format), 'wb+').write(data) + + +- + Print the Account Balance Sheet in Horizontal mode +- + !python {model: account.account}: | + import netsvc, tools, os, time + data_dict = {'model': 'ir.ui.menu', 'form': {'reserve_account_id':ref('account.rsa') ,'chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','display_type': 1,'journal_ids':[],'fiscalyear': ref('account.data_fiscalyear') ,'target_move': 'all'}} + (data, format) = netsvc.LocalService('report.account.balancesheet.horizontal').create(cr, uid, [], data_dict, {'periods': []}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'account-account_balance_sheet_horizontal.'+format), 'wb+').write(data) + +- + Print the Account Balance Sheet in Normal mode +- + !python {model: account.account}: | + import netsvc, tools, os, time + data_dict = {'model': 'ir.ui.menu', 'form': {'reserve_account_id':ref('account.rsa') ,'chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','display_type': 0,'journal_ids':[],'fiscalyear': ref('account.data_fiscalyear') ,'target_move': 'all'}} + (data, format) = netsvc.LocalService('report.account.balancesheet').create(cr, uid, [], data_dict, {'periods': []}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'account-account_balance_sheet.'+format), 'wb+').write(data) + +- + Print the Account Balance Report in Normal mode - From Account Chart +- + !python {model: account.account}: | + import netsvc, tools, os, time + data_dict = {'model': 'account.account', 'form': {'chart_account_id':ref('account.chart0'),'select_account': False,'display_account':'bal_all','format_perc':0,'filter': 'filter_no','show_columns' :0, 'account_choice': 'moves','landscape':0,'period_manner': 'actual','fiscalyear_id': ref('account.data_fiscalyear') ,'target_move': 'all','periods': [],'id':ref('account.bal'),'context':{'state':'all'}}} + (data, format) = netsvc.LocalService('report.account.account.balance').create(cr, uid, [ref('account.bal'),ref('account.gpf')], data_dict, {'periods': []}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'account-account_balance-normal.'+format), 'wb+').write(data) + print "Account Balance Report in Normal mode - From Menu" + + data_dict.update({'model': 'ir.ui.menu'}) + data_dict['form'].update({'active_ids':[ref('account.bal'),ref('account.gpf')]}) + + (data, format) = netsvc.LocalService('report.account.account.balance').create(cr, uid, [], data_dict, {'periods': []}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'account-account_balance-normal-menu.'+format), 'wb+').write(data) + +- + Print the Central Journal Report - From Account +- + !python {model: account.journal.period}: | + import netsvc, tools, os, time + fy_id = ref('account.data_fiscalyear') + period_list = self.pool.get('account.period').search(cr, uid, [('fiscalyear_id', 'in', [fy_id])], context=context) + 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')] + journal_period_ids = self.pool.get('account.journal.period').search(cr, uid, [('journal_id', 'in', journal_ids), ('period_id', 'in', period_list)], context=context) + + obj_move = self.pool.get('account.move.line') + ctx = {} + ctx['fiscalyear'] = fy_id + ctx['journal_ids'] = journal_ids + ctx['chart_account_id'] = ref('account.chart0') + + query_line = obj_move._query_get(cr, uid, obj='l', context=ctx) + data_dict = {'model': 'account.journal.period', 'id':journal_period_ids[0], 'form': {'chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','amount_currency': 0,'compare_pattern': 'none','account_choice': 'moves','landscape':0,'period_manner': 'actual','fiscalyear_id': fy_id ,'query_line':query_line,'target_move': 'all','periods': period_list,'journal_ids':journal_ids,'id':ref('account.bal') }} + (data, format) = netsvc.LocalService('report.account.central.journal').create(cr, uid, journal_period_ids, data_dict, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'account-central_journal.'+format), 'wb+').write(data) + + print "Central Journal Report - From Menu" + data_dict.update({'model': 'ir.ui.menu'}) + data_dict['form'].update({'active_ids':journal_period_ids}) + + (data, format) = netsvc.LocalService('report.account.central.journal').create(cr, uid, [], data_dict, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'account-central_journal-menu.'+format), 'wb+').write(data) +- + Print the General Journal Report - From Journal +- + !python {model: account.journal.period}: | + import netsvc, tools, os, time + fy_id = ref('account.data_fiscalyear') + period_list = self.pool.get('account.period').search(cr, uid, [('fiscalyear_id', 'in', [fy_id])], context=context) + 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')] + journal_period_ids = self.pool.get('account.journal.period').search(cr, uid, [('journal_id', 'in', journal_ids), ('period_id', 'in', period_list)], context=context) + + obj_move = self.pool.get('account.move.line') + ctx = {} + ctx['fiscalyear'] = fy_id + ctx['journal_ids'] = journal_ids + ctx['chart_account_id'] = ref('account.chart0') + + query_line = obj_move._query_get(cr, uid, obj='l', context=ctx) + data_dict = {'model': 'ir.ui.menu','id':journal_period_ids[0], 'form': {'chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','amount_currency': 0,'compare_pattern': 'none','account_choice': 'moves','landscape':0,'period_manner': 'actual','fiscalyear_id': fy_id ,'query_line':query_line,'target_move': 'all','periods': period_list,'journal_ids':journal_ids, 'active_ids':journal_period_ids}} + (data, format) = netsvc.LocalService('report.account.general.journal').create(cr, uid, journal_period_ids, data_dict, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'account-general_journal.'+format), 'wb+').write(data) + +- + Print the General Ledger Report in Normal Mode +- + !python {model: account.account}: | + import netsvc, tools, os, time + fy_id = ref('account.data_fiscalyear') + period_list = self.pool.get('account.period').search(cr, uid, [('fiscalyear_id', 'in', [fy_id])], context=context) + 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')] + acc_ids = [ref('account.bal'),ref('account.gpf')] + + obj_move = self.pool.get('account.move.line') + ctx = {} + ctx['fiscalyear'] = fy_id + ctx['journal_ids'] = journal_ids + ctx['chart_account_id'] = ref('account.chart0') + + query_line = obj_move._query_get(cr, uid, obj='l', context=ctx) + + data_dict = {'model': 'account.account', 'form': {'initial_balance': 1,'initial_bal_query': query_line,'chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','sortby': 'sort_date','amount_currency': 0,'landscape':0,'period_manner': 'actual','fiscalyear_id': fy_id ,'query_line':query_line,'target_move': 'all','periods': period_list,'journal_ids':journal_ids,'id':ref('account.bal') }} + (data, format) = netsvc.LocalService('report.account.general.ledger').create(cr, uid, acc_ids, data_dict, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'account-general_ledger.'+format), 'wb+').write(data) + + print "GL report from menu" + data_dict.update({'model': 'ir.ui.menu'}) + data_dict['form'].update({'active_ids': acc_ids}) + (data, format) = netsvc.LocalService('report.account.general.ledger').create(cr, uid, [], data_dict, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'account-general_ledger-menu.'+format), 'wb+').write(data) +- + Print the General Ledger Report in Landscape Mode +- + !python {model: account.account}: | + import netsvc, tools, os, time + fy_id = ref('account.data_fiscalyear') + period_list = self.pool.get('account.period').search(cr, uid, [('fiscalyear_id', 'in', [fy_id])], context=context) + 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')] + acc_ids = [ref('account.bal'),ref('account.gpf')] + + obj_move = self.pool.get('account.move.line') + ctx = {} + ctx['fiscalyear'] = fy_id + ctx['journal_ids'] = journal_ids + ctx['chart_account_id'] = ref('account.chart0') + + query_line = obj_move._query_get(cr, uid, obj='l', context=ctx) + + data_dict = {'model': 'account.account', 'form': {'initial_balance': 1,'initial_bal_query':query_line,'chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','sortby': 'sort_date','amount_currency': 0,'landscape':1,'period_manner': 'actual','fiscalyear_id': fy_id ,'query_line':query_line,'target_move': 'all','periods': period_list,'journal_ids':journal_ids,'id':ref('account.bal') }} + (data, format) = netsvc.LocalService('report.account.general.ledger_landscape').create(cr, uid, acc_ids, data_dict, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'account-general_ledger-landscape.'+format), 'wb+').write(data) + + print "GL report landscape mode from menu" + data_dict.update({'model': 'ir.ui.menu'}) + data_dict['form'].update({'active_ids': acc_ids}) + (data, format) = netsvc.LocalService('report.account.general.ledger_landscape').create(cr, uid, [], data_dict, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'account-general_ledger-landscape-menu.'+format), 'wb+').write(data) + +- + Print Journal Report - From Model +- + !python {model: account.journal.period}: | + import netsvc, tools, os, time + fy_id = ref('account.data_fiscalyear') + period_list = self.pool.get('account.period').search(cr, uid, [('fiscalyear_id', 'in', [fy_id])], context=context) + 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')] + journal_period_ids = self.pool.get('account.journal.period').search(cr, uid, [('journal_id', 'in', journal_ids), ('period_id', 'in', period_list)], context=context) + + obj_move = self.pool.get('account.move.line') + ctx = {} + ctx['fiscalyear'] = fy_id + ctx['journal_ids'] = journal_ids + ctx['chart_account_id'] = ref('account.chart0') + + query_line = obj_move._query_get(cr, uid, obj='l', context=ctx) + + data_dict = {'model': 'account.journal.period', 'id':journal_period_ids[0], 'form': {'sort_selection': 'date','chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','amount_currency': 0,'compare_pattern': 'none','account_choice': 'moves','landscape':0,'period_manner': 'actual','fiscalyear_id': fy_id ,'query_line':query_line,'target_move': 'all','periods': period_list,'journal_ids':journal_ids,'id':ref('account.bal') }} + (data, format) = netsvc.LocalService('report.account.journal.period.print').create(cr, uid, journal_period_ids, data_dict, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'account-print_journal.'+format), 'wb+').write(data) + + print "Journal Report - From Menu" + data_dict.update({'model': 'ir.ui.menu'}) + data_dict['form'].update({'active_ids':journal_period_ids}) + + (data, format) = netsvc.LocalService('report.account.journal.period.print').create(cr, uid, [], data_dict, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'account-print_journal-menu.'+format), 'wb+').write(data) + +- + Print the Partner Balance Report +- + !python {model: res.partner}: | + import netsvc, tools, os, time + fy_id = ref('account.data_fiscalyear') + period_list = self.pool.get('account.period').search(cr, uid, [('fiscalyear_id', 'in', [fy_id])], context=context) + 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')] + + obj_move = self.pool.get('account.move.line') + ctx = {} + ctx['fiscalyear'] = fy_id + ctx['journal_ids'] = journal_ids + ctx['chart_account_id'] = ref('account.chart0') + + query_line = obj_move._query_get(cr, uid, obj='l', context=ctx) + data_dict = {'model': 'ir.ui.menu', 'form': {'result_selection': 'customer','chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','display_type': 0,'journal_ids':journal_ids,'display_partner': 'non-zero_balance','fiscalyear': fy_id ,'target_move': 'all','query_line':query_line}} + (data, format) = netsvc.LocalService('report.account.partner.balance').create(cr, uid, [], data_dict, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'account-partner_balance.'+format), 'wb+').write(data) + +- + Print the Partner Ledger Report +- + !python {model: res.partner}: | + import netsvc, tools, os, time + fy_id = ref('account.data_fiscalyear') + period_list = self.pool.get('account.period').search(cr, uid, [('fiscalyear_id', 'in', [fy_id])], context=context) + 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')] + + obj_move = self.pool.get('account.move.line') + ctx = {} + ctx['fiscalyear'] = fy_id + ctx['journal_ids'] = journal_ids + ctx['chart_account_id'] = ref('account.chart0') + + query_line = obj_move._query_get(cr, uid, obj='l', context=ctx) + + data_dict = {'model': 'ir.ui.menu', 'form': {'initial_bal_query':query_line,'amount_currency': 0,'reconcil': True,'initial_balance':1,'page_split': True,'result_selection': 'customer','chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','display_type': 0,'journal_ids':journal_ids,'display_partner': 'non-zero_balance','fiscalyear': fy_id ,'target_move': 'all','query_line':query_line}} + (data, format) = netsvc.LocalService('report.account.third_party_ledger').create(cr, uid, [], data_dict, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'account-partner_ledger.'+format), 'wb+').write(data) + +- + Print the Partner Ledger-Other Report +- + !python {model: res.partner}: | + import netsvc, tools, os, time + fy_id = ref('account.data_fiscalyear') + period_list = self.pool.get('account.period').search(cr, uid, [('fiscalyear_id', 'in', [fy_id])], context=context) + 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')] + + obj_move = self.pool.get('account.move.line') + ctx = {} + ctx['fiscalyear'] = fy_id + ctx['journal_ids'] = journal_ids + ctx['chart_account_id'] = ref('account.chart0') + + query_line = obj_move._query_get(cr, uid, obj='l', context=ctx) + data_dict = {'model': 'ir.ui.menu', 'form': {'initial_bal_query':query_line,'amount_currency': 0,'reconcil': True,'initial_balance':1,'page_split': False,'result_selection': 'customer','chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','display_type': 0,'journal_ids':journal_ids,'display_partner': 'non-zero_balance','fiscalyear': fy_id ,'target_move': 'all','query_line':query_line}} + (data, format) = netsvc.LocalService('report.account.third_party_ledger_other').create(cr, uid, [], data_dict, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'account-partner_ledger-other.'+format), 'wb+').write(data) + +- + Print the Profit-Loss Report in Normal Mode +- + !python {model: account.account}: | + import netsvc, tools, os, time + fy_id = ref('account.data_fiscalyear') + period_list = self.pool.get('account.period').search(cr, uid, [('fiscalyear_id', 'in', [fy_id])], context=context) + journal_ids = [] + acc_ids = [ref('account.bal'),ref('account.gpf')] + data_dict = {'model': 'ir.ui.menu', 'form': {'display_type': False,'chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','amount_currency': 0,'landscape':0,'period_manner': 'actual','fiscalyear_id': fy_id ,'query_line':'True ','target_move': 'all','periods': period_list,'journal_ids':journal_ids,'id':ref('account.bal'),'active_ids':acc_ids }} + (data, format) = netsvc.LocalService('report.pl.account').create(cr, uid, [], data_dict, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'account-profit-loss.'+format), 'wb+').write(data) + +- + Print the Profit-Loss Report in Horizontal Mode +- + !python {model: account.account}: | + import netsvc, tools, os, time + fy_id = ref('account.data_fiscalyear') + period_list = self.pool.get('account.period').search(cr, uid, [('fiscalyear_id', 'in', [fy_id])], context=context) + journal_ids = [] + acc_ids = [ref('account.bal'),ref('account.gpf')] + data_dict = {'model': 'ir.ui.menu', 'form': {'display_type': True,'chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','amount_currency': 0,'landscape':0,'period_manner': 'actual','fiscalyear_id': fy_id ,'query_line':'True ','target_move': 'all','periods': period_list,'journal_ids':journal_ids,'id':ref('account.bal'),'active_ids':acc_ids }} + (data, format) = netsvc.LocalService('report.pl.account.horizontal').create(cr, uid, [], data_dict, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'account-profit-loss-horizontal.'+format), 'wb+').write(data) diff --git a/addons/account/wizard/account_report_balance_sheet_view.xml b/addons/account/wizard/account_report_balance_sheet_view.xml index 708b146ce96..e61ad6f46d5 100644 --- a/addons/account/wizard/account_report_balance_sheet_view.xml +++ b/addons/account/wizard/account_report_balance_sheet_view.xml @@ -12,6 +12,7 @@ + diff --git a/addons/account_analytic_plans/__openerp__.py b/addons/account_analytic_plans/__openerp__.py index 0c3d1d07370..6e00c6b587d 100644 --- a/addons/account_analytic_plans/__openerp__.py +++ b/addons/account_analytic_plans/__openerp__.py @@ -66,6 +66,7 @@ of distribution models. 'wizard/account_crossovered_analytic_view.xml' ], 'demo_xml' : [], + 'test' : ['test/acount_analytic_plans_report.yml'], 'installable': True, 'active' : False, 'certificate': '0036417675373', diff --git a/addons/account_analytic_plans/report/crossovered_analytic.py b/addons/account_analytic_plans/report/crossovered_analytic.py index e064ddc148b..f8a975a4c25 100644 --- a/addons/account_analytic_plans/report/crossovered_analytic.py +++ b/addons/account_analytic_plans/report/crossovered_analytic.py @@ -96,17 +96,19 @@ class crossovered_analytic(report_sxw.rml_parse): self.final_list = children_list selected_ids = line_pool.search(self.cr,self.uid,[('account_id','in',self.final_list)]) + if selected_ids: + query="SELECT sum(aal.amount) AS amt, sum(aal.unit_amount) AS qty FROM account_analytic_line AS aal, account_analytic_account AS aaa \ + WHERE aal.account_id=aaa.id AND aal.id IN ("+','.join(map(str,selected_ids))+") AND (aal.journal_id " + journal +") AND aal.date>='"+ str(form['date1']) +"'"" AND aal.date<='" + str(form['date2']) + "'" + + self.cr.execute(query) + info=self.cr.dictfetchall() - query="SELECT sum(aal.amount) AS amt, sum(aal.unit_amount) AS qty FROM account_analytic_line AS aal, account_analytic_account AS aaa \ - WHERE aal.account_id=aaa.id AND aal.id IN ("+','.join(map(str,selected_ids))+") AND (aal.journal_id " + journal +") AND aal.date>='"+ str(form['date1']) +"'"" AND aal.date<='" + str(form['date2']) + "'" - - self.cr.execute(query) - info=self.cr.dictfetchall() - - res['ref_qty']=info[0]['qty'] - res['ref_amt']=info[0]['amt'] - self.base_amount= info[0]['amt'] - + res['ref_qty']=info[0]['qty'] + res['ref_amt']=info[0]['amt'] + self.base_amount= info[0]['amt'] + res['ref_qty']=0.0 + res['ref_amt']=0.0 + self.base_amount= 0.0 result.append(res) return result diff --git a/addons/account_analytic_plans/test/acount_analytic_plans_report.yml b/addons/account_analytic_plans/test/acount_analytic_plans_report.yml new file mode 100644 index 00000000000..debeba7daa0 --- /dev/null +++ b/addons/account_analytic_plans/test/acount_analytic_plans_report.yml @@ -0,0 +1,9 @@ +- + Print the Cross Overed Report in Normal mode +- + !python {model: account.analytic.account}: | + import netsvc, tools, os, time + 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']: + file(os.path.join(tools.config['test_report_directory'], 'account_analytic_plans-crossovered_analyitic.'+format), 'wb+').write(data) \ No newline at end of file diff --git a/addons/account_budget/__openerp__.py b/addons/account_budget/__openerp__.py index f47e4685246..5d6d8da0def 100644 --- a/addons/account_budget/__openerp__.py +++ b/addons/account_budget/__openerp__.py @@ -63,6 +63,7 @@ Three reports are available: 'demo_xml': ['crossovered_budget_demo.xml'], 'test':[ 'test/account_budget.yml', + 'test/account_budget_report.yml', ], 'installable': True, 'active': False, diff --git a/addons/account_budget/test/account_budget_report.yml b/addons/account_budget/test/account_budget_report.yml new file mode 100644 index 00000000000..fa086e24a64 --- /dev/null +++ b/addons/account_budget/test/account_budget_report.yml @@ -0,0 +1,27 @@ +- + Print the Analytic Budget Report in Normal mode +- + !python {model: account.analytic.account}: | + import netsvc, tools, os, time + data_dict = {'model': 'account.analytic.account', 'form': {'date1':time.strftime("%Y-01-01"),'date2':time.strftime('%Y-%m-%d'),'id':ref('account.analytic_root'),'context':{}}} + (data, format) = netsvc.LocalService('report.account.analytic.account.budget').create(cr, uid, [ref('account.analytic_root')], data_dict, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'account_budget-analytic_budget_report.'+format), 'wb+').write(data) +- + Print the Budget Report in Normal mode +- + !python {model: account.budget.post}: | + import netsvc, tools, os, time + data_dict = {'model': 'account.budget.post', 'form': {'date1':time.strftime("%Y-01-01"),'date2':time.strftime('%Y-%m-%d'),'id':ref('account_budget.account_budget_post_sales0'),'context':{}}} + (data, format) = netsvc.LocalService('report.account.analytic.account.budget').create(cr, uid, [ref('account_budget.account_budget_post_sales0')], data_dict, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'account_budget-budget_report.'+format), 'wb+').write(data) +- + Print the Cross Overed Budget Report in Normal mode +- + !python {model: crossovered.budget}: | + import netsvc, tools, os, time + data_dict = {'model': 'account.budget.post', 'form': {'date_from':time.strftime("%Y-01-01"),'date_to':time.strftime('%Y-%m-%d'),'report':'analytic-full','id':ref('account_budget.crossovered_budget_budgetoptimistic0'),'context':{}}} + (data, format) = netsvc.LocalService('report.crossovered.budget.report').create(cr, uid, [ref('account_budget.crossovered_budget_budgetoptimistic0')], data_dict, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'account_budget-crossovered_budget_report.'+format), 'wb+').write(data) \ No newline at end of file diff --git a/addons/account_budget/wizard/account_budget_crossovered_report.py b/addons/account_budget/wizard/account_budget_crossovered_report.py index 9a700e90ebb..2862cd1db48 100644 --- a/addons/account_budget/wizard/account_budget_crossovered_report.py +++ b/addons/account_budget/wizard/account_budget_crossovered_report.py @@ -42,7 +42,7 @@ class account_budget_crossvered_report(osv.osv_memory): data = self.read(cr, uid, ids)[0] datas = { 'ids': context.get('active_ids',[]), - 'model': 'crossovered.budge', + 'model': 'crossovered.budget', 'form': data } datas['form']['report']='analytic-full' diff --git a/addons/account_invoice_layout/__openerp__.py b/addons/account_invoice_layout/__openerp__.py index 77a6e428de6..36eeb41b137 100644 --- a/addons/account_invoice_layout/__openerp__.py +++ b/addons/account_invoice_layout/__openerp__.py @@ -45,7 +45,8 @@ 'account_invoice_layout_report.xml', 'wizard/account_invoice_special_message.xml', ], - 'demo_xml': [], + 'demo_xml': ['account_invoice_layout_demo.xml'], + 'test':['test/account_invoice_layout_report.yml'], 'installable': True, 'active': False, 'certificate': '0057235078173', diff --git a/addons/account_invoice_layout/account_invoice_layout_demo.xml b/addons/account_invoice_layout/account_invoice_layout_demo.xml new file mode 100644 index 00000000000..cb8df67d997 --- /dev/null +++ b/addons/account_invoice_layout/account_invoice_layout_demo.xml @@ -0,0 +1,14 @@ + + + + + + OpenERP SA + ERP & CRM Solutions.... + + + Tiny sprl + Be Expert with the Experts... + + + \ No newline at end of file diff --git a/addons/account_invoice_layout/report/report_account_invoice_layout.rml b/addons/account_invoice_layout/report/report_account_invoice_layout.rml index 77781c4191d..8f7d5f561e8 100644 --- a/addons/account_invoice_layout/report/report_account_invoice_layout.rml +++ b/addons/account_invoice_layout/report/report_account_invoice_layout.rml @@ -297,7 +297,7 @@ - Note: [[ (a['note'] and format(a['note'])) or removeParentNode('tr') ]] + Note: [[ (a['note'] and format(a['note'] or '')) or removeParentNode('tr') ]] @@ -337,7 +337,7 @@ - [[ a['type']=='text' and format(a['name']) or removeParentNode('blockTable') ]] + [[ a['type']=='text' and format(a['name'] or '') or removeParentNode('blockTable') ]] [[ a['type']=='text' and '' ]] @@ -467,7 +467,7 @@ - [[ format(o.comment or removeParentNode('blockTable')) ]] + [[ format(o.comment or '') or removeParentNode('blockTable') ]] @@ -477,7 +477,7 @@ - [[ format((o.payment_term and o.payment_term.note) or removeParentNode('blockTable')) ]] + [[ format((o.payment_term and o.payment_term.note or '') or removeParentNode('blockTable')) ]] diff --git a/addons/account_invoice_layout/test/account_invoice_layout_report.yml b/addons/account_invoice_layout/test/account_invoice_layout_report.yml new file mode 100644 index 00000000000..b7b1c1e76cc --- /dev/null +++ b/addons/account_invoice_layout/test/account_invoice_layout_report.yml @@ -0,0 +1,17 @@ +- + Print the Invoice layout report in Normal Mode +- + !python {model: account.invoice}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.account.invoice.layout').create(cr, uid, [ref('account.test_invoice_1')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'account_invoice_layout.'+format), 'wb+').write(data) +- + Print the Invoice Layout Report with Message in Normal mode +- + !python {model: account.invoice}: | + import netsvc, tools, os, time + data_dict = {'model': 'account.invoice', 'form': {'message':ref('account_invoice_layout.demo_message1'),'id':ref('account.test_invoice_1'),'context':{}}} + (data, format) = netsvc.LocalService('report.notify_account.invoice').create(cr, uid, [ref('account.test_invoice_1')], data_dict, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'account_invoice_layout_message_report.'+format), 'wb+').write(data) \ No newline at end of file diff --git a/addons/account_payment/__openerp__.py b/addons/account_payment/__openerp__.py index f3e437face2..5114a576512 100644 --- a/addons/account_payment/__openerp__.py +++ b/addons/account_payment/__openerp__.py @@ -47,8 +47,11 @@ 'account_invoice_view.xml', 'account_payment_report.xml', ], - 'demo_xml': [], - 'test': ['test/account_payment.yml'], + 'demo_xml': ['account_payment_demo.xml'], + 'test': [ + 'test/account_payment.yml' + 'test/account_payment_report.yml' + ], 'installable': True, 'active': False, 'certificate': '0061703998541', diff --git a/addons/account_payment/account_payment_demo.xml b/addons/account_payment/account_payment_demo.xml new file mode 100644 index 00000000000..25fe4a2c55b --- /dev/null +++ b/addons/account_payment/account_payment_demo.xml @@ -0,0 +1,24 @@ + + + + + Reserve Bank + 00987654321 + + + + + Direct Payment + + + + + + ORDER1 + + + now + draft + + + diff --git a/addons/account_payment/test/account_payment_report.yml b/addons/account_payment/test/account_payment_report.yml new file mode 100644 index 00000000000..45022e19a73 --- /dev/null +++ b/addons/account_payment/test/account_payment_report.yml @@ -0,0 +1,8 @@ +- + In order to test the PDF reports defined on Account Payment, Print a Payment Order +- + !python {model: payment.order}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.payment.order').create(cr, uid, [ref('account_payment.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) \ No newline at end of file diff --git a/addons/account_report/__openerp__.py b/addons/account_report/__openerp__.py index 07afc6ed58f..b8029bf3563 100644 --- a/addons/account_report/__openerp__.py +++ b/addons/account_report/__openerp__.py @@ -42,7 +42,8 @@ 'wizard/account_report_print_indicators_with_pdf_view.xml', 'board_account_report_view.xml', ], - 'demo_xml': [], + 'demo_xml': ['account_report_demo.xml'], + 'test': ['test/account_report.yml'], 'installable': True, 'active': False, 'certificate': '0050976406925', diff --git a/addons/account_report/account_report_demo.xml b/addons/account_report/account_report_demo.xml new file mode 100644 index 00000000000..30f1318c592 --- /dev/null +++ b/addons/account_report/account_report_demo.xml @@ -0,0 +1,11 @@ + + + + + Account Demo Report + ADR + fiscal + debit>0.0 + + + \ No newline at end of file diff --git a/addons/account_report/report/print_indicator.rml b/addons/account_report/report/print_indicator.rml index 52133cb894e..160cd435ada 100644 --- a/addons/account_report/report/print_indicator.rml +++ b/addons/account_report/report/print_indicator.rml @@ -119,7 +119,7 @@ - [['..........'*(o['level']) ]] [[ format(o['note']) or removeParentNode('blockTable') ]] + [['..........'*(o['level']) ]] [[ format(o['note'] or '') or removeParentNode('blockTable') ]] diff --git a/addons/account_report/test/account_report_report.yml b/addons/account_report/test/account_report_report.yml new file mode 100644 index 00000000000..d94dce1f553 --- /dev/null +++ b/addons/account_report/test/account_report_report.yml @@ -0,0 +1,17 @@ +- + In order to test the PDF reports defined on Account, Print a Financial Statement Report +- + !python {model: account.report.report}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.accounting.report').create(cr, uid, [ref('account_report.account_report_1')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'account_report-financial_statement_report.'+format), 'wb+').write(data) +- + Print the Indicators Report in Normal mode +- + !python {model: account.report.history }: | + import netsvc, tools, os, time + data_dict = {'model': 'ir.ui.menu', 'form': {'select_base':'year','base_selection':[ref('account.data_fiscalyear')],'context':{}}} + (data, format) = netsvc.LocalService('report.print.indicators').create(cr, uid, [], data_dict, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'account_report-indicators_report.'+format), 'wb+').write(data) \ No newline at end of file diff --git a/addons/account_reporting/__openerp__.py b/addons/account_reporting/__openerp__.py index 5ac93d17984..fb05e755ac2 100644 --- a/addons/account_reporting/__openerp__.py +++ b/addons/account_reporting/__openerp__.py @@ -36,7 +36,8 @@ 'account_data.xml', 'wizard/account_reporting_balance_report_view.xml', ], - 'demo_xml': [], + 'demo_xml': ['account_reporting_demo.xml'], + 'test': ['test/account_reporting_report.yml'], 'installable': True, 'active': False, 'certificate': '0072305016797', diff --git a/addons/account_reporting/account_reporting_demo.xml b/addons/account_reporting/account_reporting_demo.xml new file mode 100644 index 00000000000..880fa51deda --- /dev/null +++ b/addons/account_reporting/account_reporting_demo.xml @@ -0,0 +1,9 @@ + + + + + My Balance Sheet + MBS + + + \ No newline at end of file diff --git a/addons/account_reporting/test/account_reporting_report.yml b/addons/account_reporting/test/account_reporting_report.yml new file mode 100644 index 00000000000..9754f53cc4d --- /dev/null +++ b/addons/account_reporting/test/account_reporting_report.yml @@ -0,0 +1,9 @@ +- + Print the Balance Sheet Report in Normal mode +- + !python {model: account.report.bs }: | + import netsvc, tools, os, time + data_dict = {'model': 'account.report.bs', 'form': {'fiscalyear':ref('account.data_fiscalyear'),'periods':[ref('account.period_1'),ref('account.period_2'),ref('account.period_3')],'context':{}}} + (data, format) = netsvc.LocalService('report.account.report.bs').create(cr, uid, [ref('account_reporting.account_balance_sheet_1')], data_dict, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'account_reporting-balance_sheet_report.'+format), 'wb+').write(data) \ No newline at end of file diff --git a/addons/auction/__openerp__.py b/addons/auction/__openerp__.py index 69fef0748c4..7105102b385 100644 --- a/addons/auction/__openerp__.py +++ b/addons/auction/__openerp__.py @@ -59,7 +59,9 @@ ], 'demo_xml': ['auction_demo.xml','board_auction_demo.xml'], - 'test': ['test/auction.yml'], + 'test': ['test/auction.yml', + 'test/auction_report.yml', + ], 'installable': True, 'active': False, diff --git a/addons/auction/test/auction_report.yml b/addons/auction/test/auction_report.yml new file mode 100644 index 00000000000..4d5110c03a1 --- /dev/null +++ b/addons/auction/test/auction_report.yml @@ -0,0 +1,92 @@ +- + In order to test the PDF reports defined on auction, we will print a auction artist +- + !python {model: auction.lots}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.auction.artists').create(cr, uid, [ref('auction.auction_deposit_1_lot_1'),ref('auction.auction_deposit_1_lot_2')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'action_artist_report.'+format), 'wb+').write(data) + +- + In order to test the PDF reports defined on auction, we will print a auction Bid +- + !python {model: auction.bid}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.auction.bids').create(cr, uid, [ref('auction.auction_date_1_bid_3'),ref('auction.auction_date_1_bid_4')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'action_bid_report.'+format), 'wb+').write(data) + +- + In order to test the PDF reports defined on auction, we will print a lots list Report +- + !python {model: auction.lots}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.lots.list').create(cr, uid, [ref('auction.auction_deposit_3_lot_1'),ref('auction.auction_deposit_3_lot_2')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'lots_list_report.'+format), 'wb+').write(data) +- + In order to test the PDF reports defined on auction, we will print a lots inventory Report +- + !python {model: auction.lots}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.lots.list.inventory').create(cr, uid, [ref('auction.auction_deposit_4_lot_1'),ref('auction.auction_deposit_4_lot_2')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'lots_inventory_report.'+format), 'wb+').write(data) +- + In order to test the PDF reports defined on auction, we will print a deposit seller Report +- + !python {model: auction.lots}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.deposit.seller').create(cr, uid, [ref('auction.auction_deposit_5_lot_1'),ref('auction.auction_deposit_5_lot_2')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'deposit_seller_report.'+format), 'wb+').write(data) +- + In order to test the PDF reports defined on auction, we will print a catalog +- + !python {model: auction.dates}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.auction.cat_flagy').create(cr, uid, [ref('auction.auction_date_1'),ref('auction.auction_date_2')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'auction-catalog_list.'+format), 'wb+').write(data) +- + In order to test the PDF reports defined on auction, we will print buyer form report +- + !python {model: auction.lots}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.buyer_form_report').create(cr, uid, [ref('auction.auction_deposit_6_lot_1'),ref('auction.auction_deposit_6_lot_2')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'auction-buyer_form.'+format), 'wb+').write(data) +- + In order to test the PDF reports defined on auction, we will print bids phones report +- + !python {model: auction.lots}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.bids.phones.details').create(cr, uid, [ref('auction.auction_deposit_7_lot_1'),ref('auction.auction_deposit_7_lot_2')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'auction-bids_phones_details.'+format), 'wb+').write(data) +- + In order to test the PDF reports defined on a auction, we will print a Auction Total +- + !python {model: auction.lots}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.auction.total.rml').create(cr, uid, [ref('auction.auction_deposit_8_lot_1'),ref('auction.auction_deposit_8_lot_2')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'action_total_report.'+format), 'wb+').write(data) + +- + In order to test the PDF reports defined on a auction, we will print a Auction Result +- + !python {model: auction.lots}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.auction.result').create(cr, uid, [ref('auction.auction_deposit_9_lot_1'),ref('auction.auction_deposit_9_lot_2')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'action_result_report.'+format), 'wb+').write(data) + +- + In order to test the PDF reports defined on a auction, we will print a Auction Lot +- + !python {model: auction.lots}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.bids.lots').create(cr, uid, [ref('auction.auction_deposit_10_lot_1'),ref('auction.auction_deposit_10_lot_2')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'action_lot_report.'+format), 'wb+').write(data) \ No newline at end of file diff --git a/addons/base_module_doc_rst/__terp__.py b/addons/base_module_doc_rst/__openerp__.py similarity index 100% rename from addons/base_module_doc_rst/__terp__.py rename to addons/base_module_doc_rst/__openerp__.py diff --git a/addons/delivery/__openerp__.py b/addons/delivery/__openerp__.py index 193bd0bcaee..ad88d552e6b 100644 --- a/addons/delivery/__openerp__.py +++ b/addons/delivery/__openerp__.py @@ -40,7 +40,7 @@ 'partner_view.xml' ], 'demo_xml': ['delivery_demo.xml'], - 'test':['test/delivery_test.yml',], + 'test':['test/delivery_test.yml','test/delivery_report.yml'], 'installable': True, 'active': False, 'certificate': '0033981912253', diff --git a/addons/delivery/test/delivery_report.yml b/addons/delivery/test/delivery_report.yml new file mode 100644 index 00000000000..ed3a859f23d --- /dev/null +++ b/addons/delivery/test/delivery_report.yml @@ -0,0 +1,8 @@ +- + In order to test the PDF reports defined on a Delievry, we will print a Delivery Order report +- + !python {model: stock.picking}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.sale.shipping').create(cr, uid, [ref('stock.stock_picking_1')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'delievry-shipping'+format), 'wb+').write(data) diff --git a/addons/hr_attendance/__openerp__.py b/addons/hr_attendance/__openerp__.py index 5a79566bcde..3714050cbdb 100644 --- a/addons/hr_attendance/__openerp__.py +++ b/addons/hr_attendance/__openerp__.py @@ -43,7 +43,9 @@ 'wizard/hr_attendance_sign_in_out_view.xml', ], 'demo_xml': ['hr_attendance_demo.xml'], - 'test': ['test/test_hr_attendance.yml'], + 'test': ['test/test_hr_attendance.yml', + 'test/hr_attendance_report.yml' + ], 'installable': True, 'active': False, 'certificate': '0063495605613', diff --git a/addons/hr_attendance/test/hr_attendance_report.yml b/addons/hr_attendance/test/hr_attendance_report.yml new file mode 100644 index 00000000000..d26f6ddb9bc --- /dev/null +++ b/addons/hr_attendance/test/hr_attendance_report.yml @@ -0,0 +1,19 @@ +- + In order to test the PDF reports defined on HR Attendance, we will print a report of HR Attendance By Month +- + !python {model: hr.employee}: | + import netsvc, tools, os, time + data_dict = {'model': 'hr.employee', 'form': {'month': time.gmtime()[1], 'year': time.gmtime()[0]}} + (data, format) = netsvc.LocalService('report.hr.attendance.bymonth').create(cr, uid, [ref('hr.employee1'),ref('hr.employee2'),ref('hr.employee3')], data_dict, {'active_ids': [ref('hr.employee1'),ref('hr.employee2'),ref('hr.employee3')]}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'hr_attendance-by_month_report.'+format), 'wb+').write(data) + +- + In order to test the PDF reports defined on HR Attendance, we will print a report of HR Attendance Error +- + !python {model: hr.employee}: | + import netsvc, tools, os, time + data_dict = {'model': 'hr.employee', 'form': {'init_date': time.strftime('%Y-01-01'), 'end_date':time.strftime('%Y-%m-%d'), 'emp_ids': [ref('hr.employee1')], 'max_delay': 120}} + (data, format) = netsvc.LocalService('report.hr.attendance.error').create(cr, uid, [ref('hr.employee1')], data_dict, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'hr_attendance-error_report.'+format), 'wb+').write(data) diff --git a/addons/hr_expense/__openerp__.py b/addons/hr_expense/__openerp__.py index aa45f4aa888..fe06b0110c2 100644 --- a/addons/hr_expense/__openerp__.py +++ b/addons/hr_expense/__openerp__.py @@ -55,7 +55,9 @@ 'demo_xml': [ 'hr_expense_demo.xml', ], - 'test': ['test/test_hr_expense.yml'], + 'test': ['test/test_hr_expense.yml', + 'test/hr_expense_report.yml', + ], 'installable': True, 'active': False, 'certificate': '0062479841789', diff --git a/addons/hr_expense/test/hr_expense_report.yml b/addons/hr_expense/test/hr_expense_report.yml new file mode 100644 index 00000000000..4c81ceb5976 --- /dev/null +++ b/addons/hr_expense/test/hr_expense_report.yml @@ -0,0 +1,8 @@ +- + In order to test the PDF reports defined on a HR Expense, we will print a HR Expense +- + !python {model: hr.expense.expense}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.hr.expense').create(cr, uid, [ref('hr_expense.hr_expense_expense_septemberexpenses0'),ref('hr_expense.hr_expense_expense_septemberexpenses1')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'hr_expense-report.'+format), 'wb+').write(data) \ No newline at end of file diff --git a/addons/hr_holidays/__openerp__.py b/addons/hr_holidays/__openerp__.py index 7d68b216494..e6d901ad02c 100644 --- a/addons/hr_holidays/__openerp__.py +++ b/addons/hr_holidays/__openerp__.py @@ -65,7 +65,9 @@ 'board_hr_holidays_view.xml', ], 'demo_xml': ['hr_holidays_demo.xml',], - 'test': ['test/test_hr_holiday.yml'], + 'test': ['test/test_hr_holiday.yml', + 'test/hr_holidays_report.yml', + ], 'installable': True, 'active': False, 'certificate': '0086579209325', diff --git a/addons/hr_holidays/test/hr_holidays_report.yml b/addons/hr_holidays/test/hr_holidays_report.yml new file mode 100644 index 00000000000..9faf7358b53 --- /dev/null +++ b/addons/hr_holidays/test/hr_holidays_report.yml @@ -0,0 +1,14 @@ +- + In order to test the PDF reports defined on a HR Holidays, we will print HR Holidays +- + !python {model: hr.holidays}: | + import netsvc, tools, os, time + data_dict = {'model': 'ir.ui.menu', 'form': {'date_from': time.strftime('%Y-%m-01'), 'depts' : [ref('hr.dep_sales')],'holiday_type' : 'Validated' }} + (data, format) = netsvc.LocalService('report.holidays.summary').create(cr, uid, [], data_dict, {'active_ids': [ref('hr.employee1'),ref('hr.employee2'),ref('hr.employee3')]}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'hr_holidays-dept_summary_report.'+format), 'wb+').write(data) + + data_dict = {'model': 'hr.employee', 'form': {'date_from': time.strftime('%Y-%m-01'), 'depts' : [ref('hr.dep_sales')],'holiday_type' : 'Validated','emp':[ref('hr.employee1'),ref('hr.employee2'),ref('hr.employee3')] }} + (data, format) = netsvc.LocalService('report.holidays.summary').create(cr, uid, [], data_dict, {'active_ids': [ref('hr.employee1'),ref('hr.employee2'),ref('hr.employee3')]}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'hr_holidays-employee_summary_report.'+format), 'wb+').write(data) \ No newline at end of file diff --git a/addons/hr_payroll/__openerp__.py b/addons/hr_payroll/__openerp__.py index b7886da2df0..ab814ed80c2 100644 --- a/addons/hr_payroll/__openerp__.py +++ b/addons/hr_payroll/__openerp__.py @@ -60,6 +60,7 @@ 'test/payslip.yml', 'test/payment_advice.yml', 'test/payroll_register.yml', + 'test/hr_payroll_report.yml', ], 'demo_xml': [ 'hr_payroll_demo.xml' diff --git a/addons/hr_payroll/test/hr_payroll_report.yml b/addons/hr_payroll/test/hr_payroll_report.yml new file mode 100644 index 00000000000..e2268db7697 --- /dev/null +++ b/addons/hr_payroll/test/hr_payroll_report.yml @@ -0,0 +1,36 @@ +- + In order to test the PDF reports defined on HR Employee Salary, we will print HR Employee Salary +- + !python {model: hr.employee}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.salary.structure').create(cr, uid, [ref('hr_payroll.hr_employee_bonamy0')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'hr_payroll-salary_report.'+format), 'wb+').write(data) + +- + In order to test the PDF reports defined on HR Payslip, we will print a HR Payslip +- + !python {model: hr.payslip}: | + import netsvc, tools, os + (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) + +- + In order to test the PDF reports defined on HR Employee Salary Details, we will print HR Employee Salary Details +- + !python {model: hr.payslip}: | + import netsvc, tools, os, time + data_dict = {'model': 'ir.ui.menu', 'form': {'fiscalyear_id': ref('account.data_fiscalyear'), 'employee_ids': [ref('hr.employee2')]}} + (data, format) = netsvc.LocalService('report.employees.salary').create(cr, uid, [], data_dict, {'periods': []}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'hr_payroll-employee_salary_detai_report.'+format), 'wb+').write(data) +- + In order to test the PDF reports defined on HR Employee Salary Details, we will print HR Employee Salary Details +- + !python {model: hr.payslip}: | + import netsvc, tools, os, time + data_dict = {'model': 'ir.ui.menu', 'form': {'fiscalyear_id': ref('account.data_fiscalyear'), 'salary_on': 'current_month', 'employee_ids': [ref('hr.employee2')]}} + (data, format) = netsvc.LocalService('report.year.salary').create(cr, uid, [], data_dict, {'periods': []}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'hr_payroll-employee_yearly_salary_detai_report.'+format), 'wb+').write(data) \ No newline at end of file diff --git a/addons/hr_timesheet/__openerp__.py b/addons/hr_timesheet/__openerp__.py index c7207b6761c..5a2e37353cd 100644 --- a/addons/hr_timesheet/__openerp__.py +++ b/addons/hr_timesheet/__openerp__.py @@ -50,7 +50,9 @@ to set up a management by affair. 'wizard/hr_timesheet_sign_in_out_view.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', + ], 'installable': True, 'active': False, 'certificate': '0071405533469', diff --git a/addons/hr_timesheet/test/hr_timesheet_report.yml b/addons/hr_timesheet/test/hr_timesheet_report.yml new file mode 100644 index 00000000000..04c07d77403 --- /dev/null +++ b/addons/hr_timesheet/test/hr_timesheet_report.yml @@ -0,0 +1,31 @@ +- + In order to test the PDF reports defined on a HR Timesheet User Report, we will print a HR Timesheet User Report +- + !python {model: hr.employee}: | + import netsvc, tools, os, time + import datetime + from mx.DateTime import * + start = datetime.date.fromtimestamp(time.mktime(time.strptime(time.strftime('%Y-%m-%d'), "%Y-%m-%d"))) + start = DateTime(int(start.year), int(start.month), int(start.day)) + 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']: + 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 +- + !python {model: hr.employee}: | + import netsvc, tools, os, time + import datetime + from mx.DateTime import * + start = datetime.date.fromtimestamp(time.mktime(time.strptime(time.strftime('%Y-%m-%d'), "%Y-%m-%d"))) + start = DateTime(int(start.year), int(start.month), int(start.day)) + 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']: + file(os.path.join(tools.config['test_report_directory'], 'hr_timesheet-users_report.'+format), 'wb+').write(data) \ No newline at end of file diff --git a/addons/hr_timesheet_invoice/__openerp__.py b/addons/hr_timesheet_invoice/__openerp__.py index f9be64cc454..df44302ec56 100644 --- a/addons/hr_timesheet_invoice/__openerp__.py +++ b/addons/hr_timesheet_invoice/__openerp__.py @@ -47,7 +47,9 @@ reports, eso.""", ], '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', + ], 'installable': True, 'active': False, 'certificate': '0056091842381', diff --git a/addons/hr_timesheet_invoice/test/hr_timesheet_invoice_report.yml b/addons/hr_timesheet_invoice/test/hr_timesheet_invoice_report.yml new file mode 100644 index 00000000000..118699c4aa3 --- /dev/null +++ b/addons/hr_timesheet_invoice/test/hr_timesheet_invoice_report.yml @@ -0,0 +1,23 @@ +- + In order to test the PDF reports defined on a HR Timesheet Account Analytic Profit, we will print a HR Timesheet Account Analytic Profit +- + !python {model: account.analytic.line}: | + 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, format) = netsvc.LocalService('report.account.analytic.profit').create(cr, uid, [], data_dict, {'periods': []}) + 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) + +- + In order to test the PDF reports defined on a HR Cost Ledger, we will print a HR Cost Ledger +- + !python {model: account.analytic.account}: | + import netsvc, tools, os, time + import datetime + from mx.DateTime import * + start = datetime.date.fromtimestamp(time.mktime(time.strptime(time.strftime('%Y-%m-%d'), "%Y-%m-%d"))) + 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']: + file(os.path.join(tools.config['test_report_directory'], 'hr_timesheet_invoice-cost_ledger_report.'+format), 'wb+').write(data) \ No newline at end of file diff --git a/addons/l10n_ch/__openerp__.py b/addons/l10n_ch/__openerp__.py index de378528b33..1af2e70ca59 100644 --- a/addons/l10n_ch/__openerp__.py +++ b/addons/l10n_ch/__openerp__.py @@ -94,6 +94,9 @@ TODO : "account_journal_view.xml", "security/ir.model.access.csv", ], + 'test' : [ + 'test/l10n_ch_report.yml', + ], "active": False, "installable": True, } diff --git a/addons/l10n_ch/test/l10n_ch_report.yml b/addons/l10n_ch/test/l10n_ch_report.yml new file mode 100644 index 00000000000..0379e6bc83b --- /dev/null +++ b/addons/l10n_ch/test/l10n_ch_report.yml @@ -0,0 +1,17 @@ +- + In order to test the PDF reports defined on a l10n_ch, we will print a bvr_report +- + !python {model: account.invoice}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.l10n_ch.bvr').create(cr, uid, [ref('account.test_invoice_1')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'l10ch-bvr_order.'+format), 'wb+').write(data) + +- + In order to test the PDF reports defined on a l10n_ch, we will print a bvr_invoice_report +- + !python {model: account.invoice}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.l10n_ch.invoice.bvr').create(cr, uid, [ref('account.test_invoice_1')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'l10ch-bvr_invoice.'+format), 'wb+').write(data) diff --git a/addons/l10n_fr/__openerp__.py b/addons/l10n_fr/__openerp__.py index f96945a8bc8..0de26734781 100644 --- a/addons/l10n_fr/__openerp__.py +++ b/addons/l10n_fr/__openerp__.py @@ -48,8 +48,9 @@ Credits: Sistheo Zeekom CrysaLEAD "security/ir.model.access.csv", "wizard/fr_report_bilan_view.xml", "wizard/fr_report_compute_resultant_view.xml", - + ], + "test": ['test/l10n_fr_report.yml'], "demo_xml" : [], "certificate" : "00435321693876313629", "active": False, diff --git a/addons/l10n_fr/test/l10n_fr_report.yml b/addons/l10n_fr/test/l10n_fr_report.yml new file mode 100644 index 00000000000..cfc4f659925 --- /dev/null +++ b/addons/l10n_fr/test/l10n_fr_report.yml @@ -0,0 +1,26 @@ +- + In order to test Generate Fiscalyear Opening Entries wizard of OpenERP I first create a fiscalyear "Fiscal Year 2011" to which the entries will move +- + !record {model: account.fiscalyear, id: account_fiscalyear_0}: + code: FY2011 + company_id: base.main_company + date_start: '2011-01-01' + date_stop: '2011-12-31' + name: Fiscal Year 2011 +- + In order to test the PDF reports defined on a l10n_fr, we will print a account move line for l10n_fr +- + !python {model: account.move.line}: | + import netsvc, tools, os, time + (data, format) = netsvc.LocalService('report.l10n.fr.bilan').create(cr, uid, [], {'model':'account.move.line', 'form':{'fiscalyear_id': ref('account_fiscalyear_0')}}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'l10n_fr-bilan.'+format), 'wb+').write(data) + +- + In order to test the PDF reports defined on a l10n_fr, we will print a compute result for l10n_fr +- + !python {model: account.move.line}: | + import netsvc, tools, os,time + (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.'+format), 'wb+').write(data) diff --git a/addons/l10n_lu/__openerp__.py b/addons/l10n_lu/__openerp__.py index 739f36c9ce4..d1f6ba49905 100644 --- a/addons/l10n_lu/__openerp__.py +++ b/addons/l10n_lu/__openerp__.py @@ -41,6 +41,7 @@ This module installs: 'account.tax.template.csv', 'wizard/print_vat_view.xml' ], + 'test': ['test/l10n_lu_report.yml'], 'demo_xml': ['account.report.report.csv'], 'installable': True, 'active': False, diff --git a/addons/l10n_lu/test/l10n_lu_report.yml b/addons/l10n_lu/test/l10n_lu_report.yml new file mode 100644 index 00000000000..0ea9850df9a --- /dev/null +++ b/addons/l10n_lu/test/l10n_lu_report.yml @@ -0,0 +1,14 @@ +- + It is demo data for the account.tax.code +- + !record {model: account.tax.code, id: account_tax_code_id_r1}: + name: a + +- + In order to test the PDF reports defined on a l10u_lu, we will print a vat +- + !python {model: res.partner}: | + import netsvc, tools, os + (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.'+format), 'wb+').write(data) diff --git a/addons/lunch/__openerp__.py b/addons/lunch/__openerp__.py index ab540ad10d3..2e5c2489339 100644 --- a/addons/lunch/__openerp__.py +++ b/addons/lunch/__openerp__.py @@ -49,9 +49,8 @@ 'report/report_lunch_order_view.xml', ], "demo_xml": ['lunch_demo.xml'], - "test": ['test/test_lunch.yml'], + "test": ['test/test_lunch.yml', 'test/lunch_report.yml'], "installable": True, } -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/lunch/test/lunch_report.yml b/addons/lunch/test/lunch_report.yml new file mode 100644 index 00000000000..76214dfb599 --- /dev/null +++ b/addons/lunch/test/lunch_report.yml @@ -0,0 +1,8 @@ +- + In order to test the PDF reports defined on a lunch, we will print a lunch order +- + !python {model: lunch.order}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.lunch.order').create(cr, uid, [ref('lunch.lunch_order_0'),ref('lunch.lunch_order_1')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'lunch-lunch_order.'+format), 'wb+').write(data) diff --git a/addons/mrp/__openerp__.py b/addons/mrp/__openerp__.py index f8630065598..c56466501e0 100644 --- a/addons/mrp/__openerp__.py +++ b/addons/mrp/__openerp__.py @@ -92,7 +92,8 @@ 'test/mrp_packs.yml', 'test/mrp_phantom_bom.yml', 'test/mrp_production_order.yml', - + 'test/mrp_report.yml', + ], 'installable': True, 'active': False, diff --git a/addons/mrp/test/mrp_report.yml b/addons/mrp/test/mrp_report.yml new file mode 100644 index 00000000000..6a13d489104 --- /dev/null +++ b/addons/mrp/test/mrp_report.yml @@ -0,0 +1,35 @@ +- + In order to test the PDF reports defined on a mrp, we will print a bom order +- + !python {model: mrp.bom}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.bom.structure').create(cr, uid, [ref('mrp.mrp_bom_0'),ref('mrp.mrp_bom_1'),ref('mrp.mrp_bom_2'),ref('mrp.mrp_bom_23'),ref('mrp.mrp_bom_1901'),ref('mrp.mrp_bom_assemblysection0'),ref('mrp.mrp_bom_sidepanel0'),ref('mrp.mrp_bom_defaultbomforshelfofcm1'),ref('mrp.mrp_bom_sidepanel3')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'mrp-bom_order.'+format), 'wb+').write(data) + +- + In order to test the PDF reports defined on a mrp, we will print an order +- + !python {model: mrp.production}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.mrp.production.order').create(cr, uid, [ref('mrp.mrp_production_mo1')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'mrp-production_order.'+format), 'wb+').write(data) + +- + In order to test the PDF reports defined on a mrp product price, we will print a (mrp)Product Price order +- + !python {model: product.product}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.product.price').create(cr, uid, [1,2,3,5], {'model':'product.product', 'form':{'number': 1}}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'mrp_product-price_order.'+format), 'wb+').write(data) + +- + In order to test the PDF reports defined on a mrp workcenter, we will print a (mrp)workcenter +- + !python {model: mrp.workcenter}: | + import netsvc, tools, os, time + (data, format) = netsvc.LocalService('report.mrp.workcenter.load').create(cr, uid, [ref('mrp_workcenter_0'),ref('mrp_workcenter_1')], {'model':'mrp.workcenter', 'form':{'time_unit': 'day', 'measure_unit': 'hours'}}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'mrp_workcenter.'+format), 'wb+').write(data) diff --git a/addons/mrp_operations/__openerp__.py b/addons/mrp_operations/__openerp__.py index d4d5cf98d08..5170cc4c627 100644 --- a/addons/mrp_operations/__openerp__.py +++ b/addons/mrp_operations/__openerp__.py @@ -61,7 +61,7 @@ 'process/mrp_operation_process.xml' ], 'demo_xml': ['mrp_operation_data.xml'], - 'test': ['test/mrp_operations.yml'], + 'test': ['test/mrp_operations.yml', 'test/mrp_operations_report.yml'], 'installable': True, 'active': False, 'certificate': '0056233813133', diff --git a/addons/mrp_operations/test/mrp_operations_report.yml b/addons/mrp_operations/test/mrp_operations_report.yml new file mode 100644 index 00000000000..c83d077acde --- /dev/null +++ b/addons/mrp_operations/test/mrp_operations_report.yml @@ -0,0 +1,17 @@ +- + In order to test the PDF reports defined on a mrp operations, we will print a barcode +- + !python {model: mrp_operations.operation.code}: | + import netsvc, tools, os + (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-barcoder.'+format), 'wb+').write(data) + +- + In order to test the PDF reports defined on a mrp operations, we will print a workcenters +- + !python {model: mrp.workcenter}: | + import netsvc, tools, os + (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_ workcenter.'+format), 'wb+').write(data) diff --git a/addons/mrp_repair/__openerp__.py b/addons/mrp_repair/__openerp__.py index c9a4068f925..4313ae1a062 100644 --- a/addons/mrp_repair/__openerp__.py +++ b/addons/mrp_repair/__openerp__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (). # @@ -15,7 +15,7 @@ # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . +# along with this program. If not, see . # ############################################################################## @@ -31,13 +31,13 @@ * Invoicing (products and/or services) * Warranty concept * Repair quotation report - * Notes for the technician and for the final customer + * Notes for the technician and for the final customer """, 'author': 'OpenERP SA', 'depends': ['mrp', 'sale', 'account'], 'update_xml': [ 'security/ir.model.access.csv', - 'mrp_repair_sequence.xml', + 'mrp_repair_sequence.xml', 'wizard/mrp_repair_cancel_view.xml', 'wizard/mrp_repair_make_invoice_view.xml', 'mrp_repair_view.xml', @@ -45,7 +45,7 @@ 'mrp_repair_report.xml', ], 'demo_xml': [], - 'test': ['test/test_mrp_repair.yml'], + 'test': ['test/test_mrp_repair.yml', 'test/mrp_repair_report.yml'], 'installable': True, 'active': False, 'certificate': '0060814381277', diff --git a/addons/mrp_repair/test/mrp_repair_report.yml b/addons/mrp_repair/test/mrp_repair_report.yml new file mode 100644 index 00000000000..b6eb782dcfe --- /dev/null +++ b/addons/mrp_repair/test/mrp_repair_report.yml @@ -0,0 +1,8 @@ +- + In order to test the PDF reports defined on a mrp-repair, we will print a order +- + !python {model: mrp.repair}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.repair.order').create(cr, uid, [ref('mrp_repair.mrp_repair_rma0')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'mrp-repair_order.'+format), 'wb+').write(data) diff --git a/addons/point_of_sale/__openerp__.py b/addons/point_of_sale/__openerp__.py index cab0fb40dc0..6f33f75f65d 100644 --- a/addons/point_of_sale/__openerp__.py +++ b/addons/point_of_sale/__openerp__.py @@ -73,7 +73,10 @@ Main features : 'statement_report.xml', ], 'demo_xml': ['pos_demo.xml','singer_statement_demo.xml','multi_company_stock_data.xml',], - 'test':['test/pos_test.yml',], + 'test':['test/pos_test.yml', + 'test/pos_report.yml', + 'test/pos_details.yml', + 'test/pos_payment_report_date.yml'], 'installable': True, } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/point_of_sale/pos_demo.xml b/addons/point_of_sale/pos_demo.xml index 14710cf8f37..80ba3d24397 100644 --- a/addons/point_of_sale/pos_demo.xml +++ b/addons/point_of_sale/pos_demo.xml @@ -1,6 +1,65 @@ - + + + + + + + + + tax_excluded + + + + + + + + + tax_excluded + + + + + + + + 2010/09/15 + [PC3] Medium PC + + + + 450 + 2 + No Discount + + + + + 2010/09/15 + [PC2] Basic+ PC (assembly on order) + + + + 450 + 2 + No Discount + + + + + 2010/09/15 + [PC1] Basic PC + + + + 450 + 5 + 0.10 + Discount Applied + + diff --git a/addons/point_of_sale/test/pos_details_report.yml b/addons/point_of_sale/test/pos_details_report.yml new file mode 100644 index 00000000000..72f35b87ec5 --- /dev/null +++ b/addons/point_of_sale/test/pos_details_report.yml @@ -0,0 +1,8 @@ +- + In order to test the PDF reports defined on a Point Of Sale, we will print a POS Details report +- + !python {model: ir.ui.menu}: | + import netsvc, tools, os, time + (data, format) = netsvc.LocalService('report.pos.details').create(cr, uid, [], {'model':'ir.ui.menu', 'form':{'date_start': time.strftime('%Y-%m-%d'), 'date_end': time.strftime('%Y-%m-%d') }}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'point_of_sale- pos details report'+format), 'wb+').write(data) \ No newline at end of file diff --git a/addons/point_of_sale/test/pos_payment_report_date.yml b/addons/point_of_sale/test/pos_payment_report_date.yml new file mode 100644 index 00000000000..15eefcdc6ab --- /dev/null +++ b/addons/point_of_sale/test/pos_payment_report_date.yml @@ -0,0 +1,8 @@ +- + In order to test the PDF reports defined on a Point Of Sale, we will print a POS Sales Lines report +- + !python {model: ir.ui.menu}: | + import netsvc, tools, os, time + (data, format) = netsvc.LocalService('report.pos.payment.report.date').create(cr, uid, [1], {'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')] }}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'point_of_sale- pos sales lines report'+format), 'wb+').write(data) \ No newline at end of file diff --git a/addons/point_of_sale/test/pos_report.yml b/addons/point_of_sale/test/pos_report.yml new file mode 100644 index 00000000000..bd89ca2015d --- /dev/null +++ b/addons/point_of_sale/test/pos_report.yml @@ -0,0 +1,53 @@ +- + 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 + (data, format) = netsvc.LocalService('report.pos.details_summary').create(cr, uid, [ref('point_of_sale.order_pos1'), ref('point_of_sale.order_pos2')], {}, {}) + 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) + +- + 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 + (data, format) = netsvc.LocalService('report.pos.invoice').create(cr, uid, [ref('point_of_sale.order_pos1'), ref('point_of_sale.order_pos2')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-invoice report'+format), 'wb+').write(data) + +- + 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 + (data, format) = netsvc.LocalService('report.pos.lines').create(cr, uid, [ref('point_of_sale.order_pos1'), ref('point_of_sale.order_pos2')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-lines report'+format), 'wb+').write(data) + +- + 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 + (data, format) = netsvc.LocalService('report.pos.receipt').create(cr, uid, [ref('point_of_sale.order_pos1'), ref('point_of_sale.order_pos2')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-receipt report'+format), 'wb+').write(data) + +- + In order to test the PDF reports defined on a Point of Sale, we will print a POS Receipt With Reimbursement report +- + !python {model: pos.order}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.pos.receipt.with.remboursment').create(cr, uid, [ref('point_of_sale.order_pos1'), ref('point_of_sale.order_pos2')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-receipt with reimbursement report'+format), 'wb+').write(data) + +- + In order to test the PDF reports defined on a point of sale, we will print a POS Receipt Without Reimbursement report +- + !python {model: pos.order}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.pos.receipt.without.remboursment').create(cr, uid, [ref('point_of_sale.order_pos1'), ref('point_of_sale.order_pos2')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-receipt without reimbursement report'+format), 'wb+').write(data) \ No newline at end of file diff --git a/addons/product/__openerp__.py b/addons/product/__openerp__.py index 0a0cfceff20..5d099489859 100644 --- a/addons/product/__openerp__.py +++ b/addons/product/__openerp__.py @@ -58,6 +58,7 @@ 'company_view.xml', 'process/product_process.xml' ], + 'test':['test/product_report.yml'], 'installable': True, 'active': False, 'certificate': '0068861431437', diff --git a/addons/product/test/product_report.yml b/addons/product/test/product_report.yml new file mode 100644 index 00000000000..6e80083f66b --- /dev/null +++ b/addons/product/test/product_report.yml @@ -0,0 +1,17 @@ +- + In order to test the PDF reports defined on Products, we will print a Products Pricelists Report +- + !python {model: product.product}: | + import netsvc, tools, os + data_dict = {'model': 'product.price_list'} + data_dict['form'] = { + 'qty1': 1, + 'qty2': 5, + 'qty3': 10, + 'qty4': 0, + 'qty5': 0, + 'price_list':ref('product.list0') + } + (data, format) = netsvc.LocalService('report.product.pricelist').create(cr, uid, [ref('product.product_product_pc1'), ref('product.product_product_pc3')], data_dict, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'product-product_pricelist'+format), 'wb+').write(data) diff --git a/addons/project_planning/__openerp__.py b/addons/project_planning/__openerp__.py index 4624de97f8c..3f378cc21be 100644 --- a/addons/project_planning/__openerp__.py +++ b/addons/project_planning/__openerp__.py @@ -55,6 +55,7 @@ At the end of the month, the planning manager can also check if the encoded time ], 'test': [ 'test/planning_states.yml' + 'test/planning_report.yml' ], 'installable': True, 'active': False, diff --git a/addons/project_planning/project_planning_demo.xml b/addons/project_planning/project_planning_demo.xml index 9a64217f252..1c12e5c53cf 100644 --- a/addons/project_planning/project_planning_demo.xml +++ b/addons/project_planning/project_planning_demo.xml @@ -8,5 +8,13 @@ + + Project_Planning + 20 + 2010-01-01' + 2010-12-31 + draft + + diff --git a/addons/project_planning/test/project_plannning_report.yml b/addons/project_planning/test/project_plannning_report.yml new file mode 100644 index 00000000000..a7597af86e8 --- /dev/null +++ b/addons/project_planning/test/project_plannning_report.yml @@ -0,0 +1,8 @@ +- + In order to test the PDF reports defined on a Project Planning, we will print Project Planning Report +- + !python {model: report_account_analytic.planning}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.report_account_analytic.planning.print').create(cr, uid, [ref('project_planning.project_plannning_1')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'project_planning-project_planning_report'+format), 'wb+').write(data) \ No newline at end of file diff --git a/addons/project_scrum/__openerp__.py b/addons/project_scrum/__openerp__.py index 847263ba7d3..3350419af30 100644 --- a/addons/project_scrum/__openerp__.py +++ b/addons/project_scrum/__openerp__.py @@ -60,6 +60,7 @@ "board_project_scrum_view.xml", ], 'demo_xml': ['project_scrum_demo.xml'], + 'test': ['test/project_scrum_report.yml'], 'installable': True, 'active': False, } diff --git a/addons/project_scrum/test/project_scrum_report.yml b/addons/project_scrum/test/project_scrum_report.yml new file mode 100644 index 00000000000..7fb3e9c07fc --- /dev/null +++ b/addons/project_scrum/test/project_scrum_report.yml @@ -0,0 +1,9 @@ +- + In order to test the PDF reports defined on a Project Scrum, we will print Project Scrum Sprint Burndown Report +- + !python {model: project.scrum.sprint}: | + import netsvc, tools, os + data_dict = {'model': 'project.scrum.sprint', 'id':ref('project_scrum.scrum_sprint_0')} + (data, format) = netsvc.LocalService('report.scrum.sprint.burndown').create(cr, uid, [ref('project_scrum.scrum_sprint_0')], data_dict, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'project_scrum-project_scrum_sprint_burndown.'+format), 'wb+').write(data) \ No newline at end of file diff --git a/addons/purchase/__openerp__.py b/addons/purchase/__openerp__.py index c7b4de7decc..7af6dbceff0 100644 --- a/addons/purchase/__openerp__.py +++ b/addons/purchase/__openerp__.py @@ -60,6 +60,7 @@ 'test/purchase_from_picking.yml', 'purchase_unit_test.xml', 'test/procurement_buy.yml', + 'test/purchase_report.yml', ], 'demo': ['purchase_demo.xml'], 'installable': True, diff --git a/addons/purchase/purchase_demo.xml b/addons/purchase/purchase_demo.xml index 1168fd29679..f6c2931a626 100644 --- a/addons/purchase/purchase_demo.xml +++ b/addons/purchase/purchase_demo.xml @@ -1,6 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + 2010/09/15 + New server config + material + + + 150 + 5 + make_to_stock + + + + + 2010/09/15 + [PC1] Basic PC + + + 450 + 2 + 3 + 3 + make_to_stock + + + + + 2010/09/15 + [PC3] Medium PC + + + 900 + 1 + make_to_stock + + + + \ No newline at end of file diff --git a/addons/purchase/test/purchase_report.yml b/addons/purchase/test/purchase_report.yml new file mode 100644 index 00000000000..bbc15b1e936 --- /dev/null +++ b/addons/purchase/test/purchase_report.yml @@ -0,0 +1,16 @@ +- + In order to test the PDF reports defined on a Purchase Order, we will print a Request Quotation report +- + !python {model: purchase.order}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.purchase.quotation').create(cr, uid, [ref('purchase.order_purchase1'),ref('purchase.order_purchase2')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'purchase-request_quotation'+format), 'wb+').write(data) +- + In order to test the PDF reports defined on a Purchase Order, we will print Purchase Order report +- + !python {model: purchase.order}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.purchase.order').create(cr, uid, [ref('purchase.order_purchase1'),ref('purchase.order_purchase2')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'purchase-purchase_order_report'+format), 'wb+').write(data) \ No newline at end of file diff --git a/addons/purchase_requisition/__openerp__.py b/addons/purchase_requisition/__openerp__.py index 27be1f3ce64..0cfc48feccd 100644 --- a/addons/purchase_requisition/__openerp__.py +++ b/addons/purchase_requisition/__openerp__.py @@ -30,7 +30,7 @@ """, "depends" : ["purchase","mrp"], "init_xml" : [], - "demo_xml" : [], + "demo_xml" : ['purchase_requisition_demo.xml'], "update_xml" : ["wizard/purchase_requisition_partner_view.xml", "purchase_requisition_data.xml", "purchase_requisition_view.xml", @@ -38,7 +38,7 @@ "security/ir.model.access.csv","purchase_requisition_sequence.xml" ], "active": False, - "test":[], + "test":['test/purchase_requisition_report.yml'], "installable": True } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/purchase_requisition/purchase_requisition_demo.xml b/addons/purchase_requisition/purchase_requisition_demo.xml new file mode 100644 index 00000000000..ff9bba7c700 --- /dev/null +++ b/addons/purchase_requisition/purchase_requisition_demo.xml @@ -0,0 +1,27 @@ + + + + + + + + TE0001 + + multiple + 2010/09/16 15:56:14 + + + + + + + + + + 5 + + + + + + \ No newline at end of file diff --git a/addons/purchase_requisition/test/purchase_requisition_report.yml b/addons/purchase_requisition/test/purchase_requisition_report.yml new file mode 100644 index 00000000000..29edea96a8a --- /dev/null +++ b/addons/purchase_requisition/test/purchase_requisition_report.yml @@ -0,0 +1,8 @@ +- + In order to test the PDF reports defined on Purchase Requisition, we will print a Requisition report +- + !python {model: purchase.requisition}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.purchase.requisition').create(cr, uid, [ref('purchase_requisition.order_purchase_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/__openerp__.py b/addons/report_intrastat/__openerp__.py index 16860ef9b70..b4dc9b52c89 100644 --- a/addons/report_intrastat/__openerp__.py +++ b/addons/report_intrastat/__openerp__.py @@ -37,6 +37,7 @@ 'intrastat_report.xml' ], 'demo_xml': [], + 'test': ['test/report_instratat_report.yml'], 'installable': True, 'active': False, 'certificate': '0056982189085', diff --git a/addons/report_intrastat/test/report_instratat_report.yml b/addons/report_intrastat/test/report_instratat_report.yml new file mode 100644 index 00000000000..c6162f51c25 --- /dev/null +++ b/addons/report_intrastat/test/report_instratat_report.yml @@ -0,0 +1,8 @@ +- + In order to test the PDF reports defined using report_instratat module, we print a Instratat Report +- + !python {model: account.invoice}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.account.invoice.intrastat').create(cr, uid, [ref('account.test_invoice_1')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'report_instratat-instrastat_report.'+format), 'wb+').write(data) diff --git a/addons/sale/__openerp__.py b/addons/sale/__openerp__.py index 2bcb2f2d88f..6978a0bb072 100644 --- a/addons/sale/__openerp__.py +++ b/addons/sale/__openerp__.py @@ -79,7 +79,7 @@ 'test/sale_procurement.yml', 'test/invoice_on_ordered_qty.yml', 'test/invoice_on_shipped_qty.yml', - 'test/sale_order_print.yml', + 'test/sale_report.yml', ], 'installable': True, 'active': False, diff --git a/addons/sale/test/sale_order_print.yml b/addons/sale/test/sale_order_print.yml deleted file mode 100644 index def94d8c27e..00000000000 --- a/addons/sale/test/sale_order_print.yml +++ /dev/null @@ -1,8 +0,0 @@ -- - In order to test the PDF reports defined on a sale order, we will print a sale order -- - !python {model: sale.order}: | - import netsvc, tools, os - (data, format) = netsvc.LocalService('report.sale.order').create(cr, uid, [ref('sale.order'),ref('sale.order2')], {}, {}) - 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/sale/test/sale_report.yml b/addons/sale/test/sale_report.yml new file mode 100644 index 00000000000..d60420294fe --- /dev/null +++ b/addons/sale/test/sale_report.yml @@ -0,0 +1,16 @@ +- + In order to test the PDF reports defined on a sale order, we will print a sale order +- + !python {model: sale.order}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.sale.order').create(cr, uid, [ref('sale.order'),ref('sale.order2')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'sale-sale_order.'+format), 'wb+').write(data) +- + In order to test the PDF reports defined on a sale order, we will print a report for sale prepare allot +- + !python {model: sale.order}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.sale.order.prepare.allot').create(cr, uid, [ref('sale.order'),ref('sale.order2'),ref('sale.order3')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'sale-sale_prepare_allot.'+format), 'wb+').write(data) \ No newline at end of file diff --git a/addons/sale_layout/__openerp__.py b/addons/sale_layout/__openerp__.py index ee9fdadf8c3..b8490c02fc9 100755 --- a/addons/sale_layout/__openerp__.py +++ b/addons/sale_layout/__openerp__.py @@ -40,6 +40,7 @@ "sale_layout_view.xml", "sale_layout_report.xml", ], + "test" : ['test/sale_layout_report.yml'], "active": False, "installable": True } diff --git a/addons/sale_layout/test/sale_layout_report.yml b/addons/sale_layout/test/sale_layout_report.yml new file mode 100644 index 00000000000..ed43ac639f6 --- /dev/null +++ b/addons/sale_layout/test/sale_layout_report.yml @@ -0,0 +1,8 @@ +- + In order to test the PDF reports defined on Sale, we will print a Sale Layout report. +- + !python {model: sale.order}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.sale.order.layout').create(cr, uid, [ref('sale.order')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'sale_layout-sale layout report'+format), 'wb+').write(data) diff --git a/addons/stock/__openerp__.py b/addons/stock/__openerp__.py index e33e347d612..432f95242bd 100644 --- a/addons/stock/__openerp__.py +++ b/addons/stock/__openerp__.py @@ -74,7 +74,9 @@ Thanks to the double entry management, the inventory controlling is powerful and "security/ir.model.access.csv", "board_warehouse_view.xml" ], - 'test': ['test/stock_test.yml'], + 'test': ['test/stock_test.yml', + 'test/stock_report.yml', + ], 'installable': True, 'active': False, 'certificate': '0055421559965', diff --git a/addons/stock/stock_demo.xml b/addons/stock/stock_demo.xml index 6607d97b2b3..03a29838981 100644 --- a/addons/stock/stock_demo.xml +++ b/addons/stock/stock_demo.xml @@ -270,6 +270,12 @@ - + + PACKO1 + out + direct + 2binvoiced + + diff --git a/addons/stock/test/stock_report.yml b/addons/stock/test/stock_report.yml new file mode 100644 index 00000000000..491fd7fa9d7 --- /dev/null +++ b/addons/stock/test/stock_report.yml @@ -0,0 +1,48 @@ +- + In order to test the PDF reports defined on a stock, we will print a Stock Overviewall(childs) report +- + !python {model: stock.location}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.lot.stock.overview_all').create(cr, uid, [ref('stock.stock_location_13')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'stock-overviewall'+format), 'wb+').write(data) +- + In order to test the PDF reports defined on stock location, we will print a lot location report +- + !python {model: stock.location}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.lot.location').create(cr, uid, [ref('stock.stock_location_components')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'stock-stock_lot_location.'+format), 'wb+').write(data) +- + In order to test the PDF reports defined on stock inventory, we will print a Stock Inventory Move report +- + !python {model: stock.inventory}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.stock.inventory.move').create(cr, uid, [ref('stock.stock_inventory_0')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'stock-stock_inventory_move.'+format), 'wb+').write(data) +- + In order to test the PDF reports defined on a stock, we will print a Stock Overview report +- + !python {model: stock.location}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.lot.stock.overview').create(cr, uid, [ref('stock.stock_location_14')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'stock-overview'+format), 'wb+').write(data) +- + In order to test the PDF reports defined on a stock, we will print a Stock Picking List report +- + !python {model: stock.picking}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.stock.picking.list').create(cr, uid, [ref('stock.stock_picking_1')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'stock-picking_list'+format), 'wb+').write(data) +- + In order to test the PDF reports defined on a Stock, we will print Product Stock Report +- + !python {model: product.product}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.stock.product.history').create(cr, uid, [ref('product.product_product_pc1')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'stock-product_stock_report.'+format), 'wb+').write(data) \ No newline at end of file diff --git a/addons/survey/__openerp__.py b/addons/survey/__openerp__.py index 853370132de..fa48e176b26 100644 --- a/addons/survey/__openerp__.py +++ b/addons/survey/__openerp__.py @@ -47,6 +47,7 @@ 'demo_xml': ['survey_demo.xml'], 'test': [ 'test/survey00.yml', + 'test/survey_report.yml', ], 'installable': True, 'active': False, diff --git a/addons/survey/test/survey_report.yml b/addons/survey/test/survey_report.yml new file mode 100644 index 00000000000..adb3ddb28ed --- /dev/null +++ b/addons/survey/test/survey_report.yml @@ -0,0 +1,24 @@ +- + In order to test the PDF reports defined on a Survey, we will print Survey Analysis Report +- + !python {model: survey}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.survey.analysis').create(cr, uid, [ref('survey.survey_partner_feedback')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'survey-survey_analysis_report.'+format), 'wb+').write(data) +- + In order to test the PDF reports defined on a Survey, we will print Survey Browse Response Report +- + !python {model: survey}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.survey.browse.response').create(cr, uid, [ref('survey.survey_partner_feedback')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'survey-survey_browse_response_report.'+format), 'wb+').write(data) +- + In order to test the PDF reports defined on a Survey, we will print Survey Form Report +- + !python {model: survey}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.survey.form').create(cr, uid, [ref('survey.survey_partner_feedback')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'survey-survey_form_report.'+format), 'wb+').write(data) \ No newline at end of file