[FIX] add the new 'lazy' keyword argument to the read_group calls inherited in several models (addons calendar, idea, note)
bzr revid: ged@openerp.com-20140409104230-5v0p49ij1wd87qhc
This commit is contained in:
parent
3d70e2c76c
commit
811456f35e
|
@ -1476,7 +1476,7 @@ class calendar_event(osv.Model):
|
|||
self.create_attendees(cr, uid, [res], context=context)
|
||||
return res
|
||||
|
||||
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None, orderby=False):
|
||||
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None, orderby=False, lazy=True):
|
||||
if not context:
|
||||
context = {}
|
||||
|
||||
|
@ -1484,7 +1484,7 @@ class calendar_event(osv.Model):
|
|||
raise osv.except_osv(_('Warning!'), _('Group by date is not supported, use the calendar view instead.'))
|
||||
virtual_id = context.get('virtual_id', True)
|
||||
context.update({'virtual_id': False})
|
||||
res = super(calendar_event, self).read_group(cr, uid, domain, fields, groupby, offset=offset, limit=limit, context=context, orderby=orderby)
|
||||
res = super(calendar_event, self).read_group(cr, uid, domain, fields, groupby, offset=offset, limit=limit, context=context, orderby=orderby, lazy)
|
||||
for result in res:
|
||||
#remove the count, since the value is not consistent with the result of the search when expand the group
|
||||
for groupname in groupby:
|
||||
|
|
|
@ -91,7 +91,7 @@ class IdeaIdea(osv.Model):
|
|||
# Technical stuff
|
||||
#------------------------------------------------------
|
||||
|
||||
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None, orderby=False):
|
||||
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None, orderby=False, lazy=True):
|
||||
""" Override read_group to always display all states. """
|
||||
if groupby and groupby[0] == "state":
|
||||
# Default result structure
|
||||
|
@ -103,7 +103,7 @@ class IdeaIdea(osv.Model):
|
|||
'state_count': 0,
|
||||
} for state_value, state_name in states]
|
||||
# Get standard results
|
||||
read_group_res = super(IdeaIdea, self).read_group(cr, uid, domain, fields, groupby, offset, limit, context, orderby)
|
||||
read_group_res = super(IdeaIdea, self).read_group(cr, uid, domain, fields, groupby, offset, limit, context, orderby, lazy)
|
||||
# Update standard results with default results
|
||||
result = []
|
||||
for state_value, state_name in states:
|
||||
|
|
|
@ -116,7 +116,7 @@ class note_note(osv.osv):
|
|||
}
|
||||
_order = 'sequence'
|
||||
|
||||
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None, orderby=False):
|
||||
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None, orderby=False, lazy=True):
|
||||
if groupby and groupby[0]=="stage_id":
|
||||
|
||||
#search all stages
|
||||
|
@ -169,7 +169,7 @@ class note_note(osv.osv):
|
|||
|
||||
else:
|
||||
return super(note_note, self).read_group(self, cr, uid, domain, fields, groupby,
|
||||
offset=offset, limit=limit, context=context, orderby=orderby)
|
||||
offset=offset, limit=limit, context=context, orderby=orderby,lazy=lazy)
|
||||
|
||||
|
||||
#upgrade config setting page to configure pad, fancy and tags mode
|
||||
|
|
Loading…
Reference in New Issue