diff options
| author | Martin Trigaux <mat@odoo.com> | 2017-09-20 10:16:05 +0200 |
|---|---|---|
| committer | Martin Trigaux <mat@odoo.com> | 2017-09-20 11:15:20 +0200 |
| commit | 3dad91aa19a485b178b8ea8f6b00641453dbc1ed (patch) | |
| tree | 27fae647a270750d3336d4cdd56892e36ae8e887 /addons | |
| parent | 9b9fcfe628f330bf31bfb841476d496e7892153f (diff) | |
[FIX] pad: avoid changing dictionnary size during iteration
In python3, items() and keys() returns iterators.
Modifying a dictionnary while iterating on it may trigger an error:
dictionary changed size during iteration
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/pad/models/pad.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/pad/models/pad.py b/addons/pad/models/pad.py index d0c2055c739..0cae43e3aeb 100644 --- a/addons/pad/models/pad.py +++ b/addons/pad/models/pad.py @@ -129,7 +129,7 @@ class PadCommon(models.AbstractModel): myPad.setText(path, (html2plaintext(vals[field.pad_content_field]).encode('utf-8'))) # Update the `pad_content_field` if the pad is modified - for k, v in vals.items(): + for k, v in list(vals.items()): field = self._fields[k] if hasattr(field, 'pad_content_field'): vals[field.pad_content_field] = self.pad_get_content(v) |
