[FIX] project_issue: correctly update alias
When choosing use tasks / use issues, correctly update the project alias. Indeed only the use issues checkbox had an onchange. This revision adds the onchange on use tasks so that the method correctly computes the new alias destination model. Also updated the _get_alias_models method to be more modular instead of hardcoding values. Call super.
This commit is contained in:
parent
2831d94c20
commit
f57e580f2d
|
@ -464,7 +464,9 @@ class project(osv.Model):
|
||||||
_inherit = "project.project"
|
_inherit = "project.project"
|
||||||
|
|
||||||
def _get_alias_models(self, cr, uid, context=None):
|
def _get_alias_models(self, cr, uid, context=None):
|
||||||
return [('project.task', "Tasks"), ("project.issue", "Issues")]
|
res = super(project, self)._get_alias_models(cr, uid, context=context)
|
||||||
|
res.append(("project.issue", "Issues"))
|
||||||
|
return res
|
||||||
|
|
||||||
def _issue_count(self, cr, uid, ids, field_name, arg, context=None):
|
def _issue_count(self, cr, uid, ids, field_name, arg, context=None):
|
||||||
Issue = self.pool['project.issue']
|
Issue = self.pool['project.issue']
|
||||||
|
|
|
@ -294,6 +294,9 @@
|
||||||
<field name="model">project.project</field>
|
<field name="model">project.project</field>
|
||||||
<field name="inherit_id" ref="project.edit_project"/>
|
<field name="inherit_id" ref="project.edit_project"/>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
|
<xpath expr='//field[@name="use_tasks"]' position='attributes'>
|
||||||
|
<attribute name="on_change">on_change_use_tasks_or_issues(use_tasks, use_issues)</attribute>
|
||||||
|
</xpath>
|
||||||
<xpath expr='//div[@name="options_active"]' position='inside'>
|
<xpath expr='//div[@name="options_active"]' position='inside'>
|
||||||
<field name="use_issues" class="oe_inline"
|
<field name="use_issues" class="oe_inline"
|
||||||
on_change="on_change_use_tasks_or_issues(use_tasks, use_issues)"/>
|
on_change="on_change_use_tasks_or_issues(use_tasks, use_issues)"/>
|
||||||
|
|
Loading…
Reference in New Issue