[IMP+FIX] caldav, crm: make new object crm.meeting and apply caldav in this new object
bzr revid: hmo@tinyerp.com-20091229084804-015hpsppm66ypssj
This commit is contained in:
@@ -1,6 +1,89 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="caldav_attendee_form_view" model="ir.ui.view">
|
||||
<field name="name">crm.case.caldav.attendee</field>
|
||||
<field name="model">crm.caldav.attendee</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Atendee details">
|
||||
<field name="cutype" select="1"/>
|
||||
<field name="member"/>
|
||||
<field name="role" select="1"/>
|
||||
<field name="partstat"/>
|
||||
<field name="rsvp"/>
|
||||
<field name="delegated_to" select="1"/>
|
||||
<field name="delegated_from" select="1"/>
|
||||
<field name="sent_by"/>
|
||||
<field name="cn" select="1"/>
|
||||
<field name="dir"/>
|
||||
<field name="language"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="caldav_attendee_tree_view" model="ir.ui.view">
|
||||
<field name="name">crm.case.caldav.attendee</field>
|
||||
<field name="model">crm.caldav.attendee</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Atendee details">
|
||||
<field name="cutype" select="1"/>
|
||||
<field name="member"/>
|
||||
<field name="role" select="1"/>
|
||||
<field name="partstat"/>
|
||||
<field name="rsvp"/>
|
||||
<field name="delegated_to" select="1"/>
|
||||
<field name="delegated_from" select="1"/>
|
||||
<field name="sent_by"/>
|
||||
<field name="cn" select="1"/>
|
||||
<field name="dir"/>
|
||||
<field name="language"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="caldav_alarm_form_view" model="ir.ui.view">
|
||||
<field name="name">crm.case.caldav.alarm.form</field>
|
||||
<field name="model">crm.caldav.alarm</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Alarm details">
|
||||
<field name="action"/>
|
||||
<field name="name" select="1" attrs="{'required' : [('action','in',('EMAIL', 'DISPLAY'))]}"/>
|
||||
<separator string="Description" colspan="4"/>
|
||||
<field name="description" colspan="4" nolabel="1" attrs="{'required' : [('action','in',('EMAIL'))]}"/>
|
||||
<group string="Reminder details" col="4" colspan="4">
|
||||
<field name="trigger_duration" nolabel="1" select="1"/>
|
||||
<field name="trigger_interval" nolabel="1" select="1"/>
|
||||
<field name="trigger_occurs" nolabel="1" select="1"/>
|
||||
<field name="trigger_related" nolabel="1" select="1"/>
|
||||
</group>
|
||||
<field name="duration"/>
|
||||
<field name="repeat"/>
|
||||
<field name="attach" colspan="4" attrs="{'required' : [('action','in',('AUDIO', 'PROCEDURE'))]}"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="caldav_alarm_tree_view" model="ir.ui.view">
|
||||
<field name="name">crm.case.caldav.alarm.tree</field>
|
||||
<field name="model">crm.caldav.alarm</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Alarm details">
|
||||
<field name="name" select="1"/>
|
||||
<field name="action"/>
|
||||
<field name="trigger_interval" select="1"/>
|
||||
<field name="trigger_duration" select="1"/>
|
||||
<field name="trigger_related" select="1"/>
|
||||
<field name="trigger_occurs" select="1"/>
|
||||
<field name="active"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_caldav_set_rrule_wizard" model="ir.ui.view">
|
||||
<field name="name">Add RRule</field>
|
||||
<field name="model">caldav.set.rrule</field>
|
||||
|
||||
@@ -309,7 +309,7 @@ class set_rrule_wizard(osv.osv_memory):
|
||||
else:
|
||||
model = context.get('model')
|
||||
obj = self.pool.get(model)
|
||||
res_obj = obj.browse(cr, uid, context['active_id'])[0]
|
||||
res_obj = obj.browse(cr, uid, context['active_id'])
|
||||
weekdays = ['mo', 'tu', 'we', 'th', 'fr', 'sa', 'su']
|
||||
weekstring = ''
|
||||
monthstring = ''
|
||||
@@ -362,4 +362,4 @@ class set_rrule_wizard(osv.osv_memory):
|
||||
|
||||
set_rrule_wizard()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
import crm
|
||||
import crm_segmentation
|
||||
import crm_calendar
|
||||
import crm_meeting
|
||||
import crm_config
|
||||
|
||||
import report
|
||||
|
||||
@@ -48,7 +48,7 @@ between mails and Open ERP.""",
|
||||
'caldav',
|
||||
'process'
|
||||
],
|
||||
'init_xml': ['crm_data.xml'
|
||||
'init_xml': ['crm_data.xml', 'crm_meeting_data.xml'
|
||||
],
|
||||
'update_xml': [
|
||||
'crm_wizard.xml',
|
||||
@@ -57,8 +57,10 @@ between mails and Open ERP.""",
|
||||
'crm_config_view.xml',
|
||||
'crm_bugs_view.xml',
|
||||
'crm_jobs_view.xml',
|
||||
'crm_lead_view.xml',
|
||||
'crm_lead_view.xml',
|
||||
'crm_meeting_wizard.xml',
|
||||
'crm_meeting_view.xml',
|
||||
'crm_meeting_menu.xml',
|
||||
'crm_opportunity_view.xml',
|
||||
'crm_fund_view.xml',
|
||||
'crm_claims_view.xml',
|
||||
@@ -70,7 +72,7 @@ between mails and Open ERP.""",
|
||||
'security/ir.model.access.csv',
|
||||
'process/crm_configuration_process.xml'
|
||||
],
|
||||
'demo_xml': ['crm_demo.xml'],
|
||||
'demo_xml': ['crm_demo.xml', 'crm_meeting_demo.xml'],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '0079056041421',
|
||||
|
||||
@@ -1105,47 +1105,5 @@ class crm_email_add_cc_wizard(osv.osv_memory):
|
||||
return {}
|
||||
|
||||
crm_email_add_cc_wizard()
|
||||
|
||||
|
||||
class crm_calendar_config_wizard(osv.osv_memory):
|
||||
_name = 'crm.calendar.config_wizard'
|
||||
_columns = {
|
||||
'name': fields.char('Name', size=64),
|
||||
'caldav': fields.boolean('Caldav Properties View', help="Manages the fields required for Caldav Properties.")
|
||||
}
|
||||
|
||||
def action_create(self, cr, uid, ids, context=None):
|
||||
res = self.read(cr, uid, ids)[0]
|
||||
idref = {}
|
||||
if res['caldav']:
|
||||
for fname in ('view', 'wizard', 'data'):
|
||||
try:
|
||||
fp = tools.file_open(os.path.join('crm', 'crm_caldav_' + fname + '.xml'))
|
||||
except IOError, e:
|
||||
fp = None
|
||||
if fp:
|
||||
tools.convert_xml_import(cr, 'crm', fp, idref, 'init', noupdate=True)
|
||||
cr.commit()
|
||||
|
||||
return {
|
||||
'view_type': 'form',
|
||||
"view_mode": 'form',
|
||||
'res_model': 'ir.actions.configuration.wizard',
|
||||
'type': 'ir.actions.act_window',
|
||||
'target': 'new',
|
||||
}
|
||||
|
||||
def action_cancel(self, cr, uid, ids, context=None):
|
||||
return {
|
||||
'view_type': 'form',
|
||||
"view_mode": 'form',
|
||||
'res_model': 'ir.actions.configuration.wizard',
|
||||
'type': 'ir.actions.act_window',
|
||||
'target': 'new',
|
||||
}
|
||||
|
||||
crm_calendar_config_wizard()
|
||||
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data noupdate="1">
|
||||
<record forcecreate="True" id="ir_cron_scheduler_alarm"
|
||||
model="ir.cron">
|
||||
<field name="name">Run Event Reminder</field>
|
||||
<field eval="True" name="active" />
|
||||
<field name="user_id" ref="base.user_root" />
|
||||
<field name="interval_number">1</field>
|
||||
<field name="interval_type">days</field>
|
||||
<field name="numbercall">-1</field>
|
||||
<field eval="False" name="doall" />
|
||||
<field eval="'crm.case'" name="model" />
|
||||
<field eval="'run_scheduler'" name="function" />
|
||||
<field eval="'(False,)'" name="args" />
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -1,144 +0,0 @@
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="caldav_attendee_form_view" model="ir.ui.view">
|
||||
<field name="name">crm.case.caldav.attendee</field>
|
||||
<field name="model">crm.caldav.attendee</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Atendee details">
|
||||
<field name="cutype" select="1"/>
|
||||
<field name="member"/>
|
||||
<field name="role" select="1"/>
|
||||
<field name="partstat"/>
|
||||
<field name="rsvp"/>
|
||||
<field name="delegated_to" select="1"/>
|
||||
<field name="delegated_from" select="1"/>
|
||||
<field name="sent_by"/>
|
||||
<field name="cn" select="1"/>
|
||||
<field name="dir"/>
|
||||
<field name="language"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="caldav_attendee_tree_view" model="ir.ui.view">
|
||||
<field name="name">crm.case.caldav.attendee</field>
|
||||
<field name="model">crm.caldav.attendee</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Atendee details">
|
||||
<field name="cutype" select="1"/>
|
||||
<field name="member"/>
|
||||
<field name="role" select="1"/>
|
||||
<field name="partstat"/>
|
||||
<field name="rsvp"/>
|
||||
<field name="delegated_to" select="1"/>
|
||||
<field name="delegated_from" select="1"/>
|
||||
<field name="sent_by"/>
|
||||
<field name="cn" select="1"/>
|
||||
<field name="dir"/>
|
||||
<field name="language"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="caldav_alarm_form_view" model="ir.ui.view">
|
||||
<field name="name">crm.case.caldav.alarm.form</field>
|
||||
<field name="model">crm.caldav.alarm</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Alarm details">
|
||||
<field name="action"/>
|
||||
<field name="name" select="1" attrs="{'required' : [('action','in',('EMAIL', 'DISPLAY'))]}"/>
|
||||
<separator string="Description" colspan="4"/>
|
||||
<field name="description" colspan="4" nolabel="1" attrs="{'required' : [('action','in',('EMAIL'))]}"/>
|
||||
<group string="Reminder details" col="4" colspan="4">
|
||||
<field name="trigger_duration" nolabel="1" select="1"/>
|
||||
<field name="trigger_interval" nolabel="1" select="1"/>
|
||||
<field name="trigger_occurs" nolabel="1" select="1"/>
|
||||
<field name="trigger_related" nolabel="1" select="1"/>
|
||||
</group>
|
||||
<field name="duration"/>
|
||||
<field name="repeat"/>
|
||||
<field name="attach" colspan="4" attrs="{'required' : [('action','in',('AUDIO', 'PROCEDURE'))]}"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="caldav_alarm_tree_view" model="ir.ui.view">
|
||||
<field name="name">crm.case.caldav.alarm.tree</field>
|
||||
<field name="model">crm.caldav.alarm</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Alarm details">
|
||||
<field name="name" select="1"/>
|
||||
<field name="action"/>
|
||||
<field name="trigger_interval" select="1"/>
|
||||
<field name="trigger_duration" select="1"/>
|
||||
<field name="trigger_related" select="1"/>
|
||||
<field name="trigger_occurs" select="1"/>
|
||||
<field name="active"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="caldav_crm_case_view" model="ir.ui.view">
|
||||
<field name="name">crm.case.caldav.form</field>
|
||||
<field name="model">crm.case</field>
|
||||
<field name="type">form</field>
|
||||
<field name="inherit_id" ref="crm.crm_case-view"/>
|
||||
<field name="arch" type="xml">
|
||||
<notebook position="inside">
|
||||
<page string="CalDav Properties">
|
||||
<field name="class"/>
|
||||
<field name="transparent"/>
|
||||
<field name="caldav_url" widget="url"/>
|
||||
<field name="alarm_id"/>
|
||||
<newline/>
|
||||
<separator string="Event Location" colspan="4"/>
|
||||
<field name="location" colspan="4" nolabel="1"/>
|
||||
<!-- <separator string="Freebusy Value" colspan="4"/>-->
|
||||
<!-- <field name="freebusy" colspan="4" nolabel="1"/>-->
|
||||
<!-- <separator string="Recurrency Details" colspan="4"/>-->
|
||||
<group string="Recurrency Details" col="5" colspan="4">
|
||||
<button string="Change RRule"
|
||||
name="%(caldav.action_view_caldav_set_rrule_wizard)d"
|
||||
icon="gtk-save-as" type="action" colspan="4"
|
||||
context="{'model' : 'crm.case'}"/>
|
||||
<group col="1" colspan="2">
|
||||
<separator string="Recurrenet Rule" />
|
||||
<field name="rrule" nolabel="1" />
|
||||
<separator string="Exception Rule" />
|
||||
<field name="exrule" nolabel="1" />
|
||||
</group>
|
||||
<group col="1" colspan="2">
|
||||
<separator string="Recurrenet Dates" />
|
||||
<field name="rdates" nolabel="1" />
|
||||
<separator string="Exception Dates" />
|
||||
<field name="exdate" nolabel="1" />
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Attendee">
|
||||
<separator string="Attendee" colspan="4"/>
|
||||
<field name="attendees" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
</notebook>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="caldav_crm_case_view2" model="ir.ui.view">
|
||||
<field name="name">crm.case.caldav.tree1</field>
|
||||
<field name="model">crm.case</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="inherit_id" ref="crm.crm_case_tree-view"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="id" position="replace">
|
||||
<field name="id" widget="char"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -28,11 +28,11 @@ import re
|
||||
import time
|
||||
import tools
|
||||
|
||||
class crm_case(osv.osv):
|
||||
_name = 'crm.case'
|
||||
_inherit = 'crm.case'
|
||||
_description = 'Cases'
|
||||
|
||||
class crm_meeting(osv.osv):
|
||||
_name = 'crm.meeting'
|
||||
_description = "Meeting Cases"
|
||||
_order = "id desc"
|
||||
_inherits = {'crm.case':"inherit_case_id"}
|
||||
__attribute__ = {
|
||||
'class' : {'field':'class', 'type':'text'},
|
||||
'created' : {'field':'create_date', 'type':'datetime'}, # keep none for now
|
||||
@@ -68,22 +68,7 @@ class crm_case(osv.osv):
|
||||
# 'duration' : {'field':'duration'},
|
||||
'dtend' : {'field':'date_closed', 'type':'datetime'},
|
||||
'valarm' : {'field':'alarm_id', 'type':'many2one', 'object' : 'crm.caldav.alarm'},
|
||||
}
|
||||
|
||||
def _get_location(self, cr, uid, ids, name, arg, context=None):
|
||||
res = {}
|
||||
for case in self.browse(cr, uid, ids):
|
||||
if case.partner_address_id:
|
||||
add = case.partner_address_id
|
||||
st = add.street and add.street+',\n' or ''
|
||||
st2 = add.street2 and add.street2+',\n' or ''
|
||||
ct = add.city and add.city+',\n' or ''
|
||||
zip = add.zip and add.zip or ''
|
||||
country = add.country_id and add.country_id.name+',\n' or ''
|
||||
res[case.id] = st + st2+ ct + country + zip
|
||||
else:
|
||||
res[case.id] = ''
|
||||
return res
|
||||
}
|
||||
|
||||
def _get_rdates(self, cr, uid, ids, name, arg, context=None):
|
||||
res = {}
|
||||
@@ -97,44 +82,44 @@ class crm_case(osv.osv):
|
||||
return res
|
||||
|
||||
_columns = {
|
||||
'inherit_case_id': fields.many2one('crm.case','Case',ondelete='cascade'),
|
||||
'class' : fields.selection([('PUBLIC', 'PUBLIC'), ('PRIVATE', 'PRIVATE'), \
|
||||
('CONFIDENTIAL', 'CONFIDENTIAL')], 'Class'),
|
||||
'location' : fields.function(_get_location, method=True, store=True, \
|
||||
string='Location', type='text'),
|
||||
('CONFIDENTIAL', 'CONFIDENTIAL')], 'Privacy'),
|
||||
'location' : fields.char('Location', size=264, help="Gives Location of Meeting"),
|
||||
'freebusy' : fields.text('FreeBusy'),
|
||||
'transparent' : fields.selection([('TRANSPARENT', 'TRANSPARENT'), \
|
||||
('OPAQUE', 'OPAQUE')], 'Trensparent'),
|
||||
'caldav_url' : fields.char('Caldav URL', size=264),
|
||||
'exdate' : fields.text('Exception Date/Times', help="This property defines the list\
|
||||
of date/time exceptions for arecurring calendar component."),
|
||||
'exrule' : fields.text('Exception Rule', help="defines a rule or repeating pattern\
|
||||
'exrule' : fields.char('Exception Rule', size=352, help="defines a rule or repeating pattern\
|
||||
for anexception to a recurrence set"),
|
||||
'rrule' : fields.text('Recurrent Rule', readonly=True),
|
||||
'rrule' : fields.char('Recurrent Rule', size=352),
|
||||
'rdates' : fields.function(_get_rdates, method=True, string='Recurrent Dates', \
|
||||
store=True, type='text'),
|
||||
'attendees': fields.many2many('crm.caldav.attendee', 'crm_attendee_rel', 'case_id', \
|
||||
'attendees': fields.many2many('crm.caldav.attendee', 'crm_attendee_rel', 'case_id', \
|
||||
'attendee_id', 'Attendees'),
|
||||
'alarm_id' : fields.many2one('crm.caldav.alarm', 'Alarm'),
|
||||
'alarm_id' : fields.many2one('crm.caldav.alarm', 'Alarm'),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'caldav_url': lambda *a: 'http://localhost:8080',
|
||||
_defaults = {
|
||||
'class': lambda *a: 'PUBLIC',
|
||||
'transparent': lambda *a: 'OPAQUE',
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
def run_scheduler(self, cr, uid, automatic=False, use_new_cursor=False, \
|
||||
context=None):
|
||||
if not context:
|
||||
context = {}
|
||||
cr.execute('select c.id as id, c.date as date, alarm.id as alarm_id, alarm.name as name,\
|
||||
cr.execute('select c.id as id, crm_case.date as date, alarm.id as alarm_id, alarm.name as name,\
|
||||
alarm.trigger_interval, alarm.trigger_duration, alarm.trigger_related, \
|
||||
alarm.trigger_occurs from crm_case c \
|
||||
alarm.trigger_occurs from crm_meeting c \
|
||||
join crm_case on c.inherit_case_id = crm_case.id \
|
||||
join crm_caldav_alarm alarm on (alarm.id=c.alarm_id) \
|
||||
where alarm_id is not null and alarm.active=True')
|
||||
case_with_alarm = cr.dictfetchall()
|
||||
case_obj = self.pool.get('crm.case')
|
||||
case_obj = self.pool.get('crm.meeting')
|
||||
attendee_obj = self.pool.get('crm.caldav.attendee')
|
||||
mail_to = []
|
||||
for alarmdata in case_with_alarm:
|
||||
@@ -180,7 +165,7 @@ class crm_case(osv.osv):
|
||||
crm_alarm = self.pool.get('crm.caldav.alarm')
|
||||
alarm_obj.__attribute__.update(crm_alarm.__attribute__)
|
||||
|
||||
ical = event_obj.export_ical(cr, uid, crm_data, {'model': 'crm.case'})
|
||||
ical = event_obj.export_ical(cr, uid, crm_data, {'model': 'crm.meeting'})
|
||||
caendar_val = ical.serialize()
|
||||
caendar_val = caendar_val.replace('"', '').strip()
|
||||
return caendar_val
|
||||
@@ -199,9 +184,6 @@ class crm_case(osv.osv):
|
||||
alarm_obj.__attribute__.update(crm_alarm.__attribute__)
|
||||
vals = event_obj.import_ical(cr, uid, file_content)
|
||||
for val in vals:
|
||||
# TODO: Select proper section
|
||||
section_id = self.pool.get('crm.case.section').search(cr, uid, [])[0]
|
||||
val.update({'section_id' : section_id})
|
||||
is_exists = common.uid2openobjectid(cr, val['id'], self._name )
|
||||
val.pop('id')
|
||||
if val.has_key('create_date'): val.pop('create_date')
|
||||
@@ -214,7 +196,7 @@ class crm_case(osv.osv):
|
||||
|
||||
def search(self, cr, uid, args, offset=0, limit=None, order=None,
|
||||
context=None, count=False):
|
||||
res = super(crm_case, self).search(cr, uid, args, offset,
|
||||
res = super(crm_meeting, self).search(cr, uid, args, offset,
|
||||
limit, order, context, count)
|
||||
return res
|
||||
|
||||
@@ -226,32 +208,40 @@ class crm_case(osv.osv):
|
||||
new_ids.append(id)
|
||||
if 'case_id' in vals :
|
||||
vals['case_id'] = common.caldevIDs2readIDs(vals['case_id'])
|
||||
res = super(crm_case, self).write(cr, uid, new_ids, vals, context=context)
|
||||
res = super(crm_meeting, self).write(cr, uid, new_ids, vals, context=context)
|
||||
return res
|
||||
|
||||
def browse(self, cr, uid, select, context=None, list_class=None, fields_process={}):
|
||||
if not isinstance(select, list): select = [select]
|
||||
def browse(self, cr, uid, ids, context=None, list_class=None, fields_process={}):
|
||||
if isinstance(ids, (str, int, long)):
|
||||
select = [ids]
|
||||
else:
|
||||
select = ids
|
||||
select = map(lambda x:common.caldevIDs2readIDs(x), select)
|
||||
return super(crm_case, self).browse(cr, uid, select, context, list_class, fields_process)
|
||||
res = super(crm_meeting, self).browse(cr, uid, select, context, list_class, fields_process)
|
||||
if isinstance(ids, (str, int, long)):
|
||||
return res and res[0] or False
|
||||
return res
|
||||
|
||||
def read(self, cr, uid, ids, fields=None, context={}, load='_classic_read'):
|
||||
""" logic for recurrent event
|
||||
example : 123-20091111170822"""
|
||||
example : 123-20091111170822"""
|
||||
if context and context.has_key('read'):
|
||||
return super(crm_case, self).read(cr, uid, ids, fields=fields, context=context, \
|
||||
return super(crm_meeting, self).read(cr, uid, ids, fields=fields, context=context, \
|
||||
load=load)
|
||||
if not type(ids) == list :
|
||||
# Called from code
|
||||
return super(crm_case, self).read(cr, uid, common.caldevIDs2readIDs(ids), \
|
||||
return super(crm_meeting, self).read(cr, uid, common.caldevIDs2readIDs(ids), \
|
||||
fields=fields, context=context, load=load)
|
||||
else:
|
||||
ids = map(lambda x:common.caldevIDs2readIDs(x), ids)
|
||||
fields.append('date')
|
||||
res = super(crm_case, self).read(cr, uid, ids, fields=fields, context=context, load=load)
|
||||
|
||||
if fields and 'date' not in fields:
|
||||
fields.append('date')
|
||||
res = super(crm_meeting, self).read(cr, uid, ids, fields=fields, context=context, load=load)
|
||||
read_ids = ",".join([str(x) for x in ids])
|
||||
if not read_ids:
|
||||
return []
|
||||
cr.execute('select id,rrule,rdates from crm_case where id in (%s)' % read_ids)
|
||||
cr.execute('select id,rrule,rdates from crm_meeting where id in (%s)' % read_ids)
|
||||
rrules = filter(lambda x: not x['rrule']==None, cr.dictfetchall())
|
||||
rdates = []
|
||||
if not rrules:
|
||||
@@ -283,8 +273,8 @@ class crm_case(osv.osv):
|
||||
result += [val1]
|
||||
return result
|
||||
|
||||
def copy(self, cr, uid, id, default=None, context={}):
|
||||
return super(crm_case, self).copy(cr, uid, common.caldevIDs2readIDs(id), \
|
||||
def copy(self, cr, uid, id, default=None, context={}):
|
||||
return super(crm_meeting, self).copy(cr, uid, common.caldevIDs2readIDs(id), \
|
||||
default, context)
|
||||
|
||||
def unlink(self, cr, uid, ids, context=None):
|
||||
@@ -301,16 +291,16 @@ class crm_case(osv.osv):
|
||||
self.write(cr, uid, [common.caldevIDs2readIDs(id)], {'exdate' : exdate})
|
||||
else:
|
||||
ids = map(lambda x:common.caldevIDs2readIDs(x), ids)
|
||||
return super(crm_case, self).unlink(cr, uid, common.caldevIDs2readIDs(ids))
|
||||
return super(crm_meeting, self).unlink(cr, uid, common.caldevIDs2readIDs(ids))
|
||||
else:
|
||||
return super(crm_case, self).unlink(cr, uid, ids)
|
||||
return super(crm_meeting, self).unlink(cr, uid, ids)
|
||||
|
||||
def create(self, cr, uid, vals, context={}):
|
||||
if 'case_id' in vals:
|
||||
vals['case_id'] = common.caldevIDs2readIDs(vals['case_id'])
|
||||
return super(crm_case, self).create(cr, uid, vals, context)
|
||||
return super(crm_meeting, self).create(cr, uid, vals, context)
|
||||
|
||||
crm_case()
|
||||
crm_meeting()
|
||||
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
@@ -59,6 +59,20 @@
|
||||
<field name="name">Future</field>
|
||||
<field name="section_id" ref="section_support1"/>
|
||||
</record>
|
||||
<!-- Scheduler for Event Alarm-->
|
||||
<record forcecreate="True" id="ir_cron_scheduler_alarm"
|
||||
model="ir.cron">
|
||||
<field name="name">Run Event Reminder</field>
|
||||
<field eval="True" name="active" />
|
||||
<field name="user_id" ref="base.user_root" />
|
||||
<field name="interval_number">1</field>
|
||||
<field name="interval_type">days</field>
|
||||
<field name="numbercall">-1</field>
|
||||
<field eval="False" name="doall" />
|
||||
<field eval="'crm.meeting'" name="model" />
|
||||
<field eval="'run_scheduler'" name="function" />
|
||||
<field eval="'(False,)'" name="args" />
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
-->
|
||||
|
||||
<!--For Meetings-->
|
||||
<record id="crm_case_followuponproposal0" model="crm.case">
|
||||
<record id="crm_case_followuponproposal0" model="crm.meeting">
|
||||
<field name="partner_address_id" ref="base.res_partner_address_wong"/>
|
||||
<field eval="1" name="active"/>
|
||||
<field name="partner_id" ref="base.res_partner_maxtor"/>
|
||||
@@ -23,7 +23,7 @@
|
||||
<field eval="6.3" name="duration"/>
|
||||
</record>
|
||||
|
||||
<record id="crm_case_initialdiscussion0" model="crm.case">
|
||||
<record id="crm_case_initialdiscussion0" model="crm.meeting">
|
||||
<field name="partner_address_id" ref="base.res_partner_address_2"/>
|
||||
<field eval="1" name="active"/>
|
||||
<field name="category2_id" ref="crm.category_meet1"/>
|
||||
@@ -41,7 +41,7 @@
|
||||
<field eval=""contact@tecsas.fr"" name="email_from"/>
|
||||
</record>
|
||||
|
||||
<record id="crm_case_discusspricing0" model="crm.case">
|
||||
<record id="crm_case_discusspricing0" model="crm.meeting">
|
||||
<field name="partner_address_id" ref="base.res_partner_address_zen"/>
|
||||
<field eval="1" name="active"/>
|
||||
<field name="category2_id" ref="crm.category_meet3"/>
|
||||
@@ -59,7 +59,7 @@
|
||||
<field eval="time.strftime('%Y-%m-20')" name="date_deadline"/>
|
||||
</record>
|
||||
|
||||
<record id="crm_case_reviewneeds0" model="crm.case">
|
||||
<record id="crm_case_reviewneeds0" model="crm.meeting">
|
||||
<field name="partner_address_id" ref="base.res_partner_address_15"/>
|
||||
<field eval="1" name="active"/>
|
||||
<field name="category2_id" ref="crm.category_meet2"/>
|
||||
@@ -76,7 +76,7 @@
|
||||
<field eval="time.strftime('%Y-%m-25')" name="date_deadline"/>
|
||||
</record>
|
||||
|
||||
<record id="crm_case_changesindesigning0" model="crm.case">
|
||||
<record id="crm_case_changesindesigning0" model="crm.meeting">
|
||||
<field name="partner_address_id" ref="base.res_partner_address_1"/>
|
||||
<field eval="1" name="active"/>
|
||||
<field name="category2_id" ref="crm.category_meet1"/>
|
||||
@@ -94,7 +94,7 @@
|
||||
<field eval=""info@opensides.be"" name="email_from"/>
|
||||
</record>
|
||||
|
||||
<record id="crm_case_updatethedata0" model="crm.case">
|
||||
<record id="crm_case_updatethedata0" model="crm.meeting">
|
||||
<field name="partner_address_id" ref="base.res_partner_address_7"/>
|
||||
<field eval="1" name="active"/>
|
||||
<field name="category2_id" ref="crm.category_meet2"/>
|
||||
|
||||
@@ -5,15 +5,14 @@
|
||||
<act_window
|
||||
id="crm_case_categ_meet_create_partner"
|
||||
name="Schedule a Meeting"
|
||||
res_model="crm.case"
|
||||
res_model="crm.meeting"
|
||||
src_model="res.partner"
|
||||
view_mode="calendar,tree,form,gantt"
|
||||
context="{'default_partner_id': active_id, 'default_duration': 4.0}"
|
||||
domain="[('section_id','=',ref('section_support1'))]"/>
|
||||
/>
|
||||
|
||||
|
||||
<record model="ir.actions.act_window" id="crm_case_categ_meet_create_partner">
|
||||
<field name="domain" eval="'[(\'section_id\',\'=\','+str(ref('section_support1'))+')]'"/>
|
||||
<record model="ir.actions.act_window" id="crm_case_categ_meet_create_partner">
|
||||
<field name="context" eval="{'default_state':'open'}"/>
|
||||
</record>
|
||||
|
||||
@@ -46,14 +45,13 @@
|
||||
<act_window
|
||||
id="crm_case_categ_meet_case"
|
||||
name="Schedule a Meeting"
|
||||
res_model="crm.case"
|
||||
res_model="crm.meeting"
|
||||
src_model="crm.case"
|
||||
view_mode="calendar,tree,form,gantt"
|
||||
context="{'default_case_id': active_id, 'default_duration': 4.0}"
|
||||
domain="[('section_id','=',ref('section_support1'))]"/>
|
||||
/>
|
||||
|
||||
<record model="ir.actions.act_window" id="crm_case_categ_meet_case">
|
||||
<field name="domain" eval="'[(\'section_id\',\'=\','+str(ref('section_support1'))+')]'"/>
|
||||
<record model="ir.actions.act_window" id="crm_case_categ_meet_case">
|
||||
<field name="context" eval="{'default_state':'open'}"/>
|
||||
</record>
|
||||
|
||||
@@ -83,7 +81,7 @@
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="crm_case_categ_meet">
|
||||
<field name="res_model">crm.case</field>
|
||||
<field name="res_model">crm.meeting</field>
|
||||
<field name="view_mode">calendar,tree,form,gantt</field>
|
||||
<field name="view_id" ref="crm_case_calendar_view"/>
|
||||
<field name="context" eval="{'default_state':'open'}"/>
|
||||
@@ -123,7 +121,7 @@
|
||||
|
||||
<record model="ir.actions.act_window" id="crm_case_category_act_meetall3">
|
||||
<field name="name">Next Meetings</field>
|
||||
<field name="res_model">crm.case</field>
|
||||
<field name="res_model">crm.meeting</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,calendar,form,gantt</field>
|
||||
<field name="view_id" ref="crm_case_calendar_view_meet"/>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<record model="ir.ui.view" id="crm_case_form_view_meet">
|
||||
<field name="name">CRM - Meetings Form</field>
|
||||
<field name="model">crm.case</field>
|
||||
<field name="model">crm.meeting</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Meetings Form">
|
||||
@@ -29,12 +29,22 @@
|
||||
<field name="partner_id" on_change="onchange_partner_id(partner_id, email_from)" />
|
||||
<field name="partner_address_id" on_change="onchange_partner_address_id(partner_address_id, email_from)"/>
|
||||
<field name="email_from"/>
|
||||
<newline/>
|
||||
<newline/>
|
||||
<field name="categ_id" select="2" on_change="onchange_categ_id(categ_id)"/>
|
||||
<field name="category2_id" select="1" string="Location"/>
|
||||
<field name="location" />
|
||||
<field name="alarm_id" colspan="4" string="Reminder"/>
|
||||
<group colspan="4">
|
||||
<field name="rrule" string="Recurrency Rule"/>
|
||||
<button string="Change RRule"
|
||||
name="%(caldav.action_view_caldav_set_rrule_wizard)d"
|
||||
icon="gtk-save-as" type="action" context="{'model' : 'crm.meeting'}"/>
|
||||
</group>
|
||||
<separator string="Description" colspan="4"/>
|
||||
<field name="description" nolabel="1" colspan="4"/>
|
||||
<separator colspan="4"/>
|
||||
<field name="class"/>
|
||||
<field name="transparent"/>
|
||||
<separator colspan="4"/>
|
||||
<group col="8" colspan="4">
|
||||
<field name="state" select="2"/>
|
||||
<button name="case_open" string="Confirm Meeting" states="draft,cancel,pending" type="object" icon="terp-crm"/>
|
||||
@@ -42,17 +52,31 @@
|
||||
<button name="case_reset" string="Reset to Unconfirmed" states="done,open,cancel" type="object" icon="gtk-convert"/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Attendee Detail">
|
||||
<separator string="Attendee" colspan="4"/>
|
||||
<field name="attendees" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
<page string="Other Info">
|
||||
<field name="caldav_url" widget="url" readonly="True"/>
|
||||
<newline/>
|
||||
<separator string="Recurrenet Dates" colspan="4"/>
|
||||
<field name="rdates" colspan="4" nolabel="1" readonly="True"/>
|
||||
<newline/>
|
||||
<field name="exrule" string="Exception Rules" colspan="4"/>
|
||||
<separator string="Exceprion Dates" colspan="4"/>
|
||||
<field name="exdate" nolabel="1" colspan="4" />
|
||||
</page>
|
||||
</notebook>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="crm_case_tree_view_meet">
|
||||
<field name="name">CRM - Meetings Tree</field>
|
||||
<field name="model">crm.case</field>
|
||||
<field name="model">crm.meeting</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Meetings Tree" colors="red:state=='open';black:state in ('draft', 'cancel','done','pending')">
|
||||
<field name="id"/>
|
||||
<field name="id" widget="char"/>
|
||||
<field name="name" string="Title"/>
|
||||
<field name="date" string="Next Meeting"/>
|
||||
<field name="section_id" widget="selection"/>
|
||||
@@ -69,7 +93,7 @@
|
||||
</record>
|
||||
<record model="ir.ui.view" id="crm_case_calendar_view_meet">
|
||||
<field name="name">CRM - Meetings Calendar</field>
|
||||
<field name="model">crm.case</field>
|
||||
<field name="model">crm.meeting</field>
|
||||
<field name="type">calendar</field>
|
||||
<field name="priority" eval="2"/>
|
||||
<field name="arch" type="xml">
|
||||
@@ -83,11 +107,11 @@
|
||||
|
||||
<record id="crm_case_gantt_view_meet" model="ir.ui.view">
|
||||
<field name="name">CRM - Meetings Gantt</field>
|
||||
<field name="model">crm.case</field>
|
||||
<field name="model">crm.meeting</field>
|
||||
<field name="type">gantt</field>
|
||||
<field name="arch" type="xml">
|
||||
<gantt color="user_id" date_delay="duration" date_start="date" string="Meetings">
|
||||
<level object="crm.case" link="id" domain="[]">
|
||||
<level object="crm.meeting" link="id" domain="[]">
|
||||
<field name="name"/>
|
||||
<field name="partner_id"/>
|
||||
</level>
|
||||
@@ -95,8 +119,8 @@
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_crm_case_meetings_filter" model="ir.ui.view">
|
||||
<field name="name">crm.case.meetings.select</field>
|
||||
<field name="model">crm.case</field>
|
||||
<field name="name">CRM - Meetings Search</field>
|
||||
<field name="model">crm.meeting</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Meetings">
|
||||
@@ -114,6 +138,6 @@
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -1,19 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<wizard string="Import ICS File" model="crm.case"
|
||||
<wizard string="Import ICS File" model="crm.meeting"
|
||||
name="caldav.crm.import" id="wizard_crm_cal_import" multi="True"
|
||||
/>
|
||||
|
||||
<wizard string="Subscribe to a Remote calendar" model="crm.case"
|
||||
<wizard string="Subscribe to a Remote calendar" model="crm.meeting"
|
||||
name="caldav.crm.subscribe" id="wizard_crm_cal_subscribe" multi="True"
|
||||
/>
|
||||
|
||||
<wizard string="Export ICS File" model="crm.case" name="caldav.crm.export"
|
||||
<wizard string="Export ICS File" model="crm.meeting" name="caldav.crm.export"
|
||||
id="wizard_crm_cal_export" multi="True"
|
||||
/>
|
||||
|
||||
<wizard string="Set RRULE" model="crm.case"
|
||||
<wizard string="Set RRULE" model="crm.meeting"
|
||||
name="caldav.set.rrule" id="wizard_crm_set_rrule" menu="False"
|
||||
/>
|
||||
</data>
|
||||
</openerp>
|
||||
</openerp>
|
||||
+1
-38
@@ -731,44 +731,7 @@
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" ref="crm_email_gateway_tree"/>
|
||||
</record>
|
||||
<menuitem id="crm_email_gateway_menu" name="Email Gateway" parent="next_id_51" action="crm_email_gateway_act" />
|
||||
|
||||
<!-- Caldav configartion view -->
|
||||
|
||||
<record id="view_config_crm_caldav_menu" model="ir.ui.view">
|
||||
<field name="name">Configure Menu for Caldav Properites</field>
|
||||
<field name="model">crm.calendar.config_wizard</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Configure view for Caldav Properites">
|
||||
<separator colspan="4" string=""/>
|
||||
<label colspan="4" align="0.0" string="This will provide a detailed view for caldav properties configuration"/>
|
||||
<newline/>
|
||||
<field name="caldav"/>
|
||||
<separator colspan="4" string=""/>
|
||||
<group col="4" colspan="4">
|
||||
<button icon="gtk-cancel" name="action_cancel" type="object" special="cancel" string="Cancel"/>
|
||||
<button icon="gtk-go-forward" name="action_create" string="Next" type="object"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_view_config_crm_caldav_menu" model="ir.actions.act_window">
|
||||
<field name="name">Configure Menu for Caldav Properites</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">crm.calendar.config_wizard</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<!-- register configuration wizard -->
|
||||
<record id="config_wizard_step_cam_caldav_menu" model="ir.actions.todo">
|
||||
<field name="name">Configure Menu for Caldav Properites</field>
|
||||
<field name="note">This Configuration step use to provide a detailed view for caldav properties configuration</field>
|
||||
<field name="action_id" ref="action_view_config_crm_caldav_menu"/>
|
||||
</record>
|
||||
<menuitem id="crm_email_gateway_menu" name="Email Gateway" parent="next_id_51" action="crm_email_gateway_act" />
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -33,4 +33,3 @@
|
||||
"access_crm_case_category2_manager","crm_case_category2 manager","model_crm_case_category2","crm.group_crm_manager",1,1,1,1
|
||||
"access_crm_generic_wizard_manager","crm.generic_wizard","model_crm_generic_wizard","crm.group_crm_manager",1,1,1,1
|
||||
"access_crm_generic_wizard_manager","crm.generic_wizard","model_crm_generic_wizard","crm.group_crm_user",1,0,0,0
|
||||
"access_crm_calendar_config_wizard","crm.calendar.config_wizard","model_crm_calendar_config_wizard",,1,1,1,1
|
||||
|
||||
|
@@ -47,7 +47,7 @@ class crm_cal_export_wizard(wizard.interface):
|
||||
}
|
||||
|
||||
def _process_export_ics(self, cr, uid, data, context):
|
||||
case_obj = pooler.get_pool(cr.dbname).get('crm.case')
|
||||
case_obj = pooler.get_pool(cr.dbname).get('crm.meeting')
|
||||
calendar = case_obj.export_cal(cr, uid, data['ids'], context)
|
||||
return {'file_path': base64.encodestring(calendar), \
|
||||
'name': 'OpenERP Events.ics'}
|
||||
@@ -61,4 +61,4 @@ class crm_cal_export_wizard(wizard.interface):
|
||||
|
||||
crm_cal_export_wizard('caldav.crm.export')
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -52,7 +52,7 @@ class crm_cal_import_wizard(wizard.interface):
|
||||
}
|
||||
|
||||
def _process_imp_ics(self, cr, uid, data, context=None):
|
||||
case_obj = pooler.get_pool(cr.dbname).get('crm.case')
|
||||
case_obj = pooler.get_pool(cr.dbname).get('crm.meeting')
|
||||
vals = case_obj.import_cal(cr, uid, data['form']['file_path'], context)
|
||||
global cnt
|
||||
cnt = 0
|
||||
@@ -82,4 +82,4 @@ class crm_cal_import_wizard(wizard.interface):
|
||||
|
||||
crm_cal_import_wizard('caldav.crm.import')
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -58,7 +58,7 @@ class crm_cal_subscribe_wizard(wizard.interface):
|
||||
f = urllib.urlopen(data['form']['url_path'])
|
||||
caldata= f.fp.read()
|
||||
f.close()
|
||||
case_obj = pooler.get_pool(cr.dbname).get('crm.case')
|
||||
case_obj = pooler.get_pool(cr.dbname).get('crm.meeting')
|
||||
context.update({'url': data['form']['url_path']})
|
||||
vals = case_obj.import_cal(cr, uid, base64.encodestring(caldata), context)
|
||||
if vals:
|
||||
@@ -87,4 +87,4 @@ class crm_cal_subscribe_wizard(wizard.interface):
|
||||
|
||||
crm_cal_subscribe_wizard('caldav.crm.subscribe')
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
Reference in New Issue
Block a user