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/account_installer.xml b/addons/account/account_installer.xml index a262dc5eb7f..a9de51c3afb 100644 --- a/addons/account/account_installer.xml +++ b/addons/account/account_installer.xml @@ -8,13 +8,13 @@
- Accounting Modules Configuration + Accounting Application Configuration
- Configure Your Accounting System + Configure Your Accounting Chart - Configure your accounting system. By default, Chart of Account is matching to your country. If there are not chart of account certified for your county, you can install the generic chart of account. + The default Chart of Accounts is matching your country selection. If no certified Chart of Accounts exists for your specified country, a generic one can be installed and will be selected by default. Configure @@ -66,13 +66,17 @@
- Accounting Modules Configuration + Accounting Application Configuration
- Extra Accounting Modules + Configure Your Accounting Application + - From this screen, you can install extra accounting modules in your accounting system. Select the modules to directly install them. If you do not think you need any of these right now, you can easily install them later. + Add extra Accounting Addons to the ones already installed. Remember you can always install them at a later stage. + + + Configure @@ -100,7 +104,7 @@ - Accounting Modules Installation + Accounting Application Configuration ir.actions.act_window account.installer.modules diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index bcd5d8b233b..3d82e27b8ce 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -2375,11 +2375,11 @@
- Generate Chart of Accounts from a Chart Template + Accounting Application Configuration
Generate Chart of Accounts from a Chart Template + >Generate Your Accounting Chart from a Chart Template This will automatically configure your chart of accounts, bank accounts, taxes and journals according to the selected template diff --git a/addons/account/installer.py b/addons/account/installer.py index 415879e6de8..e2f2ca423b6 100644 --- a/addons/account/installer.py +++ b/addons/account/installer.py @@ -73,6 +73,21 @@ class account_installer(osv.osv_memory): return user.company_id.id return False + def _get_default_charts(self, cr, uid, context={}): + module_name = False + company_id = self._default_company(cr, uid, context=context) + company = self.pool.get('res.company').browse(cr, uid, company_id) + address_id = self.pool.get('res.partner').address_get(cr, uid, [company.partner_id.id]) + if address_id['default']: + address = self.pool.get('res.partner.address').browse(cr, uid, address_id['default']) + code = address.country_id.code + module_name = (code and 'l10n_' + code.lower()) or False + if module_name: + module_id = self.pool.get('ir.module.module').search(cr, uid, [('name', '=', module_name)]) + if module_id: + return module_name + return 'configurable' + _defaults = { 'date_start': lambda *a: time.strftime('%Y-01-01'), 'date_stop': lambda *a: time.strftime('%Y-12-31'), @@ -80,7 +95,8 @@ class account_installer(osv.osv_memory): 'sale_tax':lambda *a:0.0, 'purchase_tax':lambda *a:0.0, 'company_id': _default_company, - 'bank_accounts_id':_get_default_accounts + 'bank_accounts_id':_get_default_accounts, + 'charts': _get_default_charts } def on_change_tax(self, cr, uid, id, tax): 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..0048de7af46 --- /dev/null +++ b/addons/account/test/account_report.yml @@ -0,0 +1,386 @@ +- + 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_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_tax_code_0")], 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/account_voucher/__openerp__.py b/addons/account_voucher/__openerp__.py index 824ca746f37..752bb74f90c 100644 --- a/addons/account_voucher/__openerp__.py +++ b/addons/account_voucher/__openerp__.py @@ -52,6 +52,7 @@ # "test/account_voucher.yml", # "test/sales_receipt.yml", # "test/sales_payment.yml", + "test/account_voucher_report.yml" ], 'certificate': '0037580727101', "active": False, diff --git a/addons/account_voucher/test/account_voucher_report.yml b/addons/account_voucher/test/account_voucher_report.yml new file mode 100644 index 00000000000..eddb313c776 --- /dev/null +++ b/addons/account_voucher/test/account_voucher_report.yml @@ -0,0 +1,34 @@ +- + Demo for Account Voucher +- + !record {model: account.voucher, id: account_voucher_voucheraxelor0}: + account_id: account.cash + company_id: base.main_company + currency_id: base.EUR + journal_id: account.bank_journal + name: Voucher Axelor + narration: Basic PC + amount: 1000.0 + line_ids: + - account_id: account.cash + amount: 1000.0 + name: Voucher Axelor + period_id: account.period_6 + +- + In order to test the PDF reports defined on a account_voucher, we will print account voucher amount Report +- + !python {model: account.voucher}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.voucher.cash_amount').create(cr, uid, [ref("account_voucher_voucheraxelor0")], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'account_voucher-amount.'+format), 'wb+').write(data) + +- + In order to test the PDF reports defined on a account_voucher, we will print account voucher Report +- + !python {model: account.voucher}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.voucher.cash_receipt.drcr').create(cr, uid, [ref("account_voucher_voucheraxelor0")], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'account_voucher-report.'+format), 'wb+').write(data) diff --git a/addons/association/profile_association.xml b/addons/association/profile_association.xml index a149cfb0952..8460cfa6cc9 100644 --- a/addons/association/profile_association.xml +++ b/addons/association/profile_association.xml @@ -2,21 +2,21 @@ - Association Profile : Install extra modules + Association Application Configuration profile.association.config.install_modules_wizard form
- Association Profile Configuration + Association Application Configuration
- Install more modules. A few modules are proposed according to the Association Profile you selected. You will be able to install them based on our requirements. + Here are specific applications related to the Association Profile you selected. Configure @@ -37,7 +37,7 @@
- Association Profile : Install Extra Modules + Association Application Configuration ir.actions.act_window profile.association.config.install_modules_wizard 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..0219af369b4 --- /dev/null +++ b/addons/auction/test/auction_report.yml @@ -0,0 +1,125 @@ +- + 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'], 'auction-auction_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'], 'auction-auction_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'], 'auction-auction_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'], 'auction-auction_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'], 'auction-auction_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-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-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-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'], 'auction-auction_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'], 'auction-auction_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'], 'auction-auction_lot_report.'+format), 'wb+').write(data) + +- + In order to test the PDF reports defined on a auction, we will print a Auction Buyer list report +- + !python {model: auction.lots}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.buyer.list').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'], 'auction-auction_buyer_list_report.'+format), 'wb+').write(data) + +- + In order to test the PDF reports defined on a auction, we will print a Auction Flagey Hussier report +- + !python {model: auction.lots}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.flagey.huissier').create(cr, uid, [ref('auction.auction_deposit_3_lot_1'),ref('auction.auction_deposit_10_lot_2')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'auction-auction_flagey_hussier_report.'+format), 'wb+').write(data) + +- + In order to test the PDF reports defined on a auction, we will print Auction Seller Form report +- + !python {model: auction.lots}: | + import netsvc, tools, os + (data, format) = netsvc.LocalService('report.seller_form_report').create(cr, uid, [ref('auction.auction_deposit_3_lot_1'),ref('auction.auction_deposit_10_lot_2')], {}, {}) + if tools.config['test_report_directory']: + file(os.path.join(tools.config['test_report_directory'], 'auction-auction_seller_form_report.'+format), 'wb+').write(data) \ No newline at end of file diff --git a/addons/base_contact/base_contact_installer.py b/addons/base_contact/base_contact_installer.py index 31cebb61ba5..4f4e2b2896c 100644 --- a/addons/base_contact/base_contact_installer.py +++ b/addons/base_contact/base_contact_installer.py @@ -29,7 +29,6 @@ class base_contact_installer(osv.osv_memory): _columns = { 'name': fields.char('Name', size=64), 'migrate': fields.boolean('Migrate', help="If you select this, all addresses will be migrated."), - 'nomigrate': fields.boolean('NoMigrate', help="If you select this, all addresses will not be migrated."), } def execute(self, cr, uid, ids, context=None): @@ -54,15 +53,12 @@ class base_contact_installer(osv.osv_memory): END; $contactjob$ LANGUAGE plpgsql; CREATE TRIGGER contactjob AFTER INSERT ON res_partner_contact FOR EACH ROW EXECUTE PROCEDURE add_to_job();""") - cr.commit() cr.execute("INSERT into res_partner_contact (name, title, email, first_name, website) (SELECT coalesce(name, 'Noname'), title, email, function , to_char(id, '99999999') from res_partner_address)") - cr.commit() cr.execute("DROP TRIGGER IF EXISTS contactjob on res_partner_contact") cr.execute("DROP LANGUAGE IF EXISTS plpgsql CASCADE;") cr.execute("DROP FUNCTION IF EXISTS add_to_job()") - cr.commit() base_contact_installer() diff --git a/addons/base_contact/base_contact_installer_view.xml b/addons/base_contact/base_contact_installer_view.xml index 87a8033d837..672c43745fb 100644 --- a/addons/base_contact/base_contact_installer_view.xml +++ b/addons/base_contact/base_contact_installer_view.xml @@ -31,9 +31,7 @@
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/base_module_doc_rst/module_report.xml b/addons/base_module_doc_rst/module_report.xml index d8bbe51bf46..e3d4e342472 100644 --- a/addons/base_module_doc_rst/module_report.xml +++ b/addons/base_module_doc_rst/module_report.xml @@ -3,7 +3,7 @@ - +
diff --git a/addons/base_setup/base_setup_installer.xml b/addons/base_setup/base_setup_installer.xml index db890c2dfdf..4245f3da206 100644 --- a/addons/base_setup/base_setup_installer.xml +++ b/addons/base_setup/base_setup_installer.xml @@ -8,38 +8,41 @@
- Install OpenERP Modules + Install Applications
- - Select applications you want to install. If you don't think you need any of these right now, you can easily install them later. + + Select the Applications you want your system to cover. If you are not sure about your exact needs at this stage, you can easily install them later. 15 + + Install + - Install Generic Modules + Install Applications + - - - - - - - - - - - + + + + + + + + + + +
- Base Setup Modules Installation + Install Applications ir.actions.act_window base.setup.installer diff --git a/addons/base_setup/base_setup_todo.xml b/addons/base_setup/base_setup_todo.xml index 59543200076..8151442855b 100644 --- a/addons/base_setup/base_setup_todo.xml +++ b/addons/base_setup/base_setup_todo.xml @@ -1,20 +1,20 @@ - Setup company information + Company Configuration base.setup.company form
- Main Company Setup + Company Configuration
- Information of your company will be used to customize your documents like Invoices, Sale Orders and many more. + Your company information will be used to personalize documents issued with OpenERP such as invoices, sales orders and much more. - Configure Your Company + Configure Your Company Information 25 @@ -55,7 +55,7 @@
- Setup company information + Company Configuration ir.actions.act_window base.setup.company diff --git a/addons/base_setup/installer.py b/addons/base_setup/installer.py index 5da836d7f80..77303336ab7 100644 --- a/addons/base_setup/installer.py +++ b/addons/base_setup/installer.py @@ -66,13 +66,12 @@ class base_setup_installer(osv.osv_memory): "automatic picking lists generation and more."), 'marketing':fields.boolean('Marketing', help="Helps you manage your marketing campaigns step by step."), - 'profile_tools':fields.boolean('Miscellaneous Tools', + 'profile_tools':fields.boolean('Extra Tools', help="Lets you install various interesting but non-essential tools " "like Survey, Lunch and Ideas box."), 'report_designer':fields.boolean('Advanced Reporting', help="Lets you install various tools to simplify and enhance " "OpenERP's report creation."), - 'thunderbird' :fields.boolean('Thunderbird'), # Vertical modules 'product_expiry':fields.boolean('Food Industry', help="Installs a preselected set of OpenERP applications " @@ -108,11 +107,13 @@ class base_setup_installer(osv.osv_memory): return ['account_voucher'] return None - def onchange_moduleselection(self, cr, uid, ids, *args): + def onchange_moduleselection(self, cr, uid, ids, *args, **kargs): + value = {} + # Calculate progress closed, total = self.get_current_progress(cr, uid) - progress = round(100. * closed / (total + len(filter(None, args)))) + value.update({'progress':progress}) if progress < 10.: progress = 10. - return {'value':{'progress':progress}} + return {'value':value} base_setup_installer() diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index 94f3d977842..dc7fef3ca70 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -84,6 +84,7 @@ Create dashboard for CRM that includes: 'wizard/crm_partner_to_opportunity_view.xml', 'wizard/crm_send_email_view.xml', + 'wizard/crm_add_note_view.xml', 'wizard/crm_forward_to_partner_view.xml', 'wizard/crm_merge_opportunities_view.xml', diff --git a/addons/crm/crm.py b/addons/crm/crm.py index 1ee2f295778..a16f749323d 100644 --- a/addons/crm/crm.py +++ b/addons/crm/crm.py @@ -499,10 +499,14 @@ class crm_case_section(osv.osv): _name = "crm.case.section" _description = "Sales Teams" - _order = "parent_id, name" + _order = "complete_name" + + def get_full_name(self, cr, uid, ids, field_name, arg, context={}): + return dict(self.name_get(cr, uid, ids, context)) _columns = { 'name': fields.char('Sales Team', size=64, required=True, translate=True), + 'complete_name': fields.function(get_full_name, method=True, type='char', size=256, readonly=True, store=True), 'code': fields.char('Code', size=8), 'active': fields.boolean('Active', help="If the active field is set to "\ "true, it will allow you to hide the sales team without removing it."), diff --git a/addons/crm/crm_action_rule.py b/addons/crm/crm_action_rule.py index 6805131155a..f7df076e24d 100644 --- a/addons/crm/crm_action_rule.py +++ b/addons/crm/crm_action_rule.py @@ -96,7 +96,8 @@ this if you want the rule to send an email to the partner."), res_count = True if action.trg_max_history: res_count = False - if len(obj.message_ids) <= action.trg_max_history: + history_ids = filter(lambda x: x.history, obj.message_ids) + if len(history_ids) <= action.trg_max_history: res_count = True ok = ok and res_count return ok @@ -120,7 +121,11 @@ this if you want the rule to send an email to the partner."), write['email_cc'] = obj.email_cc+','+obj.act_email_cc else: write['email_cc'] = obj.act_email_cc - + + # Put state change by rule in communication history + if hasattr(obj, 'state') and action.act_state: + model_obj._history(cr, uid, [obj], _(action.act_state)) + model_obj.write(cr, uid, [obj.id], write, context) emails = [] diff --git a/addons/crm/crm_installer_view.xml b/addons/crm/crm_installer_view.xml index 5599eeff5d9..5fad3f41a3d 100644 --- a/addons/crm/crm_installer_view.xml +++ b/addons/crm/crm_installer_view.xml @@ -8,15 +8,15 @@
- CRM Modules Configuration + CRM Application Configuration
- Configure Your CRM System + Configure Your CRM Application - You can enhance OpenERP's basic CRM support with a few additional OpenERP applications + Enhance your CRM basic Application with additional Addons. 13 @@ -49,7 +49,7 @@
- CRM Modules Installation + CRM Application Configuration ir.actions.act_window crm.installer diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml index 6e1b851f52a..95f81e0d813 100644 --- a/addons/crm/crm_lead_view.xml +++ b/addons/crm/crm_lead_view.xml @@ -174,6 +174,7 @@ +