[FIX] base: multi-company code

This commit is contained in:
Fabien Pinckaers
2019-08-26 10:20:13 +00:00
parent 74b055f75c
commit 0ec6acc458
2 changed files with 5 additions and 6 deletions
+4 -5
View File
@@ -526,13 +526,12 @@ class Environment(Mapping):
@property
def company(self):
""" return the company in which the user is logged in (as an instance) """
try:
company_id = int(self.context.get('allowed_company_ids')[0])
company_ids = self.context.get('allowed_company_ids', False)
if company_ids:
company_id = int(company_ids[0])
if company_id in self.user.company_ids.ids:
return self['res.company'].browse(company_id)
return self.user.company_id
except Exception:
return self.user.company_id
return self.user.company_id
@property
def companies(self):
+1 -1
View File
@@ -632,7 +632,7 @@ class PoFileReader:
'src': source,
'value': translation,
'comments': comments,
'res_id': int(line_number),
'res_id': int(line_number or 0),
'module': module,
}
continue