for record in self:
record['x_cost_center_name'] = ''
if record.cost_center:
record['x_cost_center_name'] += record.cost_center.display_name
if record.cost_center and record.cost_center.parent_id:
record['x_cost_center_name'] += ' / '+record.cost_center.parent_id.display_name
if record.cost_center and record.cost_center.parent_id and record.cost_center.parent_id.parent_id:
record['x_cost_center_name'] += ' / '+record.cost_center.parent_id.parent_id.display_name
for record in self:
record ['x_cost_center_name'] = ''
if record.cost_center:
record ['x_cost_center_name'] += record.cost_center.display_name
if record.cost_center and record.cost_center.parent_id:
record ['x_cost_center_name'] += ' / '+record.cost_center.parent_id.display_name
if record.cost_center and record.cost_center.parent_id and record.cost_center.parent_id.parent_id:
record ['x_cost_center_name'] += ' / '+record.cost_center.parent_id.parent_id.display_name