[add] account : convert account_analytic_check wizard to osv_memory wizard

bzr revid: psi@tinyerp.co.in-20100427084747-qh2yvtbqeaah2wl5
This commit is contained in:
psi (Open ERP) 2010-04-27 14:17:47 +05:30
parent bb6b33011c
commit 48aeb52646
5 changed files with 35 additions and 30 deletions

View File

@ -81,7 +81,6 @@ module named account_voucherss
'wizard/account_compare_account_balance_report_view.xml',
'wizard/account_third_party_ledger.xml',
'wizard/account_automatic_reconcile_view.xml',
'project/wizard/project_account_analytic_line_view.xml',
'account_end_fy.xml',
'account_invoice_view.xml',
'partner_view.xml',
@ -90,6 +89,8 @@ module named account_voucherss
'account_invoice_workflow.xml',
'project/project_view.xml',
'project/project_report.xml',
'project/wizard/project_account_analytic_line_view.xml',
'project/wizard/account_analytic_check_view.xml',
'product_view.xml',
'account_assert_test.xml',
'process/statement_process.xml',

View File

@ -28,7 +28,7 @@
<report auto="False" id="account_analytic_account_analytic_check" menu="False" model="account.account" name="account.analytic.account.analytic.check" rml="account/project/report/analytic_check.rml" string="Analytic Check"/>
<wizard id="account_analytic_account_analytic_check_report" keyword="client_print_multi" model="account.account" name="account.analytic.account.analytic.check.report" string="Analytic Check"/>
<!-- <wizard id="account_analytic_account_analytic_check_report" keyword="client_print_multi" model="account.account" name="account.analytic.account.analytic.check.report" string="Analytic Check"/>-->
</data>
</openerp>

View File

@ -18,9 +18,9 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import time
import pooler
import time
from report import report_sxw
class account_analytic_analytic_check(report_sxw.rml_parse):
@ -132,5 +132,4 @@ class account_analytic_analytic_check(report_sxw.rml_parse):
report_sxw.report_sxw('report.account.analytic.account.analytic.check', 'account.analytic.account', 'addons/account/project/report/analytic_check.rml',parser=account_analytic_analytic_check, header=False)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -24,7 +24,7 @@ import wizard_account_analytic_balance_report
import wizard_account_analytic_inverted_balance_report
import wizard_account_analytic_cost_ledger_report
import wizard_account_analytic_cost_ledger_for_journal_report
import wizard_account_analytic_analytic_check
import account_analytic_check
import project_account_analytic_line
import wizard_analytic_account_chart

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@ -15,38 +15,43 @@
# 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/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import time
import wizard
dates_form = '''<?xml version="1.0"?>
<form string="Select period">
<field name="date1"/>
<field name="date2"/>
</form>'''
from osv import osv, fields
dates_fields = {
'date1': {'string':'Start of period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-01-01')},
'date2': {'string':'End of period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')},
}
class account_analytic_check(osv.osv_memory):
_name = 'account.analytic.check'
_description = 'Account Analytic Check'
class wizard_report(wizard.interface):
states = {
'init': {
'actions': [],
'result': {'type':'form', 'arch':dates_form, 'fields':dates_fields, 'state':[('end','Cancel'), ('report','Print')]}
},
'report': {
'actions': [],
'result': {'type':'print', 'report':'account.analytic.account.analytic.check', 'state':'end'}
_columns = {
'date1': fields.date('Start of period', required=True),
'date2': fields.date('End of period', required=True),
}
}
wizard_report('account.analytic.account.analytic.check.report')
_defaults = {
'date1':time.strftime('%Y-01-01'),
'date2':time.strftime('%Y-%m-%d')
}
def check_report(self, cr, uid, ids, context=None):
datas = {}
if context is None:
context = {}
data = self.read(cr, uid, ids)[0]
datas = {
'ids': context.get('active_ids',[]),
'model': 'account.account',
'form': data
}
return {
'type': 'ir.actions.report.xml',
'report_name': 'account.analytic.account.analytic.check',
'datas': datas,
}
account_analytic_check()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: