Do not show data in user status if unique

issue8994
review256411002
This commit is contained in:
Cédric Krier committed 2020-02-12 00:23:04 +01:00
1 parent 0d5875ee00
commit 2908b8beff
2 files changed
+10 -2

No files matched your search

+2
View File
@@ -1,3 +1,5 @@
* Do not show company in user status if unique
* Show employee in user status if not unique
* Add supervisor and subordinates of employee
* Add employee to rule context
* Add company and employee administrator group
+8 -2
View File
@@ -77,10 +77,16 @@ class User(metaclass=PoolMeta):
return companies
def get_status_bar(self, name):
def same_company(record):
return record.company == self.company
status = super(User, self).get_status_bar(name)
if (self.employee
and len(list(filter(same_company, self.employees))) > 1):
status += ' - %s' % self.employee.rec_name
if self.company:
status += ' - %s [%s]' % (self.company.rec_name,
self.company.currency.name)
if len(self.companies) > 1:
status += ' - %s' % self.company.rec_name
status += ' [%s]' % self.company.currency.code
return status
@fields.depends('main_company')