[IMP]:caldav: Improvement in export ics wizard, (Generated .ics from default get )

bzr revid: rpa@tinyerp.com-20100514121825-e2ugdszxup73cwk2
This commit is contained in:
rpa (Open ERP)
2010-05-14 17:48:25 +05:30
parent 57bdcdc4c9
commit cd0272d3fd
2 changed files with 5 additions and 12 deletions
+3 -10
View File
@@ -32,16 +32,6 @@ class calendar_event_export(osv.osv_memory):
"""
Export Calendar Event.
"""
def process_export_ics(self, cr, uid, ids, context):
"""
Get Default value for file_path field.
"""
model = context.get('model', 'basic.calendar')
model_obj = self.pool.get(model)
calendar = model_obj.export_cal(cr, uid, context['active_ids'], context)
self.write(cr, uid, ids, {'file_path': base64.encodestring(calendar)})
return False
def default_get(self, cr, uid, fields, context):
"""
@@ -54,6 +44,9 @@ class calendar_event_export(osv.osv_memory):
name = 'OpenERP %s.ics' % (model_obj._description)
if 'name' in fields:
res.update({'name': name})
if 'file_path' in fields:
calendar = model_obj.export_cal(cr, uid, context['active_ids'], context)
res.update({'file_path': base64.encodestring(calendar)})
return res
_name = "calendar.event.export"
@@ -13,8 +13,8 @@
</group>
<separator string="" colspan="4" />
<group colspan="4" col="6">
<button name="process_export_ics" icon="gtk-execute" string="Genetate ics" type="object"/>
<button icon="gtk-cancel" special="cancel" string="_Cancel"/>
<label string=""/>
<button icon="gtk-close" special="cancel" string="_Close"/>
</group>
</form>
</field>