diff --git a/addons/caldav/wizard/calendar_event_import.py b/addons/caldav/wizard/calendar_event_import.py index 11f9f9b4afb..51d7e007fcf 100644 --- a/addons/caldav/wizard/calendar_event_import.py +++ b/addons/caldav/wizard/calendar_event_import.py @@ -56,7 +56,11 @@ class calendar_event_import(osv.osv_memory): id2 = data_obj._get_id(cr, uid, 'caldav', 'view_calendar_event_import_display') if id2: id2 = data_obj.browse(cr, uid, id2, context=context).res_id - vals = model_obj.import_cal(cr, uid, base64.decodestring(data['file_path']), context['active_id'], context) + vals = None + try: + vals = model_obj.import_cal(cr, uid, base64.decodestring(data['file_path']), context['active_id'], context) + except: + raise osv.except_osv(_('Warning !'),_('Invalid format of the ics, file can not be imported')) global cnt if vals: cnt = len(vals) diff --git a/addons/project_long_term/project_long_term_view.xml b/addons/project_long_term/project_long_term_view.xml index eaaafe5090a..8c7595f24bc 100644 --- a/addons/project_long_term/project_long_term_view.xml +++ b/addons/project_long_term/project_long_term_view.xml @@ -376,7 +376,9 @@ res_model="project.task" src_model="project.phase" view_mode="tree,form" - context="{'search_default_phase_id': [active_id]}"/> + context="{'search_default_phase_id': [active_id]}" + domain="[('phase_id', '=', active_id)]" + />