Merge lp:~openerp-dev/openobject-client/6.0-opw-595350-rgo into lp:openobject-client/6.0

Proposed by Ravi Gohil (OpenERP)
Status: Merged
Approved by: Naresh(OpenERP)
Approved revision: 1967
Merged at revision: 1967
Proposed branch: lp:~openerp-dev/openobject-client/6.0-opw-595350-rgo
Merge into: lp:openobject-client/6.0
Diff against target: 46 lines (+10/-7)
1 file modified
bin/widget/model/group.py (+10/-7)
To merge this branch: bzr merge lp:~openerp-dev/openobject-client/6.0-opw-595350-rgo
Reviewer Review Type Date Requested Status
Naresh(OpenERP) (community) Approve
Review via email: mp+174972@code.launchpad.net

Description of the change

This branch is backported from lp:~openerp-dev/openobject-client/trunk-bug-756343-nch which fixes the issue mentioned in the bug report lp:756343

Kindly review the fix.

Thanks.

To post a comment you must log in.
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/widget/model/group.py'
2--- bin/widget/model/group.py 2010-12-16 07:01:07 +0000
3+++ bin/widget/model/group.py 2013-07-16 10:55:28 +0000
4@@ -128,8 +128,8 @@
5 def set_sequence(self, get_id, rec_id, field='sequence'):
6 seq_ids = []
7 index = 0
8- for module in self.models:
9- seq_ids += [module[field].get(module)]
10+ for model in self.models:
11+ seq_ids += [model[field].get(model)]
12 index = index +1
13
14 set_list = list(set(seq_ids))
15@@ -143,9 +143,10 @@
16 final_list = set_list + mod_list
17
18 index = 0
19- for module in self.models:
20- module[field].set(module, final_list[index], modified=True)
21- module.save()
22+ for model in self.models:
23+ model[field].set(model, final_list[index], modified=True)
24+ if model.id:
25+ model.save()
26 index = index +1
27 else:
28 seq_id = []
29@@ -156,7 +157,8 @@
30 index = 0
31 for x in range(get_id, rec_id):
32 self.models[x][field].set(self.models[x], sort_seq[index], modified=True)
33- self.models[x].save()
34+ if self.models[x].id:
35+ self.models[x].save()
36 index = index +1
37 else:
38 for x in range(rec_id,get_id+1):
39@@ -165,7 +167,8 @@
40 index = 0
41 for x in range(rec_id,get_id+1):
42 self.models[x][field].set(self.models[x], sort_seq[index], modified=True)
43- self.models[x].save()
44+ if self.models[x].id:
45+ self.models[x].save()
46 index = index +1
47
48