Typo google calendar "gloal variable event undefined"

Bug #1276992 reported by Adrian Vacaru
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Expired
Undecided
Unassigned

Bug Description

OpenERP trunk

Error in
addons/google_calendar/google_calendar.py line 583.

Crash when you sync calendar with google.
Global variable event not defined.

Line 583:
+elif source_event_record.recurrent_id_date and source_attendee_record.google_internal_event_id:
- elif event.recurrent_id_date and source_attendee_record.google_internal_event_id:

Revision history for this message
Twinkle Christian(OpenERP) (tch-openerp) wrote :
Revision history for this message
Twinkle Christian(OpenERP) (tch-openerp) wrote :

Hello,

I have checked with latest trunk and did whole configuration for google account and its working fine at all as I shown you in my above video. So, Would you please check it again and paste your error ? Waiting for your notification.

Thank you .

Changed in openobject-addons:
status: New → Incomplete
Revision history for this message
Adrian Vacaru (adrian-vacaru) wrote :
Download full text (4.0 KiB)

Hello,

Check the file #openerp/addons/google_calendar/google_calendar.py at line 583.
Function bind_recurring_events_to_google().

Error apears when tray to sync with google. event.recurrent_id_date, but "event" is not defined, in this function and not even in this module.

My solution is to replace event.recurrent_id_date with source_event_record.recurrent_id_date.

Error Report:
-----------------------------------------------------------------------------------------------------------
Traceback (most recent call last):
  File "/opt/openerp8/openerp/http.py", line 345, in dispatch
    response["result"] = self._call_function(**self.params)
  File "/opt/openerp8/openerp/http.py", line 217, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/opt/openerp8/openerp/service/model.py", line 112, in wrapper
    return f(dbname, *args, **kwargs)
  File "/opt/openerp8/openerp/http.py", line 212, in checked_call
    return self.func(*a, **kw)
  File "/opt/openerp8/openerp/http.py", line 528, in __call__
    return self.method(*args, **kw)
  File "/opt/openerp8/openerp/addons/google_calendar/controllers/main.py", line 48, in sync_data
    return gc_obj.synchronize_events(request.cr, request.uid, [], kw.get('local_context'))
  File "/opt/openerp8/openerp/addons/google_calendar/google_calendar.py", line 272, in synchronize_events
    self.bind_recurring_events_to_google(cr, uid, context)
  File "/opt/openerp8/openerp/addons/google_calendar/google_calendar.py", line 583, in bind_recurring_events_to_google
    elif event.recurrent_id_date and source_attendee_record.google_internal_event_id:
NameError: global name 'event' is not defined

Hier is the function
-----------------------------------------------------------------------------------------
    def bind_recurring_events_to_google(self, cr, uid, context):
        calendar_event = self.pool['calendar.event']
        att_obj = self.pool.get('calendar.attendee')
        user_obj = self.pool['res.users']
        myPartnerID = user_obj.browse(cr,uid,uid,context=context).partner_id.id

        context_norecurrent = context.copy()
        context_norecurrent['virtual_id'] = False
        context_norecurrent['active_test'] = False

        my_att_ids = att_obj.search(cr, uid,[('partner_id', '=', myPartnerID),('google_internal_event_id', '=', False)], context=context_norecurrent)
        for att in att_obj.browse(cr,uid,my_att_ids,context=context):
            if att.event_id.recurrent_id and att.event_id.recurrent_id > 0:
                new_google_internal_event_id = False
                source_event_record = calendar_event.browse(cr, uid, att.event_id.recurrent_id, context)
                source_attendee_record_id = att_obj.search(cr, uid, [('partner_id','=', myPartnerID), ('event_id','=',source_event_record.id)], context=context)
                source_attendee_record = att_obj.browse(cr, uid, source_attendee_record_id, context)
                if source_attendee_record:
                    source_attendee_record = source_attendee_record[0]

                if att.event_id.recurrent_id_date and source_event_record.allday and source_attendee_record.google_internal_event_id:
   ...

Read more...

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for OpenERP Addons because there has been no activity for 60 days.]

Changed in openobject-addons:
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.