Merge lp:~openerp-dev/openobject-addons/7.0-opw-597154-chandni into lp:openobject-addons/7.0

Proposed by Chandni Machchhar(OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/7.0-opw-597154-chandni
Merge into: lp:openobject-addons/7.0
Diff against target: 26 lines (+8/-7)
1 file modified
base_calendar/base_calendar.py (+8/-7)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/7.0-opw-597154-chandni
Reviewer Review Type Date Requested Status
Vinay Rana (OpenERP) Pending
Naresh(OpenERP) Pending
Review via email: mp+184235@code.launchpad.net

Description of the change

Hello,

I have fix the Traceback when you click on Messaging > Organizer > Calendar, Click on form view without any record. It will give you Traceback.

Thanks,
Chandni.

To post a comment you must log in.

Unmerged revisions

9412. By Chandni Machchhar(OpenERP)

[FIX] Traceback when open form view without any record in Messaging > Organizer > Calendar.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'base_calendar/base_calendar.py'
2--- base_calendar/base_calendar.py 2013-09-02 08:27:42 +0000
3+++ base_calendar/base_calendar.py 2013-09-06 05:28:26 +0000
4@@ -1486,14 +1486,15 @@
5 real_data = dict(zip([x['id'] for x in real_data], real_data))
6
7 for base_calendar_id, real_id in select:
8- res = real_data[real_id].copy()
9- ls = base_calendar_id2real_id(base_calendar_id, with_date=res and res.get('duration', 0) or 0)
10- if not isinstance(ls, (str, int, long)) and len(ls) >= 2:
11- res['date'] = ls[1]
12- res['date_deadline'] = ls[2]
13- res['id'] = base_calendar_id
14+ if base_calendar_id and real_id:
15+ res = real_data[real_id].copy()
16+ ls = base_calendar_id2real_id(base_calendar_id, with_date=res and res.get('duration', 0) or 0)
17+ if not isinstance(ls, (str, int, long)) and len(ls) >= 2:
18+ res['date'] = ls[1]
19+ res['date_deadline'] = ls[2]
20+ res['id'] = base_calendar_id
21
22- result.append(res)
23+ result.append(res)
24
25 for r in result:
26 if r['user_id']: