diff options
| author | Christophe Matthieu <chm@openerp.com> | 2013-04-15 12:34:31 +0200 |
|---|---|---|
| committer | Christophe Matthieu <chm@openerp.com> | 2013-04-15 12:34:31 +0200 |
| commit | ed4b70dfe33605fde42cccd788bb0f43ffefbec6 (patch) | |
| tree | 970ec3a89a382a0d2d8182710081206fb815ef4d /addons/project | |
| parent | 177f51cb541f6f635d445ca24ce4453d79eb6d39 (diff) | |
| parent | 53f168daaf989d97a4e514934afc7fe04d21193b (diff) | |
[MERGE] from trunk
bzr revid: chm@openerp.com-20130415103431-y96fhba0502b6aqc
Diffstat (limited to 'addons/project')
| -rw-r--r-- | addons/project/project.py | 14 | ||||
| -rw-r--r-- | addons/project/project_data.xml | 1 | ||||
| -rw-r--r-- | addons/project/project_view.xml | 52 | ||||
| -rw-r--r-- | addons/project/wizard/project_task_delegate.py | 2 |
4 files changed, 39 insertions, 30 deletions
diff --git a/addons/project/project.py b/addons/project/project.py index 0751865d9c4..eb328007d44 100644 --- a/addons/project/project.py +++ b/addons/project/project.py @@ -286,7 +286,6 @@ class project(osv.osv): 'type_ids': _get_type_common, 'alias_model': 'project.task', 'privacy_visibility': 'public', - 'alias_domain': False, # always hide alias during creation } # TODO: Why not using a SQL contraints ? @@ -531,11 +530,11 @@ def Project(): context = dict(context, project_creation_in_progress=True) mail_alias = self.pool.get('mail.alias') if not vals.get('alias_id') and vals.get('name', False): - vals.pop('alias_name', None) # prevent errors during copy() + alias_name = vals.pop('alias_name', None) # prevent errors during copy() alias_id = mail_alias.create_unique_alias(cr, uid, # Using '+' allows using subaddressing for those who don't # have a catchall domain setup. - {'alias_name': "project+"+short_name(vals['name'])}, + {'alias_name': alias_name or "project+"+short_name(vals['name'])}, model_name=vals.get('alias_model', 'project.task'), context=context) vals['alias_id'] = alias_id @@ -605,8 +604,7 @@ class task(base_stage, osv.osv): search_domain = [] project_id = self._resolve_project_id_from_context(cr, uid, context=context) if project_id: - search_domain += ['|', ('project_ids', '=', project_id)] - search_domain += [('id', 'in', ids)] + search_domain += [('project_ids', '=', project_id)] stage_ids = stage_obj._search(cr, uid, search_domain, order=order, access_rights_uid=access_rights_uid, context=context) result = stage_obj.name_get(cr, access_rights_uid, stage_ids, context=context) # restore order of the search @@ -889,6 +887,12 @@ class task(base_stage, osv.osv): res['fields'][f]['string'] = res['fields'][f]['string'].replace('Hours',tm) return res + def get_empty_list_help(self, cr, uid, help, context=None): + context['empty_list_help_id'] = context.get('default_project_id') + context['empty_list_help_model'] = 'project.project' + context['empty_list_help_document_name'] = _("tasks") + return super(task, self).get_empty_list_help(cr, uid, help, context=context) + # ---------------------------------------- # Case management # ---------------------------------------- diff --git a/addons/project/project_data.xml b/addons/project/project_data.xml index 025327d70b3..7bf1a623a2c 100644 --- a/addons/project/project_data.xml +++ b/addons/project/project_data.xml @@ -21,6 +21,7 @@ <record id="all_projects_account" model="account.analytic.account"> <field name="name">Projects</field> <field name="code">3</field> + <field name="type">view</field> </record> <function id="parent_project_default_set" model="ir.values" name="set" eval="('default',False,'parent_id', [('project.project', False)], all_projects_account, True, False, False, False, True)"/> diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml index 16dbe44ccc1..a016c46e0e0 100644 --- a/addons/project/project_view.xml +++ b/addons/project/project_view.xml @@ -50,16 +50,17 @@ <field name="name">Tasks</field> <field name="res_model">project.task</field> <field name="view_mode">kanban,tree,form,calendar,gantt,graph</field> - <field name="context">{'search_default_project_id': [active_id], 'default_project_id': active_id}</field> + <field name="context">{ + 'search_default_project_id': [active_id], + 'default_project_id': active_id, + }</field> <field name="search_view_id" ref="view_task_search_form"/> <field name="help" type="html"> - <p class="oe_view_nocontent_create"> - Click to create a new task. - </p><p> - OpenERP's project management allows you to manage the pipeline - of tasks in order to get things done efficiently. You can - track progress, discuss on tasks, attach documents, etc. - </p> + <p> + OpenERP's project management allows you to manage the pipeline + of tasks in order to get things done efficiently. You can + track progress, discuss on tasks, attach documents, etc. + </p> </field> </record> @@ -87,6 +88,17 @@ <h1> <field name="name" string="Project Name"/> </h1> + <div name="group_alias" + attrs="{'invisible': [('alias_domain', '=', False)]}"> + <label for="alias_id" string="Email Alias"/> + <field name="alias_id" class="oe_inline oe_read_only" required="0" nolabel="1"/> + <span name="edit_alias" class="oe_edit_only"> + <field name="alias_name" class="oe_inline" + attrs="{'required': [('alias_id', '!=', False)]}"/> + @ + <field name="alias_domain" class="oe_inline" readonly="1"/> + </span> + </div> <div name="options_active"> <field name="use_tasks" class="oe_inline"/> <label for="use_tasks"/> @@ -133,13 +145,6 @@ </page> <page string="Other Info"> <group> - <group string="Email Interface" attrs="{'invisible': [('alias_domain', '=', False)]}"> - <div> - <field name="alias_id" invisible="1" required="0"/> - <label for="alias_name" class="oe_edit_only "/> - <field name="alias_name" class="oe_inline" attrs="{'required': [('alias_id', '!=', False)]}"/>@<field name="alias_domain" class="oe_inline"/> - </div> - </group> <group string="Administration" groups="project.group_time_work_estimation_tasks"> <field name="planned_hours" widget="float_time"/> <field name="effective_hours" widget="float_time"/> @@ -231,7 +236,6 @@ <field name="color"/> <field name="task_count"/> <field name="alias_id"/> - <field name="alias_domain"/> <field name="doc_count"/> <templates> <t t-name="kanban-box"> @@ -245,8 +249,10 @@ </ul> </div> <div class="oe_kanban_content"> - <h4><field name="name"/></h4> + <div class="oe_kanban_alias" t-if="record.alias_id.value"> + <span class="oe_e">%%</span><small><field name="alias_id"/></small> + </div> <div class="oe_kanban_project_list"> <a t-if="record.use_tasks.raw_value" name="%(act_project_project_2_project_task_all)d" type="action" style="margin-right: 10px"> <span t-if="record.task_count.raw_value gt 1"><field name="task_count"/> Tasks</span> @@ -622,13 +628,11 @@ <field name="view_mode">kanban,tree,form,calendar,gantt,graph</field> <field name="search_view_id" ref="view_task_search_form"/> <field name="help" type="html"> - <p class="oe_view_nocontent_create"> - Click to create a new task. - </p><p> - OpenERP's project management allows you to manage the pipeline - of tasks in order to get things done efficiently. You can - track progress, discuss on tasks, attach documents, etc. - </p> + <p> + OpenERP's project management allows you to manage the pipeline + of tasks in order to get things done efficiently. You can + track progress, discuss on tasks, attach documents, etc. + </p> </field> </record> <record id="open_view_task_list_kanban" model="ir.actions.act_window.view"> diff --git a/addons/project/wizard/project_task_delegate.py b/addons/project/wizard/project_task_delegate.py index bb15c62db1f..bbea5ce2d8f 100644 --- a/addons/project/wizard/project_task_delegate.py +++ b/addons/project/wizard/project_task_delegate.py @@ -125,7 +125,7 @@ class project_task_delegate(osv.osv_memory): action_model, action_id = models_data.get_object_reference(cr, uid, 'project', 'action_view_task') view_model, task_view_form_id = models_data.get_object_reference(cr, uid, 'project', 'view_task_form2') view_model, task_view_tree_id = models_data.get_object_reference(cr, uid, 'project', 'view_task_tree2') - action = self.pool.get(action_model).read(cr, uid, action_id, context=context) + action = self.pool[action_model].read(cr, uid, action_id, context=context) action['res_id'] = delegated_tasks[task_id] action['view_id'] = False action['views'] = [(task_view_form_id, 'form'), (task_view_tree_id, 'tree')] |
