[[ repeatIn(get_lines(data), 'a') ]]
[[ (a.get('level') <> 0) or removeParentNode('tr') ]]
[[ setTag('tr','tr',{'style': 'Table'+str(min(3,'level' in a and a.get('level') or 1))}) ]]
- | [[ setTag('para','para',{'style': 'terp_level_'+str(min(6,a['level']))+'_name'}) ]] [[ a.get('name') ]] |
- [[ a.get('level') == 4 or removeParentNode('td') ]][[ setTag('para','para',{'style': 'terp_level_'+str(min(6,a['level']))+'_balance'}) ]][[ formatLang(a.get('balance'))]] [[company.currency_id.symbol]] |
- [[ a.get('level') <> 4 or removeParentNode('td') ]][[ setTag('para','para',{'style': 'terp_level_'+str(min(6,a['level']))+'_balance'}) ]][[ formatLang(a.get('balance'))]] [[company.currency_id.symbol]] |
+ [[ (a.get('account_type') =='view' and a.get('level') >= 3) and setTag('para','para',{'style': 'terp_level_'+str(min(3,a.get('level')))+'_name_bold'}) or setTag('para','para',{'style': 'terp_level_'+str(min(4,a.get('level')))+'_name'}) ]][[ a.get('name') ]] |
+ [[ (a.get('level') <>2) or removeParentNode('td') ]][[ (a.get('account_type') =='view' and a.get('level') >= 3) and setTag('para','para',{'style': 'terp_level_3_balance_bold'}) or setTag('para','para',{'style': 'terp_level_'+str(min(3,a.get('level')))+'_balance'}) ]][[ formatLang(a.get('balance'), currency_obj = company.currency_id) ]] |
+ [[ a.get('level') == 2 or removeParentNode('td') ]][[ formatLang(a.get('balance'), currency_obj = company.currency_id) ]] |
@@ -258,11 +256,11 @@
[[ repeatIn(get_lines(data), 'a') ]]
[[ (a.get('level') <> 0) or removeParentNode('tr') ]]
[[ setTag('tr','tr',{'style': 'Table'+str(min(3,'level' in a and a.get('level') or 1))}) ]]
- [[ setTag('para','para',{'style': 'terp_level_'+str(min(6,a['level']))+'_name'}) ]] [[ a.get('name') ]] |
- [[ a.get('level') == 4 or removeParentNode('td') ]][[ setTag('para','para',{'style': 'terp_level_'+str(min(6,a['level']))+'_balance'}) ]][[ formatLang(a.get('balance'))]] [[company.currency_id.symbol]] |
- [[ a.get('level') <> 4 or removeParentNode('td') ]][[ setTag('para','para',{'style': 'terp_level_'+str(min(6,a['level']))+'_balance'}) ]][[ formatLang(a.get('balance'))]] [[company.currency_id.symbol]] |
- [[ a.get('level') == 4 or removeParentNode('td') ]][[ setTag('para','para',{'style': 'terp_level_'+str(min(6,a['level']))+'_balance'}) ]][[ formatLang(a.get('balance_cmp'))]] [[company.currency_id.symbol]] |
- [[ a.get('level') <> 4 or removeParentNode('td') ]][[ setTag('para','para',{'style': 'terp_level_'+str(min(6,a['level']))+'_balance'}) ]][[ formatLang(a.get('balance_cmp'))]] [[company.currency_id.symbol]] |
+ [[ (a.get('account_type') =='view' and a.get('level') >= 3) and setTag('para','para',{'style': 'terp_level_'+str(min(3,a.get('level')))+'_name_bold'}) or setTag('para','para',{'style': 'terp_level_'+str(min(4,a.get('level')))+'_name'}) ]][[ a.get('name') ]] |
+ [[ (a.get('level') <>2) or removeParentNode('td') ]][[ (a.get('account_type') =='view' and a.get('level') >= 3) and setTag('para','para',{'style': 'terp_level_3_balance_bold'}) or setTag('para','para',{'style': 'terp_level_'+str(min(3,a.get('level')))+'_balance'}) ]][[ formatLang(a.get('balance'), currency_obj = company.currency_id) ]] |
+ [[ a.get('level') == 2 or removeParentNode('td') ]][[ formatLang(a.get('balance'), currency_obj = company.currency_id) ]] |
+ [[ (a.get('level') <>2) or removeParentNode('td') ]][[ (a.get('account_type') =='view' and a.get('level') >= 3) and setTag('para','para',{'style': 'terp_level_3_balance_bold'}) or setTag('para','para',{'style': 'terp_level_'+str(min(3,a.get('level')))+'_balance'}) ]][[ formatLang(a.get('balance_cmp'), currency_obj = company.currency_id) ]] |
+ [[ a.get('level') == 2 or removeParentNode('td') ]][[ formatLang(a.get('balance_cmp'), currency_obj = company.currency_id) ]] |
diff --git a/addons/account/report/account_profit_horizontal.rml b/addons/account/report/account_profit_horizontal.rml
deleted file mode 100644
index 0918dcb2699..00000000000
--- a/addons/account/report/account_profit_horizontal.rml
+++ /dev/null
@@ -1,282 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- |
- Profit And Loss
- |
-
-
-
-
-
- [[ get_data(data) or removeParentNode('para')]]
-
-
- | Chart of Accounts |
- Fiscal Year |
- Filter By [[ data['form']['filter']!='filter_no' and get_filter(data) ]] |
- Display Account |
- Target Moves |
-
-
- | [[ get_account(data) or removeParentNode('para') ]] |
- [[ get_fiscalyear(data) or '' ]] |
- [[ data['form']['filter']=='filter_no' and get_filter(data) or removeParentNode('para') ]]
- [[ data['form']['filter']=='filter_date' or removeParentNode('blockTable') ]]
-
- | Start Date |
- End Date |
-
-
- | [[ formatLang(get_start_date(data),date=True) ]] |
- [[ formatLang(get_end_date(data),date=True) ]] |
-
-
- [[ data['form']['filter']=='filter_period' or removeParentNode('blockTable') ]]
-
- | Start Period |
- End Period |
-
-
- | [[ get_start_period(data) or removeParentNode('para') ]] |
- [[ get_end_period(data) or removeParentNode('para') ]] |
-
-
- |
- [[ (data['form']['display_account']=='all' and 'All') or (data['form']['display_account']=='movement' and 'With movements') or 'With balance is not equal to 0']] |
- [[ get_target_move(data) ]] |
-
-
-
-
-
-
-
- |
- Code
- |
-
- Expenses
- |
-
- Balance
- |
-
- Code
- |
-
- Income
- |
-
- Balance
- |
-
-
- |
-
-
- [[ repeatIn(get_lines(),'a' ) ]] [[ a['code'] ]][[ a['level']<4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]]
-
- |
-
-
- [[ '. '*(a['level']-1) ]][[ a['level']<4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]][[ a['name'] ]]
-
- |
-
- [[ a['level']<4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font') ]][[ formatLang(abs(a['balance']), currency_obj=company.currency_id) ]]
- |
-
-
- [[ a['code1'] ]][[ a['level1']<4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]]
-
- |
-
-
- [[ '. '*(a['level1']-1) ]][[ a['level1']<4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]][[ a['name1'] ]]
-
- |
-
- [[ a['level']<4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font') ]][[(a['code1'] and a['name1']) and formatLang(abs(a['balance1']), currency_obj=company.currency_id) or removeParentNode('font') ]]
- |
-
-
-
-
- |
-
- |
-
- [[ final_result()['type'] == 'Net Profit' and final_result()['type'] or '' ]]
- |
-
- [[ final_result()['balance'] and final_result()['type'] == 'Net Profit' and formatLang(abs(final_result()['balance']), currency_obj=company.currency_id) ]]
- |
-
-
- |
-
- [[ final_result()['type'] == 'Net Loss' and final_result()['type'] or '' ]]
- |
-
- [[ final_result()['balance'] and final_result()['type'] == 'Net Loss' and formatLang(abs(final_result()['balance']), currency_obj=company.currency_id) ]]
- |
-
-
-
-
-
- |
- Total:
- |
-
- [[ formatLang(abs(sum_dr()), currency_obj=company.currency_id) ]]
- |
-
- Total:
- |
-
- [[ formatLang(abs(sum_cr()), currency_obj=company.currency_id) ]]
- |
-
-
-
-
-
diff --git a/addons/account/report/account_profit_loss.py b/addons/account/report/account_profit_loss.py
deleted file mode 100644
index 27182cdbd21..00000000000
--- a/addons/account/report/account_profit_loss.py
+++ /dev/null
@@ -1,198 +0,0 @@
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2009 Tiny SPRL ().
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# 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 .
-#
-##############################################################################
-
-import time
-import pooler
-from report import report_sxw
-from common_report_header import common_report_header
-from tools.translate import _
-
-class report_pl_account_horizontal(report_sxw.rml_parse, common_report_header):
-
- def __init__(self, cr, uid, name, context=None):
- super(report_pl_account_horizontal, self).__init__(cr, uid, name, context=context)
- self.result_sum_dr = 0.0
- self.result_sum_cr = 0.0
- self.res_pl = {}
- self.result = {}
- self.result_temp = []
- self.localcontext.update( {
- 'time': time,
- 'get_lines': self.get_lines,
- 'get_lines_another': self.get_lines_another,
- 'get_currency': self._get_currency,
- 'get_data': self.get_data,
- 'sum_dr': self.sum_dr,
- 'sum_cr': self.sum_cr,
- 'final_result': self.final_result,
- 'get_fiscalyear': self._get_fiscalyear,
- 'get_account': self._get_account,
- 'get_start_period': self.get_start_period,
- 'get_end_period': self.get_end_period,
- 'get_sortby': self._get_sortby,
- 'get_filter': self._get_filter,
- 'get_journal': self._get_journal,
- 'get_start_date':self._get_start_date,
- 'get_end_date':self._get_end_date,
- 'get_company':self._get_company,
- 'get_target_move': self._get_target_move,
- })
- self.context = context
-
- def set_context(self, objects, data, ids, report_type=None):
- new_ids = ids
- if (data['model'] == 'ir.ui.menu'):
- new_ids = 'chart_account_id' in data['form'] and [data['form']['chart_account_id']] or []
- objects = self.pool.get('account.account').browse(self.cr, self.uid, new_ids)
- return super(report_pl_account_horizontal, self).set_context(objects, data, new_ids, report_type=report_type)
-
-
- def final_result(self):
- return self.res_pl
-
- def sum_dr(self):
- if self.res_pl['type'] == _('Net Profit'):
- self.result_sum_dr += self.res_pl['balance']
- return self.result_sum_dr
-
- def sum_cr(self):
- if self.res_pl['type'] == _('Net Loss'):
- self.result_sum_cr += self.res_pl['balance']
- return self.result_sum_cr
-
- def get_data(self, data):
- cr, uid = self.cr, self.uid
- db_pool = pooler.get_pool(self.cr.dbname)
-
- account_pool = db_pool.get('account.account')
- currency_pool = db_pool.get('res.currency')
-
- types = [
- 'expense',
- 'income'
- ]
-
- ctx = self.context.copy()
- ctx['fiscalyear'] = data['form'].get('fiscalyear_id', False)
-
- if data['form']['filter'] == 'filter_period':
- ctx['period_from'] = data['form'].get('period_from', False)
- ctx['period_to'] = data['form'].get('period_to', False)
- elif data['form']['filter'] == 'filter_date':
- ctx['date_from'] = data['form'].get('date_from', False)
- ctx['date_to'] = data['form'].get('date_to', False)
-
- cal_list = {}
- account_id = data['form'].get('chart_account_id', False)
- company_currency = account_pool.browse(self.cr, self.uid, account_id).company_id.currency_id
- account_ids = account_pool._get_children_and_consol(cr, uid, account_id, context=ctx)
- accounts = account_pool.browse(cr, uid, account_ids, context=ctx)
-
- for typ in types:
- accounts_temp = []
- for account in accounts:
- if (account.user_type.report_type) and (account.user_type.report_type == typ):
- currency = account.currency_id and account.currency_id or account.company_id.currency_id
- if typ == 'expense' and account.type <> 'view' and (account.debit <> account.credit):
- self.result_sum_dr += account.debit - account.credit
- if typ == 'income' and account.type <> 'view' and (account.debit <> account.credit):
- self.result_sum_cr += account.credit - account.debit
- if data['form']['display_account'] == 'movement':
- if not currency_pool.is_zero(self.cr, self.uid, currency, account.credit) or not currency_pool.is_zero(self.cr, self.uid, currency, account.debit) or not currency_pool.is_zero(self.cr, self.uid, currency, account.balance):
- accounts_temp.append(account)
- elif data['form']['display_account'] == 'not_zero':
- if not currency_pool.is_zero(self.cr, self.uid, currency, account.balance):
- accounts_temp.append(account)
- else:
- accounts_temp.append(account)
- if currency_pool.is_zero(self.cr, self.uid, company_currency, (self.result_sum_dr-self.result_sum_cr)):
- self.res_pl['type'] = None
- self.res_pl['balance'] = 0.0
- elif self.result_sum_dr > self.result_sum_cr:
- self.res_pl['type'] = _('Net Loss')
- self.res_pl['balance'] = (self.result_sum_dr - self.result_sum_cr)
- else:
- self.res_pl['type'] = _('Net Profit')
- self.res_pl['balance'] = (self.result_sum_cr - self.result_sum_dr)
- self.result[typ] = accounts_temp
- cal_list[typ] = self.result[typ]
- if cal_list:
- temp = {}
- for i in range(0,max(len(cal_list['expense']),len(cal_list['income']))):
- if i < len(cal_list['expense']) and i < len(cal_list['income']):
- temp={
- 'code': cal_list['expense'][i].code,
- 'name': cal_list['expense'][i].name,
- 'level': cal_list['expense'][i].level,
- 'balance': cal_list['expense'][i].balance != 0 and \
- cal_list['expense'][i].balance * cal_list['expense'][i].user_type.sign or \
- cal_list['expense'][i].balance,
- 'code1': cal_list['income'][i].code,
- 'name1': cal_list['income'][i].name,
- 'level1': cal_list['income'][i].level,
- 'balance1': cal_list['income'][i].balance != 0 and \
- cal_list['income'][i].balance * cal_list['income'][i].user_type.sign or \
- cal_list['income'][i].balance,
- }
- self.result_temp.append(temp)
- else:
- if i < len(cal_list['income']):
- temp={
- 'code': '',
- 'name': '',
- 'level': False,
- 'balance':False,
- 'code1': cal_list['income'][i].code,
- 'name1': cal_list['income'][i].name,
- 'level1': cal_list['income'][i].level,
- 'balance1': cal_list['income'][i].balance != 0 and \
- cal_list['income'][i].balance * cal_list['income'][i].user_type.sign \
- or cal_list['income'][i].balance,
- }
- self.result_temp.append(temp)
- if i < len(cal_list['expense']):
- temp={
- 'code': cal_list['expense'][i].code,
- 'name': cal_list['expense'][i].name,
- 'level': cal_list['expense'][i].level,
- 'balance': cal_list['expense'][i].balance != 0 and \
- cal_list['expense'][i].balance * cal_list['expense'][i].user_type.sign \
- or cal_list['expense'][i].balance,
- 'code1': '',
- 'name1': '',
- 'level1': False,
- 'balance1':False,
- }
- self.result_temp.append(temp)
- return None
-
- def get_lines(self):
- return self.result_temp
-
- def get_lines_another(self, group):
- return self.result.get(group, [])
-
-report_sxw.report_sxw('report.pl.account.horizontal', 'account.account',
- 'addons/account/report/account_profit_horizontal.rml',parser=report_pl_account_horizontal, header='internal landscape')
-
-report_sxw.report_sxw('report.pl.account', 'account.account',
- 'addons/account/report/account_profit_loss.rml',parser=report_pl_account_horizontal, header='internal')
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/report/account_profit_loss.rml b/addons/account/report/account_profit_loss.rml
deleted file mode 100644
index 28fe167aef5..00000000000
--- a/addons/account/report/account_profit_loss.rml
+++ /dev/null
@@ -1,314 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- |
- Profit And Loss
- |
-
-
-
- [[ get_data(data) or removeParentNode('para')]]
-
-
-
-
-
- | Chart of Accounts |
- Fiscal Year |
- Filter By [[ data['form']['filter']!='filter_no' and get_filter(data) ]] |
- Display Account |
- Target Moves |
-
-
- | [[ get_account(data) or removeParentNode('para') ]] |
- [[ get_fiscalyear(data) or '' ]] |
- [[ data['form']['filter']=='filter_no' and get_filter(data) or removeParentNode('para') ]]
- [[ data['form']['filter']=='filter_date' or removeParentNode('blockTable') ]]
-
- | Start Date |
- End Date |
-
-
- | [[ formatLang(get_start_date(data),date=True) ]] |
- [[ formatLang(get_end_date(data),date=True) ]] |
-
-
- [[ data['form']['filter']=='filter_period' or removeParentNode('blockTable') ]]
-
- | Start Period |
- End Period |
-
-
- | [[ get_start_period(data) or removeParentNode('para') ]] |
- [[ get_end_period(data) or removeParentNode('para') ]] |
-
-
- |
- [[ (data['form']['display_account']=='all' and 'All') or (data['form']['display_account']=='movement' and 'With movements') or 'With balance is not equal to 0']] |
- [[ get_target_move(data) ]] |
-
-
-
-
-
- Expenses
-
-
- |
- Code
- |
-
- Account
- |
-
- Balance
- |
-
-
- [[ repeatIn(get_lines_another('expense'),'a' ) ]]
- [[ setTag('tr','tr',{'style': 'Table'+str(min(3,a.level))}) ]]
- | [[ (a.type =='view' and a.level >= 3) and setTag('para','para',{'style': 'terp_level_3_code_bold'}) or setTag('para','para',{'style': 'terp_level_'+str(min(3,a.level))+'_code'}) ]][[ a.code ]] |
- [[ (a.type =='view' and a.level >= 3) and setTag('para','para',{'style': 'terp_level_'+str(min(3,a.level))+'_name_bold'}) or setTag('para','para',{'style': 'terp_level_'+str(min(4,a.level))+'_name'}) ]][[ a.name ]] |
- [[ (a.level <>2) or removeParentNode('td') ]][[ (a.type =='view' and a.level >= 3) and setTag('para','para',{'style': 'terp_level_3_balance_bold'}) or setTag('para','para',{'style': 'terp_level_'+str(min(3,a.level))+'_balance'}) ]][[ formatLang(a.balance * a.user_type.sign, currency_obj=company.currency_id) ]] |
- [[ a.level == 2 or removeParentNode('td') ]][[ formatLang(a.balance * a.user_type.sign, currency_obj=company.currency_id) ]] |
-
-
-
-
- |
-
- |
-
- [[ final_result()['type'] == 'Net Profit' and final_result()['type'] or removeParentNode('blockTable') ]]
- |
-
- [[ final_result()['balance'] and final_result()['type'] == 'Net Profit' and formatLang(final_result()['balance'], currency_obj=company.currency_id) ]]
- |
-
-
-
-
- |
- Total:
- |
-
- [[ formatLang(sum_dr(), currency_obj=company.currency_id) ]]
- |
-
-
-
-
-
-
- Incomes
-
-
- |
- Code
- |
-
- Account
- |
-
- Balance
- |
-
-
- [[ repeatIn(get_lines_another('income'),'a' ) ]]
- [[ setTag('tr','tr',{'style': 'Table'+str(min(3,a.level))}) ]]
- | [[ (a.type =='view' and a.level >= 3) and setTag('para','para',{'style': 'terp_level_3_code_bold'}) or setTag('para','para',{'style': 'terp_level_'+str(min(3,a.level))+'_code'}) ]][[ a.code ]] |
- [[ (a.type =='view' and a.level >= 3) and setTag('para','para',{'style': 'terp_level_'+str(min(3,a.level))+'_name_bold'}) or setTag('para','para',{'style': 'terp_level_'+str(min(4,a.level))+'_name'}) ]][[ a.name ]] |
- [[ (a.level <>2) or removeParentNode('td') ]][[ (a.type =='view' and a.level >= 3) and setTag('para','para',{'style': 'terp_level_3_balance_bold'}) or setTag('para','para',{'style': 'terp_level_'+str(min(3,a.level))+'_balance'}) ]][[ formatLang(a.balance * a.user_type.sign, currency_obj=company.currency_id) ]] |
- [[ a.level == 2 or removeParentNode('td') ]][[ formatLang(a.balance * a.user_type.sign, currency_obj=company.currency_id) ]] |
-
-
-
-
- |
-
- |
-
- [[ final_result()['type'] == 'Net Loss' and final_result()['type'] or removeParentNode('blockTable') ]]
- |
-
- [[ final_result()['balance'] and final_result()['type'] == 'Net Loss' and formatLang(final_result()['balance'], currency_obj=company.currency_id) ]]
- |
-
-
-
-
- |
- Total:
- |
-
- [[ formatLang(sum_cr(), currency_obj=company.currency_id) ]]
- |
-
-
-
-
-
-
-
-
-
-
diff --git a/addons/account/test/account_report.yml b/addons/account/test/account_report.yml
index 40ba7ea7127..c2797f274e7 100644
--- a/addons/account/test/account_report.yml
+++ b/addons/account/test/account_report.yml
@@ -37,24 +37,15 @@
data_dict = {'chart_account_id':ref('account.chart0')}
from tools import test_reports
test_reports.try_report_action(cr, uid, 'action_account_aged_balance_view',wiz_data=data_dict, context=ctx, our_module='account')
--
- Print the Account Balance Sheet in Horizontal mode
--
- !python {model: account.account}: |
- ctx={}
- ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]})
- data_dict = {'chart_account_id':ref('account.chart0'),'display_type': True}
- from tools import test_reports
- test_reports.try_report_action(cr, uid, 'action_account_bs_report',wiz_data=data_dict, context=ctx, our_module='account')
-
Print the Account Balance Sheet in Normal mode
-
!python {model: account.account}: |
ctx={}
ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]})
- data_dict = {'chart_account_id':ref('account.chart0'),'display_type': False}
+ data_dict = {'chart_account_id':ref('account.chart0'),'display_type': False, 'account_report_id': ref('account_financial_report_balancesheet0')}
from tools import test_reports
- test_reports.try_report_action(cr, uid, 'action_account_bs_report',wiz_data=data_dict, context=ctx, our_module='account')
+ test_reports.try_report_action(cr, uid, 'action_account_report',wiz_data=data_dict, context=ctx, our_module='account')
-
Print the Account Balance Report in Normal mode through the wizard - From Account Chart
-
@@ -147,18 +138,9 @@
!python {model: account.account}: |
ctx={}
ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]})
- data_dict = {'chart_account_id':ref('account.chart0'),'display_type': False,'target_move': 'all'}
+ data_dict = {'chart_account_id':ref('account.chart0'),'display_type': False,'target_move': 'all', 'account_report_id': ref('account_financial_report_balancesheet0')}
from tools import test_reports
- test_reports.try_report_action(cr, uid, 'action_account_pl_report',wiz_data=data_dict, context=ctx, our_module='account')
--
- Print the Profit-Loss Report in Horizontal Mode
--
- !python {model: account.account}: |
- ctx={}
- ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]})
- data_dict = {'chart_account_id':ref('account.chart0'),'display_type': True,'target_move': 'all'}
- from tools import test_reports
- test_reports.try_report_action(cr, uid, 'action_account_pl_report',wiz_data=data_dict, context=ctx, our_module='account')
+ test_reports.try_report_action(cr, uid, 'action_account_report',wiz_data=data_dict, context=ctx, our_module='account')
-
Print the Analytic Balance Report through the wizard
-
diff --git a/addons/account/wizard/__init__.py b/addons/account/wizard/__init__.py
index d82eff62142..a78cf12050b 100644
--- a/addons/account/wizard/__init__.py
+++ b/addons/account/wizard/__init__.py
@@ -64,8 +64,6 @@ import account_report_account_balance
import account_change_currency
-import account_report_balance_sheet
-import account_report_profit_loss
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/wizard/account_financial_report.py b/addons/account/wizard/account_financial_report.py
index de9cae3a00c..92c623a9524 100644
--- a/addons/account/wizard/account_financial_report.py
+++ b/addons/account/wizard/account_financial_report.py
@@ -38,9 +38,19 @@ class accounting_report(osv.osv_memory):
'date_to_cmp': fields.date("End Date"),
}
+ def _get_account_report(self, cr, uid, context=None):
+ menu_obj = self.pool.get('ir.ui.menu')
+ report_obj = self.pool.get('account.financial.report')
+ report_ids = []
+ if context.get('active_id'):
+ menu = menu_obj.browse(cr, uid, context.get('active_id')).name
+ report_ids = report_obj.search(cr, uid, [('name','ilike',menu)])
+ return report_ids and report_ids[0] or False
+
_defaults = {
'filter_cmp': 'filter_no',
'target_move': 'posted',
+ 'account_report_id': _get_account_report,
}
def _build_comparison_context(self, cr, uid, ids, data, context=None):
diff --git a/addons/account/wizard/account_financial_report_view.xml b/addons/account/wizard/account_financial_report_view.xml
index 1472da4ba87..4be6fb5e95c 100644
--- a/addons/account/wizard/account_financial_report_view.xml
+++ b/addons/account/wizard/account_financial_report_view.xml
@@ -40,6 +40,24 @@
new
+
+
+
+
+
+