Merge lp:~openerp-dev/openobject-addons/6.1-opw-576970-rha into lp:openobject-addons/6.1

Proposed by Rifakat Husen (OpenERP)
Status: Approved
Approved by: Naresh(OpenERP)
Approved revision: 6949
Proposed branch: lp:~openerp-dev/openobject-addons/6.1-opw-576970-rha
Merge into: lp:openobject-addons/6.1
Diff against target: 40 lines (+9/-8)
1 file modified
base_calendar/base_calendar.py (+9/-8)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.1-opw-576970-rha
Reviewer Review Type Date Requested Status
Naresh(OpenERP) Pending
Review via email: mp+120051@code.launchpad.net

Description of the change

Hello,

It raises error while we create event meeting from menu for calendar.alarm object.

Here are the steps to reproduce it on a freshly installed database:
* create a new database with demo data
* install the 'base_calendar', 'crm' and 'project' modules
* create a menu for 'calendar.alarm' object:
  - go in Settings / Customization / Database Structure / Models
  - search for the 'calendar.alarm' model
  - at the bottom of the 'edit' form, click on the 'create a menu' button
  - choose whatever location you want for that menu
* go in the newly created menu and create a new 'calendar.alarm' record
  - Model = task
  - Action = Display
  - resource ID = 8
* in a minute or so, the ir.cron object will execute the "event scheduler"
* notice the error in the server logs

Thanks for your review.

Regards,
Rifakat Haradwala

To post a comment you must log in.
Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

Hello,

This bug was qualified as Confirmed on Trunk (means still existing and reproducible). A Merge Proposal for trunk was created to fix it. Here is the link to follow the MP on Launchpad https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-opw-576970-port-mma/+merge/135826 and be informed once it's been merged in trunk: ... If this Merge Proposal could not be merged in v6.1 at the release of v7.0, it will be closed.

Thanks,
Naresh Soni

Unmerged revisions

6949. By Rifakat Husen (OpenERP)

[FIX] base_calendar: it raises error when we create calendar event while on which object the event is created does not have rrule and attendee_ids, that is availeble only with menu Event(calendar.event), problem is raised while we create saperate menu for calendar.alarm and create event for that because this object does not have these fields and throwing error

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 2012-03-05 14:35:54 +0000
3+++ base_calendar/base_calendar.py 2012-08-17 04:54:17 +0000
4@@ -828,7 +828,7 @@
5 res_obj = model_obj.browse(cr, uid, alarm.res_id, context=context)
6 re_dates = []
7
8- if res_obj.rrule:
9+ if hasattr(res_obj, 'rrule') and res_obj.rrule:
10 event_date = datetime.strptime(res_obj.date, '%Y-%m-%d %H:%M:%S')
11 recurrent_dates = get_recurrent_dates(res_obj.rrule, res_obj.exdate, event_date, res_obj.exrule)
12
13@@ -862,19 +862,20 @@
14 if alarm.action == 'display':
15 value = {
16 'name': alarm.name,
17- 'act_from': alarm.user_id.id,
18- 'act_to': alarm.user_id.id,
19+ 'act_from': alarm.user_id and alarm.user_id.id or uid,
20+ 'act_to': alarm.user_id and alarm.user_id.id or uid,
21 'body': alarm.description,
22 'trigger_date': r_date,
23 'ref_doc1': ref
24 }
25 request_id = request_obj.create(cr, uid, value)
26 request_ids = [request_id]
27- for attendee in res_obj.attendee_ids:
28- if attendee.user_id:
29- value['act_to'] = attendee.user_id.id
30- request_id = request_obj.create(cr, uid, value)
31- request_ids.append(request_id)
32+ if hasattr(res_obj, 'attendee_ids'):
33+ for attendee in res_obj.attendee_ids:
34+ if attendee.user_id:
35+ value['act_to'] = attendee.user_id.id
36+ request_id = request_obj.create(cr, uid, value)
37+ request_ids.append(request_id)
38 request_obj.request_send(cr, uid, request_ids)
39
40 if alarm.action == 'email':