Skip to content
Permalink
Browse files

:ambulace: get_multi on one2many field returned id instead of a record

  • Loading branch information...
KolushovAlexandr committed Jun 10, 2019
1 parent e9631fc commit ba978cbc0da056f070b54c897c8005ac38ffb67f
Showing with 13 additions and 2 deletions.
  1. +1 −1 web_website/__manifest__.py
  2. +4 −0 web_website/doc/changelog.rst
  3. +8 −1 web_website/models/ir_property.py
@@ -7,7 +7,7 @@
"category": "Hidden",
# "live_test_url": "",
"images": [],
"version": "12.0.3.0.3",
"version": "12.0.3.0.4",
"application": False,

"author": "IT-Projects LLC, Ivan Yelizariev",
@@ -1,3 +1,7 @@
`3.0.4`
-------
- **Fix:** Incorrect return data in get_multi in case of 'many2one' field, id instead of a record

`3.0.3`
-------
- **Fix:** Error related to incorrect getting properties for html fields
@@ -206,9 +206,16 @@ def get_multi(self, name, model, ids):
# 4 Company is matched, Resource and Website are empty
result[id] = default_value

if field.type == 'many2one':
def clean(data):
return data and self.env[field.comodel_name].browse(data[1])
else:
def clean(data):
return data and data[1]

for key, value in result.items():
# set data to appropriate form
result[key] = value and value[1]
result[key] = clean(value)
# result format: {id: val, ...}
return result

0 comments on commit ba978cb

Please sign in to comment.
You can’t perform that action at this time.