Merge lp:~openerp-dev/openobject-addons/trunk-basecalendar-readgroup-count-bth into lp:openobject-addons

Proposed by Harry (OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-basecalendar-readgroup-count-bth
Merge into: lp:openobject-addons
Diff against target: 20 lines (+4/-3)
1 file modified
base_calendar/base_calendar.py (+4/-3)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-basecalendar-readgroup-count-bth
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+192489@code.launchpad.net
To post a comment you must log in.
8941. By Bhumi Thakkar (Open ERP)

[MERGE]Merge trunk.

8942. By Bhumi Thakkar (Open ERP)

[IMP]Improved code for count.

8943. By Bhumi Thakkar (Open ERP)

[MERGE]Merge trunk.

8944. By Bhumi Thakkar (Open ERP)

[MERGE]Merge trunk.

Unmerged revisions

8944. By Bhumi Thakkar (Open ERP)

[MERGE]Merge trunk.

8943. By Bhumi Thakkar (Open ERP)

[MERGE]Merge trunk.

8942. By Bhumi Thakkar (Open ERP)

[IMP]Improved code for count.

8941. By Bhumi Thakkar (Open ERP)

[MERGE]Merge trunk.

8940. By Bhumi Thakkar (Open ERP)

[IMP]Update count of read_group to match with search result.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'base_calendar/base_calendar.py'
--- base_calendar/base_calendar.py 2013-10-06 11:58:08 +0000
+++ base_calendar/base_calendar.py 2013-11-11 13:45:54 +0000
@@ -1457,13 +1457,14 @@
1457 if 'date' in groupby:1457 if 'date' in groupby:
1458 raise osv.except_osv(_('Warning!'), _('Group by date is not supported, use the calendar view instead.'))1458 raise osv.except_osv(_('Warning!'), _('Group by date is not supported, use the calendar view instead.'))
1459 virtual_id = context.get('virtual_id', True)1459 virtual_id = context.get('virtual_id', True)
1460 oldcontext = context.copy()
1460 context.update({'virtual_id': False})1461 context.update({'virtual_id': False})
1461 res = super(calendar_event, self).read_group(cr, uid, domain, fields, groupby, offset=offset, limit=limit, context=context, orderby=orderby)1462 res = super(calendar_event, self).read_group(cr, uid, domain, fields, groupby, offset=offset, limit=limit, context=context, orderby=orderby)
1462 for re in res:1463 for re in res:
1463 #remove the count, since the value is not consistent with the result of the search when expand the group1464 rec_count = self.search(cr, uid, re.get('__domain', []), offset=offset, limit=limit, order=orderby, context=oldcontext, count=True)
1464 for groupname in groupby:1465 for groupname in groupby:
1465 if re.get(groupname + "_count"):1466 #update the count, to consistent with the result of the search when expand the group
1466 del re[groupname + "_count"]1467 re.update({groupname + "_count": rec_count})
1467 re.get('__context', {}).update({'virtual_id' : virtual_id})1468 re.get('__context', {}).update({'virtual_id' : virtual_id})
1468 return res1469 return res
14691470

Subscribers

People subscribed via source and target branches

to all changes: