[IMP] account:

* Removed 'note' field from financial report object.
* Coverted Display detail field to selection type from boolean.

bzr revid: uco@tinyerp.com-20111130094648-7tu9vr3md42z2rjl
This commit is contained in:
Ujjvala Collins (OpenERP) 2011-11-30 15:16:48 +05:30
parent 123525aeb5
commit b30c43a88e
4 changed files with 33 additions and 27 deletions

View File

@ -2754,7 +2754,6 @@ class account_financial_report(osv.osv):
'parent_id': fields.many2one('account.financial.report', 'Parent'),
'children_ids': fields.one2many('account.financial.report', 'parent_id', 'Account Report'),
'sequence': fields.integer('Sequence'),
'note': fields.text('Notes'),
'balance': fields.function(_get_balance, 'Balance'),
'level': fields.function(_get_level, string='Level', store=True, type='integer'),
'type': fields.selection([
@ -2764,13 +2763,18 @@ class account_financial_report(osv.osv):
('account_report','Report Value'),
],'Type'),
'account_ids': fields.many2many('account.account', 'account_account_financial_report', 'report_line_id', 'account_id', 'Accounts'),
'display_detail': fields.boolean('Display details', help='Display every account with its balance instead of the sum.'),
'display_detail': fields.selection([
('no_detail','No detail'),
('only_detail','Display children flat'),
('detail_with_hierarchy','Display children with hierarchy')
], 'Display details'),
'account_report_id': fields.many2one('account.financial.report', 'Report Value'),
'account_type_ids': fields.many2many('account.account.type', 'account_account_financial_report_type', 'report_id', 'account_type_id', 'Account Types'),
}
_defaults = {
'type': 'sum',
'display_detail': 'only_detail',
}
account_financial_report()

View File

@ -2768,9 +2768,12 @@ action = pool.get('res.config').next(cr, uid, [], context)
<field name="sequence"/>
<field name="type"/>
</group>
<notebook colspan="4">
<notebook colspan="6">
<page string="Report">
<field name="display_detail" attrs="{'invisible': [('type','!=','accounts')]}"/>
<group colspan="4" col="4">
<field name="display_detail" attrs="{'invisible': [('type','not in',['accounts','account_type'])]}" colspan="2"/>
<label string="" colspan="2"/>
</group>
<newline/>
<field name="account_ids" nolabel="1" colspan="6" attrs="{'invisible': [('type', '!=', 'accounts')]}"/>
<newline/>
@ -2779,9 +2782,6 @@ action = pool.get('res.config').next(cr, uid, [], context)
<field name="account_type_ids" nolabel="1" attrs="{'invisible': [('type', '!=', 'account_type')]}"/>
<newline/>
</page>
<page string="Notes">
<field name="note" nolabel="1" colspan="4"/>
</page>
</notebook>
</form>
</field>

View File

@ -64,13 +64,17 @@ class report_account_common(report_sxw.rml_parse, common_report_header):
vals['balance_cmp'] = self.pool.get('account.financial.report').browse(self.cr, self.uid, report.id, context=data['form']['comparison_context']).balance
lines.append(vals)
account_ids = []
if report.type == 'accounts' and report.display_detail and report.account_ids:
account_ids = account_obj._get_children_and_consol(self.cr, self.uid, [x.id for x in report.account_ids])
if report.type == 'accounts' and report.account_ids:
if report.display_detail == 'only_detail':
account_ids = account_obj._get_children_and_consol(self.cr, self.uid, [x.id for x in report.account_ids])
elif report.display_detail == 'detail_with_hierarchy':
account_ids = [x.id for x in report.account_ids]
elif report.type == 'account_type' and report.account_type_ids:
account_ids = account_obj.search(self.cr, self.uid, [('user_type','in', [x.id for x in report.account_type_ids])])
account_ids.sort()
if account_ids:
for account in account_obj.browse(self.cr, self.uid, account_ids, context=data['form']['used_context']):
if account.type != 'view':
if report.display_detail == 'detail_with_hierarchy' or account.type != 'view':
flag = False
vals = {
'name': account.code + ' ' + account.name,

View File

@ -130,15 +130,13 @@
<paraStyle name="terp_level_1_name" fontName="Helvetica-Bold" fontSize="9.0" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_level_1_balance" fontName="Helvetica-Bold" fontSize="9.0" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_level_2_name" fontName="Helvetica-Bold" fontSize="8.0" leftIndent="10.0" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_level_2_balance" fontName="Helvetica-Bold" fontSize="8.0" leftIndent=".0" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_level_3_name" fontName="Helvetica-Bold" fontSize="8.0" leftIndent="20.0" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_level_3_balance" fontName="Helvetica-Bold" fontSize="8.0" leftIndent=".0" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_level_2_balance" fontName="Helvetica-Bold" fontSize="8.0" leftIndent="10.0" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_level_3_name" fontName="Helvetica" fontSize="8.0" leftIndent="20.0" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_level_3_name_bold" fontName="Helvetica-Bold" fontSize="8.0" leftIndent="20.0" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_level_3_balance" fontName="Helvetica" fontSize="8.0" leftIndent="0.0" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_level_3_balance_bold" fontName="Helvetica-Bold" fontSize="8.0" leftIndent="0.0" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_level_4_name" fontName="Helvetica" fontSize="8.0" leftIndent="30.0" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_level_4_balance" fontName="Helvetica" fontSize="8.0" leftIndent="0.0" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_level_5_name" fontName="Helvetica" fontSize="8.0" leftIndent="40.0" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_level_5_balance" fontName="Helvetica-Oblique" fontSize="8.0" leftIndent="0.0" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_level_6_name" fontName="Helvetica" fontSize="8.0" leftIndent="50.0" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_level_6_balance" fontName="Helvetica" fontSize="8.0" leftIndent="0.0" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
<paraStyle name="terp_level_4_name_bold" fontName="Helvetica-Bold" fontSize="8.0" leftIndent="30.0" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
<blockTableStyle id="Table1">
<blockTopPadding start="0,0" stop="-1,0" length="15"/>
@ -229,13 +227,13 @@
<para style="terp_tblheader_Details_Right">Balance</para>
</td>
</tr>
<tr style="Table1">
<tr style="Table3">
[[ repeatIn(get_lines(data), 'a') ]]
[[ (a.get('level') &lt;&gt; 0) or removeParentNode('tr') ]]
[[ setTag('tr','tr',{'style': 'Table'+str(min(3,'level' in a and a.get('level') or 1))}) ]]
<td><para style="terp_level_1_name">[[ setTag('para','para',{'style': 'terp_level_'+str(min(6,a['level']))+'_name'}) ]] [[ a.get('name') ]]</para></td>
<td>[[ a.get('level') == 4 or removeParentNode('td') ]]<para style="terp_level_1_balance"><u>[[ setTag('para','para',{'style': 'terp_level_'+str(min(6,a['level']))+'_balance'}) ]][[ formatLang(a.get('balance'))]] [[company.currency_id.symbol]]</u></para></td>
<td>[[ a.get('level') &lt;&gt; 4 or removeParentNode('td') ]]<para style="terp_level_1_balance">[[ setTag('para','para',{'style': 'terp_level_'+str(min(6,a['level']))+'_balance'}) ]][[ formatLang(a.get('balance'))]] [[company.currency_id.symbol]]</para></td>
<td><para style="terp_level_3_name">[[ (a.get('account_type') =='view' and a.get('level') &gt;= 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') ]]</para></td>
<td>[[ (a.get('level') &lt;&gt;2) or removeParentNode('td') ]]<para style="terp_level_3_balance">[[ (a.get('account_type') =='view' and a.get('level') &gt;= 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) ]]</para></td>
<td>[[ a.get('level') == 2 or removeParentNode('td') ]]<para style="terp_level_2_balance"><u>[[ formatLang(a.get('balance'), currency_obj = company.currency_id) ]]</u></para></td>
</tr>
</blockTable>
<para style="Standard">
@ -258,11 +256,11 @@
[[ repeatIn(get_lines(data), 'a') ]]
[[ (a.get('level') &lt;&gt; 0) or removeParentNode('tr') ]]
[[ setTag('tr','tr',{'style': 'Table'+str(min(3,'level' in a and a.get('level') or 1))}) ]]
<td><para style="terp_level_1_name">[[ setTag('para','para',{'style': 'terp_level_'+str(min(6,a['level']))+'_name'}) ]] [[ a.get('name') ]]</para></td>
<td>[[ a.get('level') == 4 or removeParentNode('td') ]]<para style="terp_level_1_balance"><u>[[ setTag('para','para',{'style': 'terp_level_'+str(min(6,a['level']))+'_balance'}) ]][[ formatLang(a.get('balance'))]] [[company.currency_id.symbol]]</u></para></td>
<td>[[ a.get('level') &lt;&gt; 4 or removeParentNode('td') ]]<para style="terp_level_1_balance">[[ setTag('para','para',{'style': 'terp_level_'+str(min(6,a['level']))+'_balance'}) ]][[ formatLang(a.get('balance'))]] [[company.currency_id.symbol]]</para></td>
<td>[[ a.get('level') == 4 or removeParentNode('td') ]]<para style="terp_level_1_balance"><u>[[ setTag('para','para',{'style': 'terp_level_'+str(min(6,a['level']))+'_balance'}) ]][[ formatLang(a.get('balance_cmp'))]] [[company.currency_id.symbol]]</u></para></td>
<td>[[ a.get('level') &lt;&gt; 4 or removeParentNode('td') ]]<para style="terp_level_1_balance">[[ setTag('para','para',{'style': 'terp_level_'+str(min(6,a['level']))+'_balance'}) ]][[ formatLang(a.get('balance_cmp'))]] [[company.currency_id.symbol]]</para></td>
<td><para style="terp_level_3_name">[[ (a.get('account_type') =='view' and a.get('level') &gt;= 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') ]]</para></td>
<td>[[ (a.get('level') &lt;&gt;2) or removeParentNode('td') ]]<para style="terp_level_3_balance">[[ (a.get('account_type') =='view' and a.get('level') &gt;= 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) ]]</para></td>
<td>[[ a.get('level') == 2 or removeParentNode('td') ]]<para style="terp_level_2_balance"><u>[[ formatLang(a.get('balance'), currency_obj = company.currency_id) ]]</u></para></td>
<td>[[ (a.get('level') &lt;&gt;2) or removeParentNode('td') ]]<para style="terp_level_3_balance">[[ (a.get('account_type') =='view' and a.get('level') &gt;= 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) ]]</para></td>
<td>[[ a.get('level') == 2 or removeParentNode('td') ]]<para style="terp_level_2_balance"><u>[[ formatLang(a.get('balance_cmp'), currency_obj = company.currency_id) ]]</u></para></td>
</tr>
</blockTable>
<para style="Standard">