[IMP] account: Several changes in field names and object names. Views improved.

bzr revid: uco@tinyerp.com-20110823102156-beq4imusow5ligxc
This commit is contained in:
Ujjvala Collins (OpenERP) 2011-08-23 15:51:56 +05:30
parent 5989085e5a
commit d37d1595a8
4 changed files with 24 additions and 17 deletions

View File

@ -56,7 +56,7 @@ class report_account_common(report_sxw.rml_parse, common_report_header):
balance = 0.0
name = data['form'].get('account_report_id') and data['form']['account_report_id'][1] or ''
report_id = data['form'].get('account_report_id') and data['form']['account_report_id'][0] or False
datas.append({'id': report_id})
datas.append({'id': report_id, 'label': data['form']['label_filter'] or ''})
ctx = self.context.copy()
if report_id:
child_ids = report_obj.search(cr, uid, [('parent_id','=',report_id)])
@ -108,6 +108,6 @@ class report_account_common(report_sxw.rml_parse, common_report_header):
balance += a.balance
return balance
report_sxw.report_sxw('report.account.common', 'account.account',
report_sxw.report_sxw('report.accounting.report', 'account.account',
'addons/account/report/account_report_common.rml', parser=report_account_common, header='internal')

View File

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<document filename="Account Reports.pdf">
<template pageSize="(595.0,842.0)" title="Account Reports" author="OpenERP S.A. (sales@openerp.com)" allowSplitting="20">
<document filename="Financial Report.pdf">
<template pageSize="(595.0,842.0)" title="Financial Report" author="OpenERP S.A. (sales@openerp.com)" allowSplitting="20">
<pageTemplate id="first">
<frame id="first" x1="28.0" y1="28.0" width="539" height="786"/>
</pageTemplate>
@ -246,7 +246,7 @@
<para style="terp_tblheader_Details_Right">Balance</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">Filtered Balance</para>
<para style="terp_tblheader_Details_Right">[[ r['label'] ]]</para>
</td>
</tr>
<tr style="Table3">

View File

@ -24,18 +24,19 @@ from osv import fields, osv
class accounting_report(osv.osv_memory):
_name = "accounting.report"
_inherit = "account.common.report"
_description = "Account Report"
_description = "Accounting Report"
_columns = {
'comparison': fields.boolean('Enable Comparison'),
'account_details': fields.boolean('Details by Account'),
'enable_filter': fields.boolean('Enable Comparison'),
'account_details': fields.boolean('Details by Account', help="Print Report with the account details."),
'account_report_id': fields.many2one('account.report', 'Account Reports', required=True),
'label_filter': fields.char('Label', size=32, help="This label will be displayed on report to show the balance computed for the given comparison filter."),
}
def _print_report(self, cr, uid, ids, data, context=None):
data['form'].update(self.read(cr, uid, ids, ['account_report_id', 'comparison', 'account_details'], context=context)[0])
data['form'].update(self.read(cr, uid, ids, ['account_report_id', 'enable_filter', 'account_details', 'label_filter'], context=context)[0])
return {
'type': 'ir.actions.report.xml',
'report_name': 'account.common',
'report_name': 'accounting.report',
'datas': data,
}

View File

@ -3,18 +3,23 @@
<data>
<record id="accounting_report_view" model="ir.ui.view">
<field name="name">Account Report</field>
<field name="name">Accounting Report</field>
<field name="model">accounting.report</field>
<field name="type">form</field>
<field name="inherit_id" ref="account.account_common_report_view"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='target_move']" position="after">
<xpath expr="//field[@name='fiscalyear_id']" position="replace">
</xpath>
<xpath expr="//field[@name='target_move']" position="replace">
<field name="account_report_id" domain="[('parent_id','=',False)]"/>
<field name="comparison"/>
<field name="label_filter"/>
<field name="account_details"/>
<field name="enable_filter"/>
</xpath>
<xpath expr="//notebook/page[@string='Filters']" position="replace">
<page string="Comparison" attrs="{'invisible': [('comparison','=',False)]}">
<page string="Comparison" attrs="{'invisible': [('enable_filter','=',False)]}">
<field name="fiscalyear_id"/>
<field name="target_move"/>
<field name="filter" on_change="onchange_filter(filter, fiscalyear_id)" colspan="4"/>
<separator string="Dates" colspan="4"/>
<field name="date_from" attrs="{'readonly':[('filter', '!=', 'filter_date')], 'required':[('filter', '=', 'filter_date')]}" colspan="4"/>
@ -30,7 +35,7 @@
</record>
<record id="action_account_report" model="ir.actions.act_window">
<field name="name">Account Report</field>
<field name="name">Financial Report</field>
<field name="res_model">accounting.report</field>
<field name="type">ir.actions.act_window</field>
<field name="view_type">form</field>
@ -40,11 +45,12 @@
</record>
<menuitem icon="STOCK_PRINT"
name="Report"
name="Financial Report"
action="action_account_report"
groups="group_account_user,group_account_manager"
id="menu_account_report"
parent="final_accounting_reports"/>
parent="final_accounting_reports"
sequence="100"/>
</data>
</openerp>