diff --git a/CHANGELOG b/CHANGELOG index 304433cbcb..0f8bc6ce17 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -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 diff --git a/res.py b/res.py index ce844d8dec..1586b39ebf 100644 --- a/res.py +++ b/res.py @@ -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')