diff --git a/addons/project/project.py b/addons/project/project.py index 0b9584655a8..a746f88cfb8 100644 --- a/addons/project/project.py +++ b/addons/project/project.py @@ -389,6 +389,8 @@ class task(osv.osv): if not default.get('remaining_hours', False): default['remaining_hours'] = float(self.read(cr, uid, id, ['planned_hours'])['planned_hours']) default['active'] = True + if not default.get('name', False): + default['name'] = self.browse(cr, uid, id, context=context).name + _(' (copy)') return super(task, self).copy_data(cr, uid, id, default, context) def _check_dates(self, cr, uid, ids, context=None): @@ -397,7 +399,7 @@ class task(osv.osv): if task['date_start'] > task['date_end']: return False return True - + def _is_template(self, cr, uid, ids, field_name, arg, context=None): res = {} for task in self.browse(cr, uid, ids, context=context): @@ -453,15 +455,15 @@ class task(osv.osv): } _order = "sequence, priority, date_start, id" - + def _check_recursion(self, cr, uid, ids): obj_task = self.browse(cr, uid, ids[0]) parent_ids = [x.id for x in obj_task.parent_ids] children_ids = [x.id for x in obj_task.child_ids] - + if (obj_task.id in children_ids) or (obj_task.id in parent_ids): return False - + while(ids): cr.execute('SELECT DISTINCT task_id '\ 'FROM project_task_parent_rel '\ @@ -535,7 +537,7 @@ class task(osv.osv): 'ref_doc1': 'project.task,%d'% (task.id,), 'ref_doc2': 'project.project,%d'% (project.id,), }) - + for parent_id in task.parent_ids: if parent_id.state in ('pending','draft'): reopen = True diff --git a/addons/project_long_term/project_long_term.py b/addons/project_long_term/project_long_term.py index 79baff679cc..b795dda557e 100644 --- a/addons/project_long_term/project_long_term.py +++ b/addons/project_long_term/project_long_term.py @@ -214,6 +214,13 @@ class project_phase(osv.osv): self._check_date_end(cr, uid, next_phase, dt_end, context=context) return super(project_phase, self).write(cr, uid, ids, vals, context=context) + def copy(self, cr, uid, id, default=None, context=None): + if default is None: + default = {} + if not default.get('name', False): + default['name'] = self.browse(cr, uid, id, context=context).name + _(' (copy)') + return super(project_phase, self).copy(cr, uid, id, default, context) + def set_draft(self, cr, uid, ids, *args): self.write(cr, uid, ids, {'state': 'draft'}) return True diff --git a/addons/project_long_term/project_long_term_view.xml b/addons/project_long_term/project_long_term_view.xml index c85fe37026d..ae5b2600092 100644 --- a/addons/project_long_term/project_long_term_view.xml +++ b/addons/project_long_term/project_long_term_view.xml @@ -242,13 +242,13 @@ - - + + - + @@ -259,7 +259,7 @@ project.phase form tree,form,gantt,calendar - {'search_default_responsible_id':uid} + {'search_default_responsible_id':uid, 'search_default_project':1} You can subdivide your larger projects into several phases. For each phase, you can define your resources allocation (humans or engine), describe de differend task and link your phase with previous and next one, add constraints date and scheduling. A gantt view of your project phase is also available from this menu. Gantt view is a graphically draw of the project plan; it includes any task dependencies by visually adjusting task durations and priorities, and by linking tasks to each other. diff --git a/addons/project_messages/project_messages_view.xml b/addons/project_messages/project_messages_view.xml index bd476e3bc39..2689e2fd7c5 100644 --- a/addons/project_messages/project_messages_view.xml +++ b/addons/project_messages/project_messages_view.xml @@ -38,7 +38,6 @@
- @@ -72,13 +71,14 @@ + - - + + diff --git a/addons/project_scrum/project_scrum_view.xml b/addons/project_scrum/project_scrum_view.xml index f6bcc80060f..b8997d7ebb0 100644 --- a/addons/project_scrum/project_scrum_view.xml +++ b/addons/project_scrum/project_scrum_view.xml @@ -40,13 +40,14 @@ - - + + -