Permalink
Browse files

🌹 comment for default_value

Co-Authored-By: KolushovAlexandr <kolushov@it-projects.info>
  • Loading branch information...
yelizariev and KolushovAlexandr committed Dec 7, 2018
1 parent d93c25f commit e0ab6806588f06307cf445601d5dd47d9226188d
Showing with 3 additions and 0 deletions.
  1. +3 −0 web_website/models/ir_property.py
@@ -174,6 +174,9 @@ def get_multi(self, name, model, ids):
# result format: {res_id: (res_id, val, company_id, website_id), ...}
# from fetched result was taken only the last row for each res_id

# Take value for None key, i.e.
# {{None: (None, val0, company_id0, website_id0), ...}, res_id1: (res_id1, val1, company_id1, website_id1), ...}
# when there is no such key, use value None
default_value = result.pop(None, None)
default_company_id = default_value and default_value[2]
default_website_id = default_value and default_value[3]

0 comments on commit e0ab680

Please sign in to comment.