[FIX] demo_link: retrieve correctly the result from read()

The signature has changed and we get a list instead of a dictionary now.
This commit is contained in:
Yannick Tivisse 2016-10-14 13:59:34 +02:00
parent b884135512
commit 9bfc3e7eb6

View File

@ -167,10 +167,10 @@ def _fetch_fields(url, db, uid, password):
result = None
else:
action = server.execute_kw(db, uid, password, model, 'read', [id_, ['res_model', 'views']])
view_id = next((id_ for type, id_ in action['views'] if type == task.view), False)
view_id = next((id_ for type, id_ in action[0]['views'] if type == task.view), False)
fvg = server.execute_kw(
db, uid, password,
action['res_model'], 'fields_view_get', [], {
action[0]['res_model'], 'fields_view_get', [], {
'view_id': view_id,
'view_type': task.view
})