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

Proposed by Ravi Gohil (OpenERP)
Status: Merged
Merged at revision: 1965
Proposed branch: lp:~openerp-dev/openobject-client/6.0-opw-582620-rgo
Merge into: lp:openobject-client/6.0
Diff against target: 23 lines (+3/-3)
1 file modified
bin/widget/view/form_gtk/ (+3/-3)
To merge this branch: bzr merge lp:~openerp-dev/openobject-client/6.0-opw-582620-rgo
Reviewer Review Type Date Requested Status
Numérigraphe (community) bug reference in bzr commit Needs Fixing
Naresh(OpenERP) Pending
Review via email:

Description of the change


Steps to reproduce:
- Install project scrum module,
- Open a record from "Project/Product Backlogs" in form view,
- Double click on a record from "Task" tab and cancel it and try to re-open that record

You wont be able to open it second time and a traceback is thrown client side saying,
"RuntimeError: dictionary changed size during iteration"

I have fixed this issue, kindly review it.


To post a comment you must log in.
Numérigraphe (numerigraphe) wrote :

Thanks for the express fix!
It seems to works for me.
The only thing missing is the bug # in the bzr history. This is useful when we need to find out how a bug was fixed some time later. Will you please be so kind as to add it with :
   bzr commit --unchanged --fixes lp:1091301
Lionel Sausin.

review: Needs Fixing (bug reference in bzr commit)
1965. By Ravi Gohil (OpenERP) on 2012-12-18

[FIX]: If we open an o2m field and close it without changing it, we wont be able to open it again. : (Maintenance Case : 582620)

Ravi Gohil (OpenERP) (rgo-openerp) wrote :

Hi Lionel,

I have updated this branch with --fixes lp:1091301.


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/'
2--- bin/widget/view/form_gtk/ 2012-09-28 12:12:59 +0000
3+++ bin/widget/view/form_gtk/ 2012-12-18 11:13:20 +0000
4@@ -314,8 +314,8 @@
5 models = []
6 for o2m_model in models:
7 values = o2m_model.value.copy()
8- model_value.setdefault(o2m_model, values)
9- group_model.setdefault(o2m_model, {})
10+ model_value[o2m_model] = values.copy()
11+ group_model[o2m_model] = {}
12 for key, val in values.iteritems():
13 if isinstance(val, ModelRecordGroup):
14 group_model[o2m_model][key] = val.models[:]
15@@ -326,7 +326,7 @@
16 def _restore_values(self, modified_model_values, group_model):
17 for model, value in modified_model_values.iteritems():
18 model.set(value, modified=True)
19- for f_name, models in group_model.get(model, {}):
20+ for f_name, models in group_model.get(model, {}).iteritems():
21 model.value[f_name].clear()
22 for sub_model in models:
23 # add model in ModelRecordGroup