[ADD] account: Added new object account.report for printing reports.

bzr revid: uco@tinyerp.com-20110811110847-telg63rtz0bshdry
This commit is contained in:
Ujjvala Collins (OpenERP) 2011-08-11 16:38:47 +05:30
parent 5492bc8cf2
commit 27a0a2c059
4 changed files with 103 additions and 0 deletions

View File

@ -98,6 +98,7 @@ module named account_voucher.
'wizard/account_reconcile_view.xml',
'wizard/account_reconcile_partner_process_view.xml',
'wizard/account_automatic_reconcile_view.xml',
'wizard/account_report_view.xml',
'project/wizard/project_account_analytic_line_view.xml',
'account_end_fy.xml',
'account_invoice_view.xml',

View File

@ -47,6 +47,7 @@ import account_open_closed_fiscalyear
import account_invoice_state
import account_chart
import account_tax_chart
import account_report
#TODO: remove this file no moe used
# also remove related view fiel

View File

@ -0,0 +1,45 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# 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 <http://www.gnu.org/licenses/>.
#
##############################################################################
from osv import fields, osv
class account_report(osv.osv_memory):
_name = "account.report"
_inherit = "account.common.report"
_description = "Account Report"
_columns = {
'parent_id': fields.many2one('account.report', 'Report'),
'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of invoice tax."),
'type': fields.selection([
('sum','Sum'),
('accounts','Accounts'),
('account_report','Account Report'),
],'Type'),
'account_ids': fields.many2many('account.account', 'account_account_report', 'report_line_id', 'account_id', 'Accounts'),
'note': fields.text('Notes'),
'account_report_id': fields.many2one('account.report', 'Account Reports'),
'enable_comparison': fields.boolean('Enable Comparison'),
}
account_report()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,56 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="account_report_view" model="ir.ui.view">
<field name="name">Account Report</field>
<field name="model">account.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='chart_account_id']" position="replace">
<field name="account_report_id"/>
<field name="sequence"/>
<field name="type"/>
</xpath>
<xpath expr="//field[@name='target_move']" position="replace">
<field name="enable_comparison"/>
</xpath>
<xpath expr="//notebook/page[@string='Filters']" position="replace">
<page string="Comparison" attrs="{'invisible': [('enable_comparison','=',False)]}">
<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"/>
<field name="date_to" attrs="{'readonly':[('filter', '!=', 'filter_date')], 'required':[('filter', '=', 'filter_date')]}" colspan="4"/>
<separator string="Periods" colspan="4"/>
<field name="period_from" domain="[('fiscalyear_id', '=', fiscalyear_id)]" attrs="{'readonly':[('filter','!=','filter_period')], 'required':[('filter', '=', 'filter_period')]}" colspan="4"/>
<field name="period_to" domain="[('fiscalyear_id', '=', fiscalyear_id)]" attrs="{'readonly':[('filter','!=','filter_period')], 'required':[('filter', '=', 'filter_period')]}" colspan="4"/>
</page>
</xpath>
<xpath expr="//notebook/page[@string='Journals']" position="replace">
<page string="Accounts">
<field name="account_ids" nolabel="1"/>
</page>
</xpath>
</field>
</record>
<record id="action_account_report" model="ir.actions.act_window">
<field name="name">Mail Report</field>
<field name="res_model">account.report</field>
<field name="type">ir.actions.act_window</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="view_id" ref="account_report_view"/>
<field name="target">new</field>
</record>
<menuitem icon="STOCK_PRINT"
name="Mail Report"
action="action_account_report"
groups="group_account_user,group_account_manager"
id="menu_account_report"
parent="final_accounting_reports"/>
</data>
</openerp>