diff --git a/addons/event_project/__openerp__.py b/addons/event_project/__openerp__.py
index 51be1e29113..20edb735496 100644
--- a/addons/event_project/__openerp__.py
+++ b/addons/event_project/__openerp__.py
@@ -31,7 +31,7 @@
'author': 'Tiny',
'depends': ['project_retro_planning', 'event'],
'init_xml': [],
- 'update_xml': ['event_wizard.xml', 'event_view.xml'],
+ 'update_xml': ['wizard/event_project_view.xml', 'event_view.xml'],
'demo_xml': [],
'installable': True,
'active': False,
diff --git a/addons/event_project/event_view.xml b/addons/event_project/event_view.xml
index 86887faf1d6..45baae0f846 100644
--- a/addons/event_project/event_view.xml
+++ b/addons/event_project/event_view.xml
@@ -13,7 +13,7 @@
-
+
@@ -39,6 +39,15 @@
+
+
diff --git a/addons/event_project/event_wizard.xml b/addons/event_project/event_wizard.xml
index f6cc672c46a..3ba8df59b13 100644
--- a/addons/event_project/event_wizard.xml
+++ b/addons/event_project/event_wizard.xml
@@ -1,18 +1,6 @@
-
-
-
-
diff --git a/addons/event_project/wizard/__init__.py b/addons/event_project/wizard/__init__.py
index a6ed912e137..470e9edbb8b 100644
--- a/addons/event_project/wizard/__init__.py
+++ b/addons/event_project/wizard/__init__.py
@@ -19,8 +19,7 @@
#
##############################################################################
-import project_wizard
-import event_task
+import event_project
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/event_project/wizard/event_project.py b/addons/event_project/wizard/event_project.py
new file mode 100644
index 00000000000..2a91ee55b7c
--- /dev/null
+++ b/addons/event_project/wizard/event_project.py
@@ -0,0 +1,54 @@
+# -*- 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 .
+#
+##############################################################################
+
+#
+# Order Point Method:
+# - Order if the virtual stock of today is bellow the min of the defined order point
+#
+
+from osv import fields, osv
+from tools.translate import _
+import time
+
+class event_project(osv.osv_memory):
+ """
+ Event Project
+ """
+ _name = "event.project"
+ _description = "Event Project"
+
+ _columns = {
+ 'project_id': fields.many2one('project.project', 'Project', domain = [('active', '<>', False), ('state', '=', 'template')], required =True)
+ }
+
+ def create_duplicate(self, cr, uid, ids, context):
+ event_obj=self.pool.get('event.event')
+ project_obj = self.pool.get('project.project')
+
+ for current in self.browse(cr, uid, ids):
+ duplicate_project_id= project_obj.copy(cr, uid, current.project_id.id, {'active': True})
+ project_obj.write(cr, uid, [duplicate_project_id], {'name': "copy of " + project_obj.browse(cr, uid, duplicate_project_id, context).name , 'date_start':time.strftime('%Y-%m-%d'), 'date': event_obj.browse(cr, uid, context.get('active_ids', []))[0].date_begin[0:10] })
+ event_obj.write(cr, uid, context.get('active_ids', []), {'project_id': duplicate_project_id })
+
+ return {}
+
+event_project()
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/event_project/wizard/event_task.py b/addons/event_project/wizard/event_task.py
deleted file mode 100644
index bdf2651e6a4..00000000000
--- a/addons/event_project/wizard/event_task.py
+++ /dev/null
@@ -1,62 +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 pooler
-from tools.translate import _
-
-def _event_tasks(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- mod_obj = pool.get('ir.model.data')
- result = mod_obj._get_id(cr, uid, 'project', 'view_task_search_form')
- id = mod_obj.read(cr, uid, result, ['res_id'])
- event_id = data['id']
- cr.execute('SELECT project_id FROM event_event WHERE id = %s', (event_id, ))
- res = cr.fetchone()
- if not res[0]:
- raise wizard.except_wizard(_('Error !'), _('No project defined for this event.\nYou can create one with the retro-planning button !'))
- value = {
- 'domain': [('project_id', '=', res[0])],
- 'name': 'Tasks',
- 'view_type': 'form',
- 'view_mode': 'tree,form,calendar',
- 'res_model': 'project.task',
- 'context': { },
- 'type': 'ir.actions.act_window',
- 'search_view_id': id['res_id']
- }
- return value
-
-class wizard_event_tasks(wizard.interface):
- states = {
- 'init': {
- 'actions': [],
- 'result': {
- 'type': 'action',
- 'action': _event_tasks,
- 'state': 'end'
- }
- },
- }
-wizard_event_tasks("wizard_event_tasks")
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/event_project/wizard/project_wizard.py b/addons/event_project/wizard/project_wizard.py
deleted file mode 100644
index 872cb073712..00000000000
--- a/addons/event_project/wizard/project_wizard.py
+++ /dev/null
@@ -1,67 +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 .
-#
-##############################################################################
-
-#
-# Order Point Method:
-# - Order if the virtual stock of today is bellow the min of the defined order point
-#
-
-import wizard
-import pooler
-
-import time
-
-parameter_form = '''
-'''
-
-parameter_fields = {
- 'project_id': {'string':'Project', 'type':'many2one', 'required':True, 'relation':'project.project', 'domain': [('active','<>',False),('state','=','template')]},
-}
-
-def _create_duplicate(self, cr, uid, data, context):
- event_obj=pooler.get_pool(cr.dbname).get('event.event')
- project_obj = pooler.get_pool(cr.dbname).get('project.project')
- duplicate_project_id= project_obj.copy(cr, uid, data['form']['project_id'], {'active': True})
- project_obj.write(cr, uid, [duplicate_project_id], {'name': "copy of " + project_obj.browse(cr, uid, duplicate_project_id, context).name , 'date_start':time.strftime('%Y-%m-%d'),'date': event_obj.browse(cr, uid, [data['id']])[0].date_begin[0:10] })
- event_obj.write(cr, uid, [data['id']], {'project_id': duplicate_project_id })
- return {}
-
-class wizard_event_project(wizard.interface):
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type': 'form', 'arch':parameter_form, 'fields': parameter_fields, 'state':[('end','Cancel'),('done', 'Ok')]}
-
- },
- 'done':{
- 'actions':[_create_duplicate],
- 'result' : {'type':'state', 'state':'end'}
- }
- }
-wizard_event_project('event.project')
-
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-