Skip to content
Snippets Groups Projects
Commit abf35065 authored by Aaron Bohy's avatar Aaron Bohy
Browse files

[FIX] web,hr: don't display dept complete_name in searchpanel


The departments being already rendered according to the hierarchy,
only the name of the department should be displayed (e.g. 'Direct
Sales' instead of 'Sales / Direct Sales'.

closes odoo/odoo#31353

Signed-off-by: default avatarRaphael Collet (rco) <rco@openerp.com>
parent 24d30331
No related branches found
No related tags found
No related merge requests found
......@@ -388,6 +388,12 @@ class Department(models.Model):
note = fields.Text('Note')
color = fields.Integer('Color Index')
@api.multi
def name_get(self):
if not self.env.context.get('hierarchical_naming', True):
return [(record.id, record.name) for record in self]
return super(Department, self).name_get()
@api.depends('name', 'parent_id.complete_name')
def _compute_complete_name(self):
for department in self:
......
......@@ -146,7 +146,7 @@ class Base(models.AbstractModel):
fields.append(parent_name)
return {
'parent_field': parent_name,
'values': Comodel.search_read([], fields),
'values': Comodel.with_context(hierarchical_naming=False).search_read([], fields),
}
@api.model
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment