[IMP]: crm, project_calendar: Improvement in export wizard, Added field name for file name
bzr revid: rpa@tinyerp.com-20091223060237-y0f572eyoud1vi0q
This commit is contained in:
@@ -27,23 +27,30 @@ import pooler
|
||||
class crm_cal_export_wizard(wizard.interface):
|
||||
form1 = '''<?xml version="1.0"?>
|
||||
<form string="Export ICS">
|
||||
<separator string="Save ICS file"/>
|
||||
<field name="file_path" colspan="4" width="300" nolabel="1"/>
|
||||
<field name="name"/>
|
||||
<field name="file_path" colspan="4" width="300"/>
|
||||
</form>'''
|
||||
|
||||
form1_fields = {
|
||||
'file_path': {
|
||||
'string': 'Select ICS file',
|
||||
'string': 'Save ICS file',
|
||||
'type': 'binary',
|
||||
'required' : True,
|
||||
'filters' : '*.ics'
|
||||
}
|
||||
},
|
||||
'name': {
|
||||
'string': 'File name',
|
||||
'type': 'char',
|
||||
'size': 34,
|
||||
'required': True,
|
||||
'help': 'Save in .ics format'},
|
||||
}
|
||||
|
||||
def _process_export_ics(self, cr, uid, data, context):
|
||||
case_obj = pooler.get_pool(cr.dbname).get('crm.case')
|
||||
calendar = case_obj.export_cal(cr, uid, data['ids'], context)
|
||||
return {'file_path': base64.encodestring(calendar)}
|
||||
return {'file_path': base64.encodestring(calendar), \
|
||||
'name': 'OpenERP Events.ics'}
|
||||
|
||||
states = {
|
||||
'init': {
|
||||
|
||||
@@ -27,23 +27,30 @@ import pooler
|
||||
class project_cal_export_wizard(wizard.interface):
|
||||
form1 = '''<?xml version="1.0"?>
|
||||
<form string="Export ICS">
|
||||
<separator string="Save ICS file"/>
|
||||
<field name="file_path" colspan="4" width="300" nolabel="1"/>
|
||||
<field name="name"/>
|
||||
<field name="file_path" colspan="4" width="300"/>
|
||||
</form>'''
|
||||
|
||||
form1_fields = {
|
||||
'file_path': {
|
||||
'string': 'Select ICS file',
|
||||
'string': 'Save ICS file',
|
||||
'type': 'binary',
|
||||
'required': True,
|
||||
'filters': '*.ics'
|
||||
}
|
||||
'required' : True,
|
||||
'filters' : '*.ics'
|
||||
},
|
||||
'name': {
|
||||
'string': 'File name',
|
||||
'type': 'char',
|
||||
'size': 34,
|
||||
'required': True,
|
||||
'help': 'Save in .ics format'},
|
||||
}
|
||||
|
||||
def _process_export_ics(self, cr, uid, data, context):
|
||||
task_obj = pooler.get_pool(cr.dbname).get('project.task')
|
||||
calendar = task_obj.export_cal(cr, uid, data['ids'], context)
|
||||
return {'file_path': base64.encodestring(calendar)}
|
||||
return {'file_path': base64.encodestring(calendar), \
|
||||
'name': 'OpenERP Tasks.ics'}
|
||||
|
||||
states = {
|
||||
'init': {
|
||||
|
||||
Reference in New Issue
Block a user