diff options
| author | Martin Trigaux <mat@openerp.com> | 2013-04-10 15:20:14 +0200 |
|---|---|---|
| committer | Martin Trigaux <mat@openerp.com> | 2013-04-10 15:20:14 +0200 |
| commit | 280e2c9ca4f4c5ac6ea06dacd10fc2744930abd2 (patch) | |
| tree | d3bbd74d403587208552676f1df1b14939b971fc /addons/project_issue | |
| parent | 0524ed98ed60835821b9af54bb162d70067399b7 (diff) | |
| parent | a0a9ae61e7e41607aa9f6c918f003fd5699ffa4c (diff) | |
[MERGE] Latest trunk
bzr revid: mat@openerp.com-20130410132014-b248u9j5bcm03h1y
Diffstat (limited to 'addons/project_issue')
| -rw-r--r-- | addons/project_issue/project_issue.py | 42 | ||||
| -rw-r--r-- | addons/project_issue/project_issue_menu.xml | 12 | ||||
| -rw-r--r-- | addons/project_issue/project_issue_view.xml | 28 | ||||
| -rw-r--r-- | addons/project_issue/report/project_issue_report_view.xml | 2 |
4 files changed, 64 insertions, 20 deletions
diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py index f8f6510cd49..7aa408a99aa 100644 --- a/addons/project_issue/project_issue.py +++ b/addons/project_issue/project_issue.py @@ -416,6 +416,12 @@ class project_issue(base_stage, osv.osv): self.write(cr, uid, ids, {'date_open': False, 'date_closed': False}) return res + def get_empty_list_help(self, cr, uid, help, context=None): + context['empty_list_help_model'] = 'project.project' + context['empty_list_help_id'] = context.get('default_project_id') + context['empty_list_help_document_name'] = _("issues") + return super(project_issue, self).get_empty_list_help(cr, uid, help, context=context) + # ------------------------------------------------------- # Stage management # ------------------------------------------------------- @@ -563,7 +569,8 @@ class project_issue(base_stage, osv.osv): return res -class project(osv.osv): + +class project(osv.Model): _inherit = "project.project" def _get_alias_models(self, cr, uid, context=None): @@ -578,7 +585,9 @@ class project(osv.osv): return res _columns = { - 'project_escalation_id' : fields.many2one('project.project','Project Escalation', help='If any issue is escalated from the current Project, it will be listed under the project selected here.', states={'close':[('readonly',True)], 'cancelled':[('readonly',True)]}), + 'project_escalation_id': fields.many2one('project.project', 'Project Escalation', + help='If any issue is escalated from the current Project, it will be listed under the project selected here.', + states={'close': [('readonly', True)], 'cancelled': [('readonly', True)]}), 'issue_count': fields.function(_issue_count, type='integer', string="Unclosed Issues"), } @@ -593,14 +602,13 @@ class project(osv.osv): (_check_escalation, 'Error! You cannot assign escalation to the same project!', ['project_escalation_id']) ] -project() -class account_analytic_account(osv.osv): +class account_analytic_account(osv.Model): _inherit = 'account.analytic.account' _description = 'Analytic Account' _columns = { - 'use_issues' : fields.boolean('Issues', help="Check this field if this project manages issues"), + 'use_issues': fields.boolean('Issues', help="Check this field if this project manages issues"), } def on_change_template(self, cr, uid, ids, template_id, context=None): @@ -611,16 +619,34 @@ class account_analytic_account(osv.osv): return res def _trigger_project_creation(self, cr, uid, vals, context=None): - if context is None: context = {} + if context is None: + context = {} res = super(account_analytic_account, self)._trigger_project_creation(cr, uid, vals, context=context) return res or (vals.get('use_issues') and not 'project_creation_in_progress' in context) -account_analytic_account() -class project_project(osv.osv): +class project_project(osv.Model): _inherit = 'project.project' + _defaults = { 'use_issues': True } + def _check_create_write_values(self, cr, uid, vals, context=None): + """ Perform some check on values given to create or write. """ + # Handle use_tasks / use_issues: if only one is checked, alias should take the same model + if vals.get('use_tasks') and not vals.get('use_issues'): + vals['alias_model'] = 'project.task' + elif vals.get('use_issues') and not vals.get('use_tasks'): + vals['alias_model'] = 'project.issue' + + def create(self, cr, uid, vals, context=None): + self._check_create_write_values(cr, uid, vals, context=context) + return super(project_project, self).create(cr, uid, vals, context=context) + + def write(self, cr, uid, ids, vals, context=None): + self._check_create_write_values(cr, uid, vals, context=context) + return super(project_project, self).write(cr, uid, ids, vals, context=context) + + # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/project_issue/project_issue_menu.xml b/addons/project_issue/project_issue_menu.xml index 78841f56156..308b4884844 100644 --- a/addons/project_issue/project_issue_menu.xml +++ b/addons/project_issue/project_issue_menu.xml @@ -14,13 +14,11 @@ <field name="domain" eval=""/> <field name="search_view_id" ref="view_project_issue_filter"/> <field name="help" type="html"> - <p class="oe_view_nocontent_create"> - Click to report a new issue. - </p><p> - The OpenERP issues tacker allows you to efficiantly manage things - like internal requests, software development bugs, customer - complaints, project troubles, material breakdowns, etc. - </p> + <p> + The OpenERP issues tacker allows you to efficiantly manage things + like internal requests, software development bugs, customer + complaints, project troubles, material breakdowns, etc. + </p> </field> </record> diff --git a/addons/project_issue/project_issue_view.xml b/addons/project_issue/project_issue_view.xml index 500a1376422..f888ff9da77 100644 --- a/addons/project_issue/project_issue_view.xml +++ b/addons/project_issue/project_issue_view.xml @@ -302,7 +302,18 @@ <field name="view_type">form</field> <field name="name">Issues</field> <field name="view_mode">kanban,tree,form,calendar,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="help" type="html"> + <p> + The OpenERP issues tacker allows you to efficiantly manage things + like internal requests, software development bugs, customer + complaints, project troubles, material breakdowns, etc. + </p> + </field> </record> <!-- Project --> @@ -324,9 +335,18 @@ <field name="priority" position="before"> <field name="project_escalation_id"/> </field> - <field name="alias_domain" position="after"> - <label for="alias_model" class="oe_edit_only" string="creates"/><field name="alias_model" class="oe_edit_only oe_inline"/> - </field> + <xpath expr='//span[@name="edit_alias"]' position='replace'> + <span class="oe_edit_only" name="edit_alias"> + <field name="alias_name" class="oe_inline" attrs="{'required': [('alias_id', '!=', False)]}"/> + @ + <field class="oe_inline" name="alias_domain"/> + <span class="oe_inline" + attrs="{'invisible': ['|', ('use_issues', '!=', True), ('use_tasks', '!=', True)]}"> + <label for="alias_model" string="creates"/> + <field name="alias_model" class="oe_inline"/> + </span> + </span> + </xpath> </field> </record> diff --git a/addons/project_issue/report/project_issue_report_view.xml b/addons/project_issue/report/project_issue_report_view.xml index 47ea91fad5f..e56c6612e0d 100644 --- a/addons/project_issue/report/project_issue_report_view.xml +++ b/addons/project_issue/report/project_issue_report_view.xml @@ -14,7 +14,7 @@ <field name="version_id" string="Version" invisible="1"/> <field name="priority" invisible="1"/> <field name="company_id" invisible="1" groups="base.group_multi_company"/> - <field name="section_id" invisible="1"/> + <field name="section_id" invisible="1" groups="base.group_multi_salesteams"/> <field name="user_id" invisible="1"/> <field name="channel_id" invisible="1"/> <field name="partner_id" invisible="1"/> |
