Merge lp:~openerp-dev/openobject-addons/trunk-migration-project-hierarchy-dhr into lp:openobject-addons

Proposed by Dharti Ratani(OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-migration-project-hierarchy-dhr
Merge into: lp:openobject-addons
Diff against target: 30 lines (+20/-0)
1 file modified
project/project.py (+20/-0)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-migration-project-hierarchy-dhr
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+141055@code.launchpad.net

Description of the change

Hello,

     While assigning a project to a task, displayed the path/hierarchy of projects when picking the project.

Thanks

To post a comment you must log in.

Unmerged revisions

8448. By Dharti Ratani(OpenERP)

[IMP]Showing project hierarchy while assigning a project to a task

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'project/project.py'
2--- project/project.py 2012-12-20 11:47:30 +0000
3+++ project/project.py 2012-12-21 10:43:45 +0000
4@@ -1310,6 +1310,26 @@
5 _defaults = {
6 'use_tasks': True
7 }
8+ def name_get(self, cr, uid, ids, context=None):
9+ res = []
10+ if not ids:
11+ return res
12+ if isinstance(ids, (int, long)):
13+ ids = [ids]
14+ for id in ids:
15+ elmt = self.browse(cr, uid, id, context=context)
16+ res.append((id, self._get_one_full_name(elmt)))
17+ return res
18+
19+ def _get_one_full_name(self, elmt, level=6):
20+ if level<=0:
21+ return '...'
22+ if elmt.parent_id:
23+ parent_path = self._get_one_full_name(elmt.parent_id, level-1) + " / "
24+ else:
25+ parent_path = ''
26+ return parent_path + elmt.name
27+
28
29 class project_task_history(osv.osv):
30 """

Subscribers

People subscribed via source and target branches

to all changes: