← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 873399] [NEW] [6.0.3] Show events of the current interval date

 

Public bug reported:

Hello.

In calendar view:

The function get_recurrent_ids in base_calendar.py returns the list
without considering the current interval of dates (month,week,day). The
list depends on the order of reading the ids and the limit (100 by
default) so it's a random list.

Add an 'order by' in the initial select make the deal for get the lasts
events. But the older are affected, so many are not visible.

I find a real solution a little further in the code, with this piece of
code:

for data in cr.dictfetchall():
                start_date = base_start_date and datetime.strptime(base_start_date[:10]+ ' 00:00:00' , "%Y-%m-%d %H:%M:%S") or False
                until_date = base_until_date and datetime.strptime(base_until_date[:10]+ ' 23:59:59', "%Y-%m-%d %H:%M:%S") or False
                print 'start_date', start_date
                print 'until_date', until_date
                if count > limit:
                    break
                event_date = datetime.strptime(data['date'], "%Y-%m-%d %H:%M:%S")
                #To check: If the start date is replace by event date .. the event date will be changed by that of calendar code
                start_date = event_date ->!!!!!

Why replace start_date by event_date? What does "To check" mean?
If i comment "start_date = event_date", the list become the ids between the start_date and until_date, and everything work beautiful.  I have all my events (until the limit) each month (and week,day).

Can you enlightened me?
Thanks

** Affects: openobject-addons
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to OpenERP Project Group.
https://bugs.launchpad.net/bugs/873399

Title:
  [6.0.3] Show events of the current interval date

Status in OpenERP Addons (modules):
  New

Bug description:
  Hello.

  In calendar view:

  The function get_recurrent_ids in base_calendar.py returns the list
  without considering the current interval of dates (month,week,day).
  The list depends on the order of reading the ids and the limit (100 by
  default) so it's a random list.

  Add an 'order by' in the initial select make the deal for get the
  lasts events. But the older are affected, so many are not visible.

  I find a real solution a little further in the code, with this piece
  of code:

  for data in cr.dictfetchall():
                  start_date = base_start_date and datetime.strptime(base_start_date[:10]+ ' 00:00:00' , "%Y-%m-%d %H:%M:%S") or False
                  until_date = base_until_date and datetime.strptime(base_until_date[:10]+ ' 23:59:59', "%Y-%m-%d %H:%M:%S") or False
                  print 'start_date', start_date
                  print 'until_date', until_date
                  if count > limit:
                      break
                  event_date = datetime.strptime(data['date'], "%Y-%m-%d %H:%M:%S")
                  #To check: If the start date is replace by event date .. the event date will be changed by that of calendar code
                  start_date = event_date ->!!!!!

  Why replace start_date by event_date? What does "To check" mean?
  If i comment "start_date = event_date", the list become the ids between the start_date and until_date, and everything work beautiful.  I have all my events (until the limit) each month (and week,day).

  Can you enlightened me?
  Thanks

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/873399/+subscriptions


Follow ups

References