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
1=== modified file 'base_calendar/base_calendar.py'
2--- base_calendar/base_calendar.py 2013-10-06 11:58:08 +0000
3+++ base_calendar/base_calendar.py 2013-11-11 13:45:54 +0000
4@@ -1457,13 +1457,14 @@
5 if 'date' in groupby:
6 raise osv.except_osv(_('Warning!'), _('Group by date is not supported, use the calendar view instead.'))
7 virtual_id = context.get('virtual_id', True)
8+ oldcontext = context.copy()
9 context.update({'virtual_id': False})
10 res = super(calendar_event, self).read_group(cr, uid, domain, fields, groupby, offset=offset, limit=limit, context=context, orderby=orderby)
11 for re in res:
12- #remove the count, since the value is not consistent with the result of the search when expand the group
13+ rec_count = self.search(cr, uid, re.get('__domain', []), offset=offset, limit=limit, order=orderby, context=oldcontext, count=True)
14 for groupname in groupby:
15- if re.get(groupname + "_count"):
16- del re[groupname + "_count"]
17+ #update the count, to consistent with the result of the search when expand the group
18+ re.update({groupname + "_count": rec_count})
19 re.get('__context', {}).update({'virtual_id' : virtual_id})
20 return res
21

Subscribers

People subscribed via source and target branches

to all changes: