diff --git a/addons/account_analytic_plans/__openerp__.py b/addons/account_analytic_plans/__openerp__.py
index d2183563462..0f23bc379be 100644
--- a/addons/account_analytic_plans/__openerp__.py
+++ b/addons/account_analytic_plans/__openerp__.py
@@ -62,7 +62,8 @@ of distribution models.
'security/ir.model.access.csv',
'account_analytic_plans_view.xml',
'account_analytic_plans_report.xml',
- 'wizard/analytic_plan_create_model_view.xml'
+ 'wizard/analytic_plan_create_model_view.xml',
+ 'wizard/account_crossovered_analytic_view.xml'
],
'demo_xml': [],
'installable': True,
diff --git a/addons/account_analytic_plans/account_analytic_plans_report.xml b/addons/account_analytic_plans/account_analytic_plans_report.xml
index 8bed6104b00..ee2bb1e2a87 100644
--- a/addons/account_analytic_plans/account_analytic_plans_report.xml
+++ b/addons/account_analytic_plans/account_analytic_plans_report.xml
@@ -11,12 +11,12 @@
auto="False"
menu="False"/>
-
+ keyword="client_print_multi"/>-->
diff --git a/addons/account_analytic_plans/wizard/__init__.py b/addons/account_analytic_plans/wizard/__init__.py
index 3da1c55b8bf..c91a0251b33 100644
--- a/addons/account_analytic_plans/wizard/__init__.py
+++ b/addons/account_analytic_plans/wizard/__init__.py
@@ -20,6 +20,6 @@
##############################################################################
import analytic_plan_create_model
-import wizard_crossovered_analytic
+import account_crossovered_analytic
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account_analytic_plans/wizard/account_crossovered_analytic.py b/addons/account_analytic_plans/wizard/account_crossovered_analytic.py
new file mode 100644
index 00000000000..2429650a800
--- /dev/null
+++ b/addons/account_analytic_plans/wizard/account_crossovered_analytic.py
@@ -0,0 +1,74 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 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
+
+from osv import osv, fields
+from tools.translate import _
+
+class account_crossovered_analytic(osv.osv_memory):
+ _name = 'account.crossovered.analytic'
+ _description = 'Print Crossovered Analytic'
+ _columns = {
+ 'date1': fields.date('Start Date', required=True),
+ 'date2': fields.date('End Date', required=True),
+ 'journal_ids': fields.many2many('account.analytic.journal', 'crossovered_journal_rel', 'crossover_id', 'journal_id', 'Analytic Journal'),
+ 'ref': fields.many2one('account.analytic.account', 'Analytic Account Reference', required=True),
+ 'empty_line': fields.boolean('Dont show empty lines'),
+ }
+ _defaults = {
+ 'date1': lambda *a: time.strftime('%Y-01-01'),
+ 'date2': lambda *a: time.strftime('%Y-%m-%d'),
+ }
+
+ def print_report(self, cr, uid, ids, context=None):
+ cr.execute('select account_id from account_analytic_line')
+ res = cr.fetchall()
+ acc_ids = [x[0] for x in res]
+
+ data = self.read(cr, uid, ids, [], context=context)[0]
+
+ obj_acc = self.pool.get('account.analytic.account').browse(cr, uid, data['ref'])
+ name = obj_acc.name
+
+ account_ids = self.pool.get('account.analytic.account').search(cr, uid, [('parent_id', 'child_of', [data['ref']])])
+
+ flag = True
+ for acc in account_ids:
+ if acc in acc_ids:
+ flag = False
+ break
+ if flag:
+ raise osv.except_osv(_('User Error'),_('There are no Analytic lines related to Account %s' % name))
+
+ datas = {
+ 'ids': [],
+ 'model': 'account.analytic.account',
+ 'form': data
+ }
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'account.analytic.account.crossovered.analytic',
+ 'datas': datas,
+ }
+
+account_crossovered_analytic()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/account_analytic_plans/wizard/account_crossovered_analytic_view.xml b/addons/account_analytic_plans/wizard/account_crossovered_analytic_view.xml
new file mode 100644
index 00000000000..8c860169f56
--- /dev/null
+++ b/addons/account_analytic_plans/wizard/account_crossovered_analytic_view.xml
@@ -0,0 +1,47 @@
+
+
+
+
+
+ account.crossovered.analytic.form
+ account.crossovered.analytic
+ form
+
+
+
+
+
+
+ Crossovered Analytic
+ ir.actions.act_window
+ account.crossovered.analytic
+ form
+ form
+ new
+
+
+
+
+
+ Crossovered Analytic
+ client_print_multi
+
+ action
+ account.analytic.account
+
+
+
+
\ No newline at end of file
diff --git a/addons/account_analytic_plans/wizard/wizard_crossovered_analytic.py b/addons/account_analytic_plans/wizard/wizard_crossovered_analytic.py
deleted file mode 100644
index 64da1b73b1d..00000000000
--- a/addons/account_analytic_plans/wizard/wizard_crossovered_analytic.py
+++ /dev/null
@@ -1,80 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 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 wizard
-import time
-import datetime
-import pooler
-from tools.translate import _
-
-form = """
-"""
-
-fields = {
- 'date1': {'string':'Start Date', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-01-01')},
- 'date2': {'string':'End Date', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')},
- 'journal_ids': {'string':'Analytic Journal', 'type':'many2many', 'relation':'account.analytic.journal'},
- 'ref' :{'string':'Analytic Account Reference', 'type':'many2one', 'relation':'account.analytic.account','required':True},
- 'empty_line': {'string':'Dont show empty lines', 'type':'boolean', 'default': lambda *a:False},
-}
-
-class wizard_crossovered_analytic(wizard.interface):
- def _checklines(self, cr, uid, data, context):
- cr.execute('select account_id from account_analytic_line')
- res=cr.fetchall()
- acc_ids=[x[0] for x in res]
-
- obj_acc = pooler.get_pool(cr.dbname).get('account.analytic.account').browse(cr,uid,data['form']['ref'])
- name=obj_acc.name
-
- account_ids = pooler.get_pool(cr.dbname).get('account.analytic.account').search(cr, uid, [('parent_id', 'child_of', [data['form']['ref']])])
-
- flag = True
- for acc in account_ids:
- if acc in acc_ids:
- flag = False
- break
-
- if flag:
- raise wizard.except_wizard(_('User Error'),_('There are no Analytic lines related to Account %s' % name))
- return {}
-
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type':'form', 'arch':form, 'fields':fields, 'state':[('end','Cancel'),('print','Print')]},
- },
- 'print': {
- 'actions': [_checklines],
- 'result': {'type':'print', 'report':'account.analytic.account.crossovered.analytic', 'state':'end'},
- },
- }
-
-wizard_crossovered_analytic('wizard.crossovered.analytic')
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-