Merge lp:~openerp-dev/openobject-client/6.0-opw-16635-rch into lp:openobject-client/6.0

Proposed by Riken Bhorania (OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-client/6.0-opw-16635-rch
Merge into: lp:openobject-client/6.0
Diff against target: 12 lines (+1/-1)
1 file modified
bin/widget/view/form_gtk/many2many.py (+1/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-client/6.0-opw-16635-rch
Reviewer Review Type Date Requested Status
Jay Vora (Serpent Consulting Services) Pending
Review via email: mp+70741@code.launchpad.net

Description of the change

Preserve the order in which the records are added in the M2M field at the time of saving the main record.

To post a comment you must log in.

Unmerged revisions

1882. By Riken Bhorania (OpenERP)

[FIX]: Preserve the order in which records are added in the M2M field at the time of saving the main record.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/widget/view/form_gtk/many2many.py'
2--- bin/widget/view/form_gtk/many2many.py 2010-12-13 12:46:13 +0000
3+++ bin/widget/view/form_gtk/many2many.py 2011-08-08 13:24:35 +0000
4@@ -154,7 +154,7 @@
5 if ids == None:
6 ids = []
7 if self.name in self.model.pager_cache:
8- self.model.pager_cache[self.name] = list(set(self.model.pager_cache[self.name] + ids))
9+ self.model.pager_cache[self.name] = self.model.pager_cache[self.name] + [x for x in ids if x not in self.model.pager_cache[self.name]]
10 else:
11 self.model.pager_cache[self.name] = ids
12 self.model.is_m2m_modified = True