diff options
| author | Fabien Meghazi <fme@openerp.com> | 2012-12-11 11:33:57 +0100 |
|---|---|---|
| committer | Fabien Meghazi <fme@openerp.com> | 2012-12-11 11:33:57 +0100 |
| commit | c124fc3281ff92df60eb82ddb3ba617a48e48fba (patch) | |
| tree | 6a52a03d4fe6832afaaf8bacdc477b36de8d3be8 /addons/web/controllers/main.py | |
| parent | e616a9aa149c6d67ee4b2febb891438929607dfe (diff) | |
[FIX] Roundtrips binary field value if not bin size
lp bug: https://launchpad.net/bugs/1082616 fixed
bzr revid: fme@openerp.com-20121211103357-csqirmhxehmszyu4
Diffstat (limited to 'addons/web/controllers/main.py')
| -rw-r--r-- | addons/web/controllers/main.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index 6a26e7dd422..93e526093f1 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -1246,6 +1246,7 @@ class Binary(openerpweb.Controller): jdata = simplejson.loads(data) model = jdata['model'] field = jdata['field'] + data = jdata['data'] id = jdata.get('id', None) filename_field = jdata.get('filename_field', None) context = jdata.get('context', {}) @@ -1254,7 +1255,9 @@ class Binary(openerpweb.Controller): fields = [field] if filename_field: fields.append(filename_field) - if id: + if data: + res = { field: data } + elif id: res = Model.read([int(id)], fields, context)[0] else: res = Model.default_get(fields, context) |
