diff --git a/addons/crm/__terp__.py b/addons/crm/__terp__.py
index 5ef83f99cbe..50ed460729a 100644
--- a/addons/crm/__terp__.py
+++ b/addons/crm/__terp__.py
@@ -44,8 +44,7 @@ The CRM module has a email gateway for the synchronisation interface
between mails and Open ERP.""",
'author': 'Tiny',
'website': 'http://www.openerp.com',
- 'depends': ['base',
- 'caldav',
+ 'depends': ['base',
'process',
'mail_gateway',
],
diff --git a/addons/crm/crm_meeting.py b/addons/crm/crm_meeting.py
index 192fcd7c94f..396c9758b07 100644
--- a/addons/crm/crm_meeting.py
+++ b/addons/crm/crm_meeting.py
@@ -21,6 +21,8 @@
from osv import fields, osv
import crm
+from datetime import datetime, timedelta
+from datetime import datetime, timedelta
class crm_opportunity(osv.osv):
_name = 'crm.opportunity'
@@ -32,7 +34,27 @@ class crm_meeting(osv.osv):
_name = 'crm.meeting'
_description = "Meeting Cases"
_order = "id desc"
- _inherit = ["crm.case", "calendar.event"]
+ _inherit = "crm.case"
+
+ def _get_duration(self, cr, uid, ids, name, arg, context):
+ res = {}
+ for event in self.browse(cr, uid, ids, context=context):
+ start = datetime.strptime(event.date, "%Y-%m-%d %H:%M:%S")
+ res[event.id] = 0
+ if event.date_deadline:
+ end = datetime.strptime(event.date_deadline[:19], "%Y-%m-%d %H:%M:%S")
+ diff = end - start
+ duration = float(diff.days)* 24 + (float(diff.seconds) / 3600)
+ res[event.id] = round(duration, 2)
+ return res
+
+ def _set_duration(self, cr, uid, id, name, value, arg, context):
+ event = self.browse(cr, uid, id, context=context)
+ start = datetime.strptime(event.date, "%Y-%m-%d %H:%M:%S")
+ end = start + timedelta(hours=value)
+ cr.execute("UPDATE %s set date_deadline='%s' \
+ where id=%s"% (self._table, end.strftime("%Y-%m-%d %H:%M:%S"), id))
+ return True
_columns = {
'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority'),
@@ -41,7 +63,8 @@ class crm_meeting(osv.osv):
('object_id.model', '=', 'crm.meeting')]", \
help='Category related to the section.Subdivide the CRM cases \
independently or section-wise.'),
- 'attendee_ids': fields.many2many('calendar.attendee', 'event_attendee_rel', 'event_id', 'attendee_id', 'Attendees'),
+ 'duration': fields.function(_get_duration, method=True, \
+ fnct_inv=_set_duration, string='Duration'),
'phonecall_id':fields.many2one ('crm.phonecall', 'Phonecall'),
'opportunity_id':fields.many2one ('crm.opportunity', 'Opportunity'),
}
diff --git a/addons/crm/crm_meeting_data.xml b/addons/crm/crm_meeting_data.xml
index 58982e4dc6c..0b8da1389bf 100644
--- a/addons/crm/crm_meeting_data.xml
+++ b/addons/crm/crm_meeting_data.xml
@@ -20,333 +20,6 @@
Phone Call
-
-
-
- Case Meeting
- crm.meeting
-
-
-
-
-
-
- Meetings
-
-
-
- vevent
-
-
- [('user_id','=', uid)]
-
-
-
- valarm
-
-
-
-
-
- attendee
-
-
-
-
-
-
-
-
- field
-
-
-
-
-
-
- field
-
-
-
-
-
-
- field
-
-
-
-
-
-
- field
-
-
-
-
-
-
- field
-
-
-
-
-
-
- field
-
-
-
-
-
-
- field
-
-
-
-
-
-
- field
- {'1': '1', '2': '2', '3': '2','4': '2', '5': '3', '6': '4', '7': '4', '8': '4', '9': '5'}
-
-
-
-
-
-
-
- field
-
-
-
-
-
-
- field
-
-
-
-
-
-
- {'tentative': 'draft', 'confirmed': 'open', 'cancelled': 'cancel'}
- field
-
-
-
-
-
-
- field
-
-
-
-
-
-
- field
-
-
-
-
-
-
- field
-
-
-
-
-
-
- field
-
-
-
-
-
-
- field
-
-
-
-
-
-
- field
-
-
-
-
-
-
- field
-
-
-
-
-
-
- field
-
-
-
-
-
-
-
-
- field
-
-
-
-
-
-
- field
-
-
-
-
-
-
- field
-
-
-
-
-
-
- field
-
-
-
-
-
-
- field
-
-
-
-
-
-
- field
-
-
-
-
-
-
- field
-
-
-
-
-
-
- field
-
-
-
-
-
-
- field
-
-
-
-
-
-
- field
-
-
-
-
-
-
- field
-
-
-
-
-
-
-
- field
-
-
-
-
-
-
- field
-
-
-
-
-
-
- field
-
-
-
-
-
-
- field
-
-
-
-
-
-
- field
-
-
-
-
-
-
- field
-
-
-
-
-
-
- field
-
-
-
-
-
-
- field
-
-
-
-
-
-
- field
-
-
-
-
-
-
- field
-
-
-
-
-
-
- field
-
-
-
-
+
diff --git a/addons/crm/crm_meeting_menu.xml b/addons/crm/crm_meeting_menu.xml
index a4c894d7a0a..a52f3b5b297 100644
--- a/addons/crm/crm_meeting_menu.xml
+++ b/addons/crm/crm_meeting_menu.xml
@@ -116,22 +116,7 @@
ALL MEETINGS
-->
-
-
-
- Meeting Invitations
- ir.actions.act_window
- calendar.attendee
- form
- tree,form
-
- [('ref','like','crm.meeting,')]
- {'default_sent_by_uid': uid}
-
-
-
+
diff --git a/addons/crm/crm_meeting_view.xml b/addons/crm/crm_meeting_view.xml
index 78a0fc6e776..5adcf8856e6 100644
--- a/addons/crm/crm_meeting_view.xml
+++ b/addons/crm/crm_meeting_view.xml
@@ -24,84 +24,41 @@
crm.meeting
form
-
@@ -111,7 +68,7 @@
crm.meeting
tree
-
+
@@ -119,10 +76,7 @@
-
-
-
-
+
diff --git a/addons/crm/crm_meeting_wizard.xml b/addons/crm/crm_meeting_wizard.xml
index e53d3117ebb..41d8d37da0c 100644
--- a/addons/crm/crm_meeting_wizard.xml
+++ b/addons/crm/crm_meeting_wizard.xml
@@ -1,18 +1,6 @@
-
-
-
-
-
-
-
+
diff --git a/addons/crm_caldav/__init__.py b/addons/crm_caldav/__init__.py
new file mode 100644
index 00000000000..e0b36eaac3d
--- /dev/null
+++ b/addons/crm_caldav/__init__.py
@@ -0,0 +1,30 @@
+# -*- 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 crm_meeting
+
+
+
+
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/crm_caldav/__terp__.py b/addons/crm_caldav/__terp__.py
new file mode 100644
index 00000000000..19357a428be
--- /dev/null
+++ b/addons/crm_caldav/__terp__.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 .
+#
+##############################################################################
+
+
+{
+ 'name': 'Extened Module to Add CalDav future on Meeting',
+ 'version': '1.0',
+ 'category': 'Generic Modules/CRM & SRM',
+ 'description': """
+ New Futures in Meeting:
+ * Recurrent meeting
+ * Alarms
+ * Invitation facility
+ * Share meeting with other calendar clients like sunbird
+""",
+ 'author': 'Tiny',
+ 'website': 'http://www.openerp.com',
+ 'depends': ['base',
+ 'caldav',
+ 'crm',
+ 'mail_gateway',
+ ],
+ 'init_xml': [
+ 'crm_meeting_data.xml',
+ ],
+
+ 'update_xml': [
+ 'crm_meeting_wizard.xml',
+ 'crm_meeting_view.xml',
+ 'crm_meeting_menu.xml',
+ ],
+ 'demo_xml': [],
+ 'installable': True,
+ 'active': False,
+}
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/crm_caldav/crm_meeting.py b/addons/crm_caldav/crm_meeting.py
new file mode 100644
index 00000000000..be7ba346c26
--- /dev/null
+++ b/addons/crm_caldav/crm_meeting.py
@@ -0,0 +1,45 @@
+# -*- 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 .
+#
+##############################################################################
+
+from osv import fields, osv
+from crm import crm
+class crm_meeting(osv.osv):
+ _name = 'crm.meeting'
+ _description = "Meetings"
+ _order = "id desc"
+ _inherit = ["crm.case", "calendar.event"]
+
+ _columns = {
+ 'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority'),
+ 'categ_id': fields.many2one('crm.case.categ', 'Category', \
+ domain="[('section_id','=',section_id),\
+ ('object_id.model', '=', 'crm.meeting')]", \
+ help='Category related to the section.Subdivide the CRM cases \
+independently or section-wise.'),
+ 'phonecall_id':fields.many2one ('crm.phonecall', 'Phonecall'),
+ 'opportunity_id':fields.many2one ('crm.opportunity', 'Opportunity'),
+ 'attendee_ids': fields.many2many('calendar.attendee', 'event_attendee_rel', 'event_id', 'attendee_id', 'Attendees'),
+
+ }
+
+crm_meeting()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/crm_caldav/crm_meeting_data.xml b/addons/crm_caldav/crm_meeting_data.xml
new file mode 100644
index 00000000000..ae7315da835
--- /dev/null
+++ b/addons/crm_caldav/crm_meeting_data.xml
@@ -0,0 +1,331 @@
+
+
+
+
+
+ Case Meeting
+ crm.meeting
+
+
+
+
+
+ Meetings
+
+
+
+ vevent
+
+
+ [('user_id','=', uid)]
+
+
+
+ valarm
+
+
+
+
+
+ attendee
+
+
+
+
+
+
+
+
+ field
+
+
+
+
+
+
+ field
+
+
+
+
+
+
+ field
+
+
+
+
+
+
+ field
+
+
+
+
+
+
+ field
+
+
+
+
+
+
+ field
+
+
+
+
+
+
+ field
+
+
+
+
+
+
+ field
+ {'1': '1', '2': '2', '3': '2','4': '2', '5': '3', '6': '4', '7': '4', '8': '4', '9': '5'}
+
+
+
+
+
+
+
+ field
+
+
+
+
+
+
+ field
+
+
+
+
+
+
+ {'tentative': 'draft', 'confirmed': 'open', 'cancelled': 'cancel'}
+ field
+
+
+
+
+
+
+ field
+
+
+
+
+
+
+ field
+
+
+
+
+
+
+ field
+
+
+
+
+
+
+ field
+
+
+
+
+
+
+ field
+
+
+
+
+
+
+ field
+
+
+
+
+
+
+ field
+
+
+
+
+
+
+ field
+
+
+
+
+
+
+
+
+ field
+
+
+
+
+
+
+ field
+
+
+
+
+
+
+ field
+
+
+
+
+
+
+ field
+
+
+
+
+
+
+ field
+
+
+
+
+
+
+ field
+
+
+
+
+
+
+ field
+
+
+
+
+
+
+ field
+
+
+
+
+
+
+ field
+
+
+
+
+
+
+ field
+
+
+
+
+
+
+ field
+
+
+
+
+
+
+
+ field
+
+
+
+
+
+
+ field
+
+
+
+
+
+
+ field
+
+
+
+
+
+
+ field
+
+
+
+
+
+
+ field
+
+
+
+
+
+
+ field
+
+
+
+
+
+
+ field
+
+
+
+
+
+
+ field
+
+
+
+
+
+
+ field
+
+
+
+
+
+
+ field
+
+
+
+
+
+
+ field
+
+
+
+
+
+
diff --git a/addons/crm_caldav/crm_meeting_menu.xml b/addons/crm_caldav/crm_meeting_menu.xml
new file mode 100644
index 00000000000..7c01fa3415d
--- /dev/null
+++ b/addons/crm_caldav/crm_meeting_menu.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+ Meeting Invitations
+ ir.actions.act_window
+ calendar.attendee
+ form
+ tree,form
+
+ [('ref','like','crm.meeting,')]
+ {'default_sent_by_uid': uid}
+
+
+
+
+
+
+
diff --git a/addons/crm_caldav/crm_meeting_view.xml b/addons/crm_caldav/crm_meeting_view.xml
new file mode 100644
index 00000000000..16e1423456a
--- /dev/null
+++ b/addons/crm_caldav/crm_meeting_view.xml
@@ -0,0 +1,92 @@
+
+
+
+
+
+ CRM - Meetings Form Inherit1
+ crm.meeting
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ CRM - Meetings Form Inherit2
+ crm.meeting
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ CRM - Meetings Form Inherit3
+ crm.meeting
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/crm_caldav/crm_meeting_wizard.xml b/addons/crm_caldav/crm_meeting_wizard.xml
new file mode 100644
index 00000000000..e53d3117ebb
--- /dev/null
+++ b/addons/crm_caldav/crm_meeting_wizard.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+