diff options
| author | Antonin Bourguignon <abo@openerp.com> | 2012-07-31 15:35:08 +0200 |
|---|---|---|
| committer | Antonin Bourguignon <abo@openerp.com> | 2012-07-31 15:35:08 +0200 |
| commit | 2e0ab8a6a178e8fd90e047b67af7e63a1743a2ff (patch) | |
| tree | 47bc85f52500fa25c45dbcb781416988a6b80c25 /addons/project_issue | |
| parent | 163a8b629ed417743e632543eb21e6772389a461 (diff) | |
| parent | f76a672ba467a6a51727b5a36618a0db07945cf2 (diff) | |
[MERGE] trunk-portal_public_layout-abo (improve portal views, access rights and ir rules)
bzr revid: abo@openerp.com-20120731133508-n2xr4jf1jm4j51ep
Diffstat (limited to 'addons/project_issue')
| -rw-r--r-- | addons/project_issue/__openerp__.py | 7 | ||||
| -rw-r--r-- | addons/project_issue/board_project_issue_view.xml | 2 | ||||
| -rw-r--r-- | addons/project_issue/project_issue.py | 38 | ||||
| -rw-r--r-- | addons/project_issue/project_issue_demo.xml | 469 | ||||
| -rw-r--r-- | addons/project_issue/project_issue_view.xml | 169 | ||||
| -rw-r--r-- | addons/project_issue/report/project_issue_report.py | 4 | ||||
| -rw-r--r-- | addons/project_issue/report/project_issue_report_view.xml | 15 | ||||
| -rw-r--r-- | addons/project_issue/static/src/js/project_issue.js | 13 |
8 files changed, 357 insertions, 360 deletions
diff --git a/addons/project_issue/__openerp__.py b/addons/project_issue/__openerp__.py index fa7d002f571..8aeecf2985e 100644 --- a/addons/project_issue/__openerp__.py +++ b/addons/project_issue/__openerp__.py @@ -25,7 +25,7 @@ 'version': '1.0', 'category': 'Project Management', "sequence": 22, - "summary": "Multi Level Support", + "summary": "Support, Bug Traker, Helpdesk", 'description': """ This module provides Issues/Bugs Management in Project. ======================================================= @@ -39,7 +39,7 @@ and decide on their status as they evolve. 'website': 'http://www.openerp.com', 'images': ['images/issue_analysis.jpeg','images/project_issue.jpeg'], 'depends': [ - 'base_status', + 'base_status', 'crm', 'project', ], @@ -66,6 +66,9 @@ and decide on their status as they evolve. 'auto_install': False, 'application': True, 'certificate' : '001236490750848623845', + 'js': [ + 'static/src/js/project_issue.js', + ], } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/project_issue/board_project_issue_view.xml b/addons/project_issue/board_project_issue_view.xml index cedcd85d4fc..8bc34177d7d 100644 --- a/addons/project_issue/board_project_issue_view.xml +++ b/addons/project_issue/board_project_issue_view.xml @@ -18,7 +18,7 @@ <field name="progress" widget="progressbar" attrs="{'invisible':[('task_id','=',False)]}"/> <field name="stage_id" widget="selection" readonly="1"/> <field name="state" groups="base.group_no_one"/> - <field name="categ_id" invisible="1"/> + <field name="categ_ids" invisible="1"/> <field name="task_id" invisible="1"/> </tree> </field> diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py index a7c9d2b5bc3..4c973eed068 100644 --- a/addons/project_issue/project_issue.py +++ b/addons/project_issue/project_issue.py @@ -236,7 +236,7 @@ class project_issue(base_stage, osv.osv): 'date_closed': fields.datetime('Closed', readonly=True,select=True), 'date': fields.datetime('Date'), 'channel_id': fields.many2one('crm.case.channel', 'Channel', help="Communication channel."), - 'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('object_id.model', '=', 'crm.project.bug')]"), + 'categ_ids': fields.many2many('project.category', string='Categories'), 'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority', select=True), 'version_id': fields.many2one('project.issue.version', 'Version'), 'stage_id': fields.many2one ('project.task.type', 'Stage', @@ -279,7 +279,6 @@ class project_issue(base_stage, osv.osv): 'section_id': lambda s, cr, uid, c: s._get_default_section_id(cr, uid, c), 'company_id': lambda s, cr, uid, c: s.pool.get('res.company')._company_default_get(cr, uid, 'crm.helpdesk', context=c), 'priority': crm.AVAILABLE_PRIORITIES[2][0], - 'categ_id' : lambda *a: False, } _group_by_full = { @@ -304,11 +303,11 @@ class project_issue(base_stage, osv.osv): def convert_issue_task(self, cr, uid, ids, context=None): if context is None: context = {} - + case_obj = self.pool.get('project.issue') data_obj = self.pool.get('ir.model.data') task_obj = self.pool.get('project.task') - + result = data_obj._get_id(cr, uid, 'project', 'view_task_search_form') res = data_obj.read(cr, uid, result, ['res_id']) id2 = data_obj._get_id(cr, uid, 'project', 'view_task_form2') @@ -351,23 +350,6 @@ class project_issue(base_stage, osv.osv): 'nodestroy': True } - - def _convert(self, cr, uid, ids, xml_id, context=None): - data_obj = self.pool.get('ir.model.data') - id2 = data_obj._get_id(cr, uid, 'project_issue', xml_id) - categ_id = False - if id2: - categ_id = data_obj.browse(cr, uid, id2, context=context).res_id - if categ_id: - self.write(cr, uid, ids, {'categ_id': categ_id}) - return True - - def convert_to_feature(self, cr, uid, ids, context=None): - return self._convert(cr, uid, ids, 'feature_request_categ', context=context) - - def convert_to_bug(self, cr, uid, ids, context=None): - return self._convert(cr, uid, ids, 'bug_categ', context=context) - def copy(self, cr, uid, id, default=None, context=None): issue = self.read(cr, uid, id, ['name'], context=context) if not default: @@ -376,7 +358,7 @@ class project_issue(base_stage, osv.osv): default['name'] = issue['name'] + _(' (copy)') return super(project_issue, self).copy(cr, uid, id, default=default, context=context) - + def write(self, cr, uid, ids, vals, context=None): #Update last action date every time the user change the stage, the state or send a new email logged_fields = ['stage_id', 'state', 'message_ids'] @@ -463,7 +445,7 @@ class project_issue(base_stage, osv.osv): # ------------------------------------------------------- # Mail gateway # ------------------------------------------------------- - + def message_new(self, cr, uid, msg, custom_values=None, context=None): """ Overrides mail_thread message_new that is called by the mailgateway through message_process. @@ -485,7 +467,7 @@ class project_issue(base_stage, osv.osv): custom_values.update(self.message_partner_by_email(cr, uid, msg.get('from'), context=context)) res_id = super(project_issue, self).message_new(cr, uid, msg, custom_values=custom_values, context=context) - self.convert_to_bug(cr, uid, [res_id], context=context) + # self.convert_to_bug(cr, uid, [res_id], context=context) return res_id def message_update(self, cr, uid, ids, msg, update_vals=None, context=None): @@ -515,7 +497,7 @@ class project_issue(base_stage, osv.osv): update_vals[key] = res.group(2).lower() return super(project_issue, self).message_update(cr, uid, ids, update_vals=update_vals, context=context) - + # ------------------------------------------------------- # OpenChatter methods and notifications # ------------------------------------------------------- @@ -588,18 +570,18 @@ project() class account_analytic_account(osv.osv): _inherit = 'account.analytic.account' _description = 'Analytic Account' - + _columns = { 'use_issues' : fields.boolean('Issues Tracking', help="Check this field if this project manages issues"), } - + def on_change_template(self, cr, uid, ids, template_id, context=None): res = super(account_analytic_account, self).on_change_template(cr, uid, ids, template_id, context=context) if template_id and 'value' in res: template = self.browse(cr, uid, template_id, context=context) res['value']['use_issues'] = template.use_issues return res - + def _trigger_project_creation(self, cr, uid, vals, context=None): res = super(account_analytic_account, self)._trigger_project_creation(cr, uid, vals, context=context) return res or vals.get('use_issues') diff --git a/addons/project_issue/project_issue_demo.xml b/addons/project_issue/project_issue_demo.xml index b3fb4582cf2..298dd6a25d9 100644 --- a/addons/project_issue/project_issue_demo.xml +++ b/addons/project_issue/project_issue_demo.xml @@ -1,236 +1,239 @@ <?xml version="1.0"?> <openerp> -<data noupdate="1"> - - <record id="crm_case_buginaccountsmodule0" model="project.issue"> - <field eval="time.strftime('%Y-%m-08 10:15:00')" name="date"/> - <field eval=""5"" name="priority"/> - <field name="user_id" ref="base.user_root"/> - <field name="partner_id" ref="base.res_partner_agrolait"/> - <field name="section_id" ref="crm.section_sales_department"/> - <field eval="1" name="active"/> - <field name="categ_id" ref="bug_categ"/> - <field name="project_id" ref="project.project_project_22"/> - <field eval="15.0" name="duration"/> - <field eval=""Bug in Accounts module"" name="name"/> - <field eval=""agr@agrolait.com"" name="email_from"/> - <field name="stage_id" ref="project.project_tt_specification"/> - </record> - - <record id="crm_case_programnotgivingproperoutput0" model="project.issue"> - <field eval="time.strftime('%Y-%m-15 12:50:00')" name="date"/> - <field eval=""3"" name="priority"/> - <field name="user_id" ref="base.user_root"/> - <field name="partner_id" ref="base.res_partner_asus"/> - <field name="section_id" ref="crm.section_sales_department"/> - <field eval="1" name="active"/> - <field eval="3.5" name="duration"/> - <field name="categ_id" ref="bug_categ"/> - <field eval=""Program not giving proper output"" name="name"/> - <field name="project_id" ref="project.project_project_22"/> - <field name="stage_id" ref="project.project_tt_specification"/> - </record> - - <record id="crm_case_outputincorrect0" model="project.issue"> - <field eval="time.strftime('%Y-%m-18 14:30:00')" name="date"/> - <field eval=""4"" name="priority"/> - <field name="user_id" ref="base.user_demo"/> - <field name="section_id" ref="crm.section_sales_department"/> - <field eval="1" name="active"/> - <field eval="2.3" name="duration"/> - <field name="categ_id" ref="bug_categ"/> - <field name="project_id" ref="project.project_project_23"/> - <field eval=""Output incorrect"" name="name"/> - <field name="stage_id" ref="project.project_tt_development"/> - </record> - - <record id="crm_case_problemloadingpage0" model="project.issue"> - <field eval="time.strftime('%Y-%m-20 15:25:05')" name="date"/> - <field eval=""3"" name="priority"/> - <field name="user_id" ref="base.user_root"/> - <field name="partner_id" ref="base.res_partner_14"/> - <field name="section_id" ref="crm.section_sales_department"/> - <field eval="1" name="active"/> - <field eval="4.0" name="duration"/> - <field name="categ_id" ref="bug_categ"/> - <field name="project_id" ref="project.project_project_22"/> - <field eval=""Problem loading page"" name="name"/> - <field name="stage_id" ref="project.project_tt_testing"/> - </record> - - <record id="crm_case_pagenotfound0" model="project.issue"> - <field eval="time.strftime('%Y-%m-22 18:15:00')" name="date"/> - <field eval=""3"" name="priority"/> - <field name="user_id" ref="base.user_root"/> - <field name="partner_id" ref="base.res_partner_desertic_hispafuentes"/> - <field name="section_id" ref="crm.section_sales_department"/> - <field eval="1" name="active"/> - <field eval="1.0" name="duration"/> - <field name="categ_id" ref="bug_categ"/> - <field name="project_id" ref="project.project_project_22"/> - <field eval=""Page not Found"" name="name"/> - <field name="stage_id" ref="project.project_tt_development"/> - </record> - - <record id="crm_case_programmingerror0" model="project.issue"> - <field eval="time.strftime('%Y-%m-24 09:45:00')" name="date"/> - <field eval=""3"" name="priority"/> - <field name="user_id" ref="base.user_root"/> - <field name="partner_id" ref="base.res_partner_5"/> - <field name="section_id" ref="crm.section_sales_department"/> - <field eval="1" name="active"/> - <field eval="4.0" name="duration"/> - <field name="categ_id" ref="bug_categ"/> - <field name="project_id" ref="project.project_project_22"/> - <field eval=""Programming Error"" name="name"/> - <field name="stage_id" ref="project.project_tt_testing"/> - </record> - - <record id="crm_case_logicalerrorinprogram0" model="project.issue"> - <field eval="time.strftime('%Y-%m-26 11:10:00')" name="date"/> - <field eval=""2"" name="priority"/> - <field name="user_id" ref="base.user_root"/> - <field name="partner_id" ref="base.res_partner_6"/> - <field name="section_id" ref="crm.section_sales_department"/> - <field eval="1" name="active"/> - <field eval="2.0" name="duration"/> - <field name="categ_id" ref="bug_categ"/> - <field name="project_id" ref="project.project_project_9"/> - <field eval=""Logical Error in Program"" name="name"/> - <field name="stage_id" ref="project.project_tt_testing"/> - </record> - - <record id="crm_case_constrainterror0" model="project.issue"> - <field eval="time.strftime('%Y-%m-25 13:35:00')" name="date"/> - <field eval=""2"" name="priority"/> - <field name="user_id" ref="base.user_root"/> - <field name="partner_id" ref="base.res_partner_6"/> - <field name="section_id" ref="crm.section_sales_department"/> - <field eval="1" name="active"/> - <field eval="7.3" name="duration"/> - <field name="categ_id" ref="bug_categ"/> - <field name="project_id" ref="project.project_project_9"/> - <field eval=""Constraint Error"" name="name"/> - <field name="stage_id" ref="project.project_tt_testing"/> - </record> - - <record id="crm_case_errorinprogram0" model="project.issue"> - <field eval="time.strftime('%Y-%m-28 15:40:00')" name="date"/> - <field eval=""2"" name="priority"/> - <field name="user_id" ref="base.user_demo"/> - <field name="partner_id" ref="base.res_partner_5"/> - <field eval="1" name="active"/> - <field eval="1.3" name="duration"/> - <field name="categ_id" ref="feature_request_categ"/> - <field name="project_id" ref="project.project_project_22"/> - <field eval=""Error in Program"" name="name"/> - <field name="stage_id" ref="project.project_tt_testing"/> - </record> - - <record id="crm_case_patcheserrorinprogram0" model="project.issue"> - <field eval="time.strftime('%Y-%m-28 16:30:00')" name="date"/> - <field eval=""2"" name="priority"/> - <field name="user_id" ref="base.user_root"/> - <field name="partner_id" ref="base.res_partner_2"/> - <field name="section_id" ref="crm.section_sales_department"/> - <field eval="1" name="active"/> - <field eval="13.0" name="duration"/> - <field name="categ_id" ref="feature_request_categ"/> - <field name="project_id" ref="project.project_project_9"/> - <field eval=""Patches Error in Program"" name="name"/> - <field name="stage_id" ref="project.project_tt_testing"/> - </record> - - <record id="crm_case_newfeaturestobeadded0" model="project.issue"> - <field eval="time.strftime('%Y-%m-01 12:15:10')" name="date"/> - <field eval=""4"" name="priority"/> - <field name="user_id" ref="base.user_root"/> - <field name="partner_id" ref="base.res_partner_maxtor"/> - <field name="section_id" ref="crm.section_sales_department"/> - <field eval="1" name="active"/> - <field eval="3.2" name="duration"/> - <field name="categ_id" ref="feature_request_categ"/> - <field name="project_id" ref="project.project_project_21"/> - <field eval=""New Features To Be Added"" name="name"/> - <field name="stage_id" ref="project.project_tt_merge"/> - </record> - - <record id="crm_case_addmenustothemodule0" model="project.issue"> - <field eval="time.strftime('%Y-%m-05 18:00:00')" name="date"/> - <field eval=""1"" name="priority"/> - <field name="user_id" ref="base.user_demo"/> - <field name="partner_id" ref="base.res_partner_9"/> - <field name="section_id" ref="crm.section_sales_department"/> - <field eval="1" name="active"/> - <field eval="3.0" name="duration"/> - <field name="categ_id" ref="feature_request_categ"/> - <field name="project_id" ref="project.project_project_21"/> - <field eval=""Add menus to the module"" name="name"/> - <field eval=""info@opensides.be"" name="email_from"/> - <field name="stage_id" ref="project.project_tt_development"/> - </record> - - <record id="crm_case_includeattendancesheetinproject0" model="project.issue"> - <field eval="time.strftime('%Y-%m-10 17:05:30')" name="date"/> - <field eval=""3"" name="priority"/> - <field name="user_id" ref="base.user_root"/> - <field name="partner_id" ref="base.res_partner_10"/> - <field name="section_id" ref="crm.section_sales_department"/> - <field eval="1" name="active"/> - <field eval="2.0" name="duration"/> - <field name="categ_id" ref="feature_request_categ"/> - <field name="project_id" ref="project.project_project_9"/> - <field eval=""Include Attendance sheet in Project"" name="name"/> - <field eval=""contact@tecsas.fr"" name="email_from"/> - <field name="stage_id" ref="project.project_tt_development"/> - </record> - - <record id="crm_case_createnewobject0" model="project.issue"> - <field eval="time.strftime('%Y-%m-15 10:35:15')" name="date"/> - <field eval=""3"" name="priority"/> - <field name="user_id" ref="base.user_root"/> - <field name="partner_id" ref="base.res_partner_6"/> - <field name="section_id" ref="crm.section_sales_department"/> - <field eval="1" name="active"/> - <field eval="2.45" name="duration"/> - <field name="categ_id" ref="feature_request_categ"/> - <field name="project_id" ref="project.project_project_22"/> - <field eval=""Create new object"" name="name"/> - <field name="stage_id" ref="project.project_tt_specification"/> - </record> - - <record id="crm_case_improvereportsinhrms0" model="project.issue"> - <field eval="time.strftime('%Y-%m-19 12:15:00')" name="date"/> - <field eval=""4"" name="priority"/> - <field name="user_id" ref="base.user_root"/> - <field name="partner_id" ref="base.res_partner_11"/> - <field name="section_id" ref="crm.section_sales_department"/> - <field eval="1" name="active"/> - <field eval="15.0" name="duration"/> - <field name="categ_id" ref="feature_request_categ"/> - <field name="project_id" ref="project.project_project_22"/> - <field eval=""Improve Reports in HRMS"" name="name"/> - <field name="stage_id" ref="project.project_tt_development"/> - </record> - - <record id="crm_case_improvereportsinpms0" model="project.issue"> - <field eval="time.strftime('%Y-%m-21 14:30:00')" name="date"/> - <field eval=""2"" name="priority"/> - <field name="user_id" ref="base.user_demo"/> - <field name="partner_id" ref="base.res_partner_11"/> - <field name="section_id" ref="crm.section_sales_department"/> - <field eval="1" name="active"/> - <field eval="06.15" name="duration"/> - <field name="categ_id" ref="feature_request_categ"/> - <field name="project_id" ref="project.project_project_22"/> - <field eval=""Improve Reports in PMS"" name="name"/> - <field name="stage_id" ref="project.project_tt_specification"/> - </record> - - <!-- Call Function to set some issues as Unread --> - <function model="project.issue" name="message_mark_as_unread" - eval="[ ref('crm_case_improvereportsinhrms0'), ref('crm_case_createnewobject0')], {}" - /> - -</data> + <data noupdate="1"> + + <!-- Categories --> + <record id="project_issue_category_01" model="project.category"> + <field name="name">Little problem</field> + </record> + <record id="project_issue_category_02" model="project.category"> + <field name="name">PBCK</field> + </record> + <record id="project_issue_category_03" model="project.category"> + <field name="name">Deadly bug</field> + </record> + + <!-- Issues --> + <record id="crm_case_buginaccountsmodule0" model="project.issue"> + <field eval="time.strftime('%Y-%m-08 10:15:00')" name="date"/> + <field name="priority">5</field> + <field name="user_id" ref="base.user_root"/> + <field name="partner_id" ref="base.res_partner_agrolait"/> + <field name="section_id" ref="crm.section_sales_department"/> + <field eval="1" name="active"/> + <field name="project_id" ref="project.project_project_22"/> + <field eval="15.0" name="duration"/> + <field name="name">Bug in Accounts module</field> + <field name="email_from">agr@agrolait.com</field> + <field name="stage_id" ref="project.project_tt_specification"/> + <field name="categ_ids" eval="[(6, 0, [ + ref('project_issue_category_01')])]"/> + </record> + + <record id="crm_case_programnotgivingproperoutput0" model="project.issue"> + <field eval="time.strftime('%Y-%m-15 12:50:00')" name="date"/> + <field name="priority">3</field> + <field name="user_id" ref="base.user_root"/> + <field name="partner_id" ref="base.res_partner_asus"/> + <field name="section_id" ref="crm.section_sales_department"/> + <field eval="1" name="active"/> + <field eval="3.5" name="duration"/> + <field name="name">Program not giving proper output</field> + <field name="project_id" ref="project.project_project_22"/> + <field name="stage_id" ref="project.project_tt_specification"/> + </record> + + <record id="crm_case_outputincorrect0" model="project.issue"> + <field eval="time.strftime('%Y-%m-18 14:30:00')" name="date"/> + <field name="priority">4</field> + <field name="user_id" ref="base.user_demo"/> + <field name="section_id" ref="crm.section_sales_department"/> + <field eval="1" name="active"/> + <field eval="2.3" name="duration"/> + <field name="project_id" ref="project.project_project_23"/> + <field name="name">Output incorrect</field> + <field name="stage_id" ref="project.project_tt_development"/> + <field name="categ_ids" eval="[(6, 0, [ + ref('project_issue_category_01'), + ref('project_issue_category_02')])]"/> + </record> + + <record id="crm_case_problemloadingpage0" model="project.issue"> + <field eval="time.strftime('%Y-%m-20 15:25:05')" name="date"/> + <field name="priority">3</field> + <field name="user_id" ref="base.user_root"/> + <field name="partner_id" ref="base.res_partner_14"/> + <field name="section_id" ref="crm.section_sales_department"/> + <field eval="1" name="active"/> + <field eval="4.0" name="duration"/> + <field name="project_id" ref="project.project_project_22"/> + <field name="name">Problem loading page</field> + <field name="stage_id" ref="project.project_tt_testing"/> + </record> + + <record id="crm_case_pagenotfound0" model="project.issue"> + <field eval="time.strftime('%Y-%m-22 18:15:00')" name="date"/> + <field name="priority">3</field> + <field name="user_id" ref="base.user_root"/> + <field name="partner_id" ref="base.res_partner_desertic_hispafuentes"/> + <field name="section_id" ref="crm.section_sales_department"/> + <field eval="1" name="active"/> + <field eval="1.0" name="duration"/> + <field name="project_id" ref="project.project_project_22"/> + <field name="name">Page not Found</field> + <field name="stage_id" ref="project.project_tt_development"/> + </record> + + <record id="crm_case_programmingerror0" model="project.issue"> + <field eval="time.strftime('%Y-%m-24 09:45:00')" name="date"/> + <field name="priority">3</field> + <field name="user_id" ref="base.user_root"/> + <field name="partner_id" ref="base.res_partner_5"/> + <field name="section_id" ref="crm.section_sales_department"/> + <field eval="1" name="active"/> + <field eval="4.0" name="duration"/> + <field name="project_id" ref="project.project_project_22"/> + <field name="name">Programming Error</field> + <field name="stage_id" ref="project.project_tt_testing"/> + <field name="categ_ids" eval="[(6, 0, [ + ref('project_issue_category_02'), + ref('project_issue_category_03')])]"/> + </record> + + <record id="crm_case_logicalerrorinprogram0" model="project.issue"> + <field eval="time.strftime('%Y-%m-26 11:10:00')" name="date"/> + <field name="priority">2</field> + <field name="user_id" ref="base.user_root"/> + <field name="partner_id" ref="base.res_partner_6"/> + <field name="section_id" ref="crm.section_sales_department"/> + <field eval="1" name="active"/> + <field eval="2.0" name="duration"/> + <field name="project_id" ref="project.project_project_9"/> + <field name="name">Logical Error in Program</field> + <field name="stage_id" ref="project.project_tt_testing"/> + </record> + + <record id="crm_case_constrainterror0" model="project.issue"> + <field eval="time.strftime('%Y-%m-25 13:35:00')" name="date"/> + <field name="priority">2</field> + <field name="user_id" ref="base.user_root"/> + <field name="partner_id" ref="base.res_partner_6"/> + <field name="section_id" ref="crm.section_sales_department"/> + <field eval="1" name="active"/> + <field eval="7.3" name="duration"/> + <field name="project_id" ref="project.project_project_9"/> + <field name="name">Constraint Error</field> + <field name="stage_id" ref="project.project_tt_testing"/> + </record> + + <record id="crm_case_errorinprogram0" model="project.issue"> + <field eval="time.strftime('%Y-%m-28 15:40:00')" name="date"/> + <field name="priority">2</field> + <field name="user_id" ref="base.user_demo"/> + <field name="partner_id" ref="base.res_partner_5"/> + <field eval="1" name="active"/> + <field eval="1.3" name="duration"/> + <field name="project_id" ref="project.project_project_22"/> + <field name="name">Error in Program</field> + <field name="stage_id" ref="project.project_tt_testing"/> + </record> + + <record id="crm_case_patcheserrorinprogram0" model="project.issue"> + <field eval="time.strftime('%Y-%m-28 16:30:00')" name="date"/> + <field name="priority">2</field> + <field name="user_id" ref="base.user_root"/> + <field name="partner_id" ref="base.res_partner_2"/> + <field name="section_id" ref="crm.section_sales_department"/> + <field eval="1" name="active"/> + <field eval="13.0" name="duration"/> + <field name="project_id" ref="project.project_project_9"/> + <field name="name">Patches Error in Program</field> + <field name="stage_id" ref="project.project_tt_testing"/> + </record> + + <record id="crm_case_newfeaturestobeadded0" model="project.issue"> + <field eval="time.strftime('%Y-%m-01 12:15:10')" name="date"/> + <field name="priority">4</field> + <field name="user_id" ref="base.user_root"/> + <field name="partner_id" ref="base.res_partner_maxtor"/> + <field name="section_id" ref="crm.section_sales_department"/> + <field eval="1" name="active"/> + <field eval="3.2" name="duration"/> + <field name="project_id" ref="project.project_project_21"/> + <field name="name">New Features To Be Added</field> + <field name="stage_id" ref="project.project_tt_merge"/> + </record> + + <record id="crm_case_addmenustothemodule0" model="project.issue"> + <field eval="time.strftime('%Y-%m-05 18:00:00')" name="date"/> + <field name="priority">1</field> + <field name="user_id" ref="base.user_demo"/> + <field name="partner_id" ref="base.res_partner_9"/> + <field name="section_id" ref="crm.section_sales_department"/> + <field eval="1" name="active"/> + <field eval="3.0" name="duration"/> + <field name="project_id" ref="project.project_project_21"/> + <field name="name">Add menus to the module</field> + <field name="email_from">info@opensides.be</field> + <field name="stage_id" ref="project.project_tt_development"/> + </record> + + <record id="crm_case_includeattendancesheetinproject0" model="project.issue"> + <field eval="time.strftime('%Y-%m-10 17:05:30')" name="date"/> + <field name="priority">3</field> + <field name="user_id" ref="base.user_root"/> + <field name="partner_id" ref="base.res_partner_10"/> + <field name="section_id" ref="crm.section_sales_department"/> + <field eval="1" name="active"/> + <field eval="2.0" name="duration"/> + <field name="project_id" ref="project.project_project_9"/> + <field name="name">Include Attendance sheet in Project</field> + <field name="email_from">contact@tecsas.fr</field> + <field name="stage_id" ref="project.project_tt_development"/> + </record> + + <record id="crm_case_createnewobject0" model="project.issue"> + <field eval="time.strftime('%Y-%m-15 10:35:15')" name="date"/> + <field name="priority">3</field> + <field name="user_id" ref="base.user_root"/> + <field name="partner_id" ref="base.res_partner_6"/> + <field name="section_id" ref="crm.section_sales_department"/> + <field eval="1" name="active"/> + <field eval="2.45" name="duration"/> + <field name="project_id" ref="project.project_project_22"/> + <field name="name">Create new object</field> + <field name="stage_id" ref="project.project_tt_specification"/> + </record> + + <record id="crm_case_improvereportsinhrms0" model="project.issue"> + <field eval="time.strftime('%Y-%m-19 12:15:00')" name="date"/> + <field name="priority">4</field> + <field name="user_id" ref="base.user_root"/> + <field name="partner_id" ref="base.res_partner_11"/> + <field name="section_id" ref="crm.section_sales_department"/> + <field eval="1" name="active"/> + <field eval="15.0" name="duration"/> + <field name="project_id" ref="project.project_project_22"/> + <field name="name">Improve Reports in HRMS</field> + <field name="stage_id" ref="project.project_tt_development"/> + </record> + + <record id="crm_case_improvereportsinpms0" model="project.issue"> + <field eval="time.strftime('%Y-%m-21 14:30:00')" name="date"/> + <field name="priority">2</field> + <field name="user_id" ref="base.user_demo"/> + <field name="partner_id" ref="base.res_partner_11"/> + <field name="section_id" ref="crm.section_sales_department"/> + <field eval="1" name="active"/> + <field eval="06.15" name="duration"/> + <field name="project_id" ref="project.project_project_22"/> + <field name="name">Improve Reports in PMS</field> + <field name="stage_id" ref="project.project_tt_specification"/> + </record> + + <!-- Call function to set some issues as 'unread' --> + <function model="project.issue" name="message_mark_as_unread" + eval="[ ref('crm_case_improvereportsinhrms0'), ref('crm_case_createnewobject0')], {}"/> + + </data> </openerp> diff --git a/addons/project_issue/project_issue_view.xml b/addons/project_issue/project_issue_view.xml index e730805fb46..4cd5bb9ba6a 100644 --- a/addons/project_issue/project_issue_view.xml +++ b/addons/project_issue/project_issue_view.xml @@ -16,9 +16,9 @@ <record id="action_project_issue_unread" model="ir.values"> <field name="name">action_project_issue_unread</field> <field name="action_id" ref="actions_server_project_issue_unread"/> - <field name="value" eval="'ir.actions.server,' + str(ref('actions_server_project_issue_unread'))" /> + <field name="value" eval="'ir.actions.server,' + str(ref('actions_server_project_issue_unread'))"/> <field name="key">action</field> - <field name="model_id" ref="model_project_issue" /> + <field name="model_id" ref="model_project_issue"/> <field name="model">project.issue</field> <field name="key2">client_action_multi</field> </record> @@ -34,9 +34,9 @@ <record id="action_project_issue_read" model="ir.values"> <field name="name">action_project_issue_read</field> <field name="action_id" ref="actions_server_project_issue_read"/> - <field name="value" eval="'ir.actions.server,' + str(ref('actions_server_project_issue_read'))" /> + <field name="value" eval="'ir.actions.server,' + str(ref('actions_server_project_issue_read'))"/> <field name="key">action</field> - <field name="model_id" ref="model_project_issue" /> + <field name="model_id" ref="model_project_issue"/> <field name="model">project.issue</field> <field name="key2">client_action_multi</field> </record> @@ -133,15 +133,13 @@ <field name="task_id" on_change="onchange_task_id(task_id)" class="oe_inline"/> <field name="progress" widget="progressbar" attrs="{'invisible':[('task_id','=',False)]}" class="oe_inline"/> </div> + <field name="categ_ids" widget="many2many_tags"/> </group> </group> <notebook> <page string="Description"> <group> <group> - <field name="categ_id" widget="selection" domain="[('object_id.model', '=', 'project.issue')]"/> - </group> - <group> <field name="version_id" widget="selection"/> </group> </group> @@ -194,7 +192,7 @@ <field name="progress" widget="progressbar" attrs="{'invisible':[('task_id','=',False)]}"/> <field name="stage_id" widget="selection" readonly="1"/> <field name="state" groups="base.group_no_one"/> - <field name="categ_id" invisible="1"/> + <field name="categ_ids" invisible="1"/> <field name="task_id" invisible="1"/> </tree> </field> @@ -216,7 +214,7 @@ <separator orientation="vertical"/> <filter string="New" icon="terp-document-new" domain="[('state','=','draft')]" help="New Issues"/> <filter string="To Do" domain="[('state','=','open')]" help="To Do Issues" icon="terp-check"/> - <filter string="Unassigned Issues" domain="[('user_id','=',False)]" help="Unassigned Issues" icon="terp-personal-" /> + <filter string="Unassigned Issues" domain="[('user_id','=',False)]" help="Unassigned Issues" icon="terp-personal-"/> <separator orientation="vertical"/> <field name="user_id"/> <field name="project_id"/> @@ -236,7 +234,7 @@ domain="[]" context="{'group_by':'version_id'}"/> <separator orientation="vertical"/> <filter string="Category" icon="terp-stock_symbol-selection" domain="[]" - context="{'group_by':'categ_id'}"/> + context="{'group_by':'categ_ids'}"/> <filter string="Priority" icon="terp-rating-rated" domain="[]" context="{'group_by':'priority'}"/> <filter string="Stage" icon="terp-stage" domain="[]" @@ -265,79 +263,81 @@ </record> - <!-- Project Issue Karban View--> + <!-- Project Issue Karban View--> - <record model="ir.ui.view" id="project_issue_kanban_view"> - <field name="name">Project Issue Kanban</field> - <field name="model">project.issue</field> - <field name="type">kanban</field> - <field name="arch" type="xml"> - <kanban default_group_by="stage_id"> - <field name="color"/> - <field name="priority"/> - <field name="user_email"/> - <field name="user_id"/> - <field name="date_deadline"/> - <templates> - <t t-name="kanban-tooltip"> - <ul class="oe_kanban_tooltip"> - <li><b>Project:</b> <field name="project_id"/></li> - <li><b>Category:</b> <field name="categ_id"/></li> - </ul> - </t> - <t t-name="kanban-box"> - <div t-attf-class="oe_kanban_color_#{kanban_getcolor(record.color.raw_value)} oe_kanban_card oe_kanban_global_click"> - <div class="oe_dropdown_toggle oe_dropdown_kanban"> - <span class="oe_e">i</span> - <ul class="oe_dropdown_menu"> - <li><a type="edit" >Edit...</a></li> - <li><a type="delete">Delete</a></li> - <li><ul class="oe_kanban_colorpicker" data-field="color"/></li> - </ul> - </div> - <div class="oe_kanban_content" tooltip="kanban-tooltip"> - <div> - <b><field name="name"/></b> <br/> - <field name="partner_id"/> <br/> - <field name="version_id"/> - </div> - <div class="oe_kanban_footer_left"> - <div class="oe_right"> - <span class="oe_kanban_highlight"> - <t t-set="priority" t-value="record.priority.raw_value || 5"/> - <a type="object" name="set_priority" args="['3']" t-if="priority gt 3" title="Normal Priority"> - <img src="/web/static/src/img/icons/star-off.png" width="16" height="16"/> - </a> - <a type="object" name="set_priority" args="['5']" t-if="priority lte 3" title="Normal Priority"> - <img t-attf-src="/web/static/src/img/icons/star-#{priority lte 3 ? 'on' : 'off'}.png" width="16" height="16"/> - </a> - <a type="object" name="set_priority" args="['2']" title="High Priority"> - <img t-attf-src="/web/static/src/img/icons/star-#{priority lte 2 ? 'on' : 'off'}.png" width="16" height="16"/> - </a> - <a type="object" name="set_priority" args="['1']" title="Highest Priority"> - <img t-attf-src="/web/static/src/img/icons/star-#{priority == 1 ? 'on' : 'off'}.png" width="16" height="16"/> - </a> - </span> - <t t-if="record.date_deadline.raw_value and record.date_deadline.raw_value lt (new Date())"> - <span t-attf-class="oe_kanban_status oe_kaban_status_red"> </span> - </t> - <img t-att-src="kanban_image('res.users', 'avatar', record.user_id.raw_value[0])" t-att-title="record.user_id.value" width="24" height="24" class="oe_kanban_avatar"/> + <record model="ir.ui.view" id="project_issue_kanban_view"> + <field name="name">Project Issue Kanban</field> + <field name="model">project.issue</field> + <field name="type">kanban</field> + <field name="arch" type="xml"> + <kanban default_group_by="stage_id"> + <field name="color"/> + <field name="priority"/> + <field name="user_email"/> + <field name="user_id"/> + <field name="date_deadline"/> + <templates> + <t t-name="kanban-tooltip"> + <ul class="oe_kanban_tooltip"> + <li><b>Project:</b> <field name="project_id"/></li> + <li><b>Category:</b> <field name="categ_ids"/></li> + </ul> + </t> + <t t-name="kanban-box"> + <div t-attf-class="oe_kanban_color_#{kanban_getcolor(record.color.raw_value)} oe_kanban_card oe_kanban_global_click"> + <div class="oe_dropdown_toggle oe_dropdown_kanban"> + <span class="oe_e">i</span> + <ul class="oe_dropdown_menu"> + <li><a type="edit" >Edit...</a></li> + <li><a type="delete">Delete</a></li> + <li><ul class="oe_kanban_colorpicker" data-field="color"/></li> + </ul> + </div> + <div class="oe_kanban_content" tooltip="kanban-tooltip"> + <div> + <b><field name="name"/></b> <br/> + <field name="partner_id"/> <br/> + <field name="version_id"/> + </div> + <div class="oe_kanban_footer_left"> + <div class="oe_left oe_tags"> + <t t-foreach="record.categ_ids.raw_value" t-as="categ_id"> + <span class="oe_tag" t-att-data-categ_id="categ_id"></span> + </t> + </div> + <div class="oe_right"> + <span class="oe_kanban_highlight"> + <t t-set="priority" t-value="record.priority.raw_value || 5"/> + <a type="object" name="set_priority" args="['3']" t-if="priority gt 3" title="Normal Priority"> + <img src="/web/static/src/img/icons/star-off.png" width="16" height="16"/> + </a> + <a type="object" name="set_priority" args="['5']" t-if="priority lte 3" title="Normal Priority"> + <img t-attf-src="/web/static/src/img/icons/star-#{priority lte 3 ? 'on' : 'off'}.png" width="16" height="16"/> + </a> + <a type="object" name="set_priority" args="['2']" title="High Priority"> + <img t-attf-src="/web/static/src/img/icons/star-#{priority lte 2 ? 'on' : 'off'}.png" width="16" height="16"/> + </a> + <a type="object" name="set_priority" args="['1']" title="Highest Priority"> + <img t-attf-src="/web/static/src/img/icons/star-#{priority == 1 ? 'on' : 'off'}.png" width="16" height="16"/> + </a> + </span> + <t t-if="record.date_deadline.raw_value and record.date_deadline.raw_value lt (new Date())"> + <span t-attf-class="oe_kanban_status oe_kaban_status_red"> </span> + </t> + <img t-att-src="kanban_image('res.users', 'avatar', record.user_id.raw_value[0])" t-att-title="record.user_id.value" width="24" height="24" class="oe_kanban_avatar"/> + </div> </div> </div> + <div class="oe_clear"></div> </div> - <div class="oe_clear"></div> - </div> - </t> - </templates> - </kanban> - </field> - </record> - + </t> + </templates> + </kanban> + </field> + </record> - # ------------------------------------------------------ - # Feature Requests - # ------------------------------------------------------ + <!-- Feature Requests --> <record model="ir.ui.view" id="project_feature_tree_view"> <field name="name">Project Issue- Feature Tracker Tree</field> <field name="model">project.issue</field> @@ -378,7 +378,7 @@ </search> </field> </record> - + <act_window id="act_project_project_2_project_issue_all" name="Issues" src_model="project.project" @@ -387,10 +387,7 @@ view_mode="kanban,tree,form,calendar,graph" context="{'search_default_project_id': [active_id], 'default_project_id': active_id}"/> - # ------------------------------------------------------ - # Project - # ------------------------------------------------------ - + <!-- Project --> <record id="view_project_form_inherited" model="ir.ui.view"> <field name="name">project.project.form.inherited</field> <field name="model">project.project</field> @@ -409,7 +406,7 @@ </field> </field> </record> - + <record id="view_project_kanban_inherited" model="ir.ui.view"> <field name="name">project.project.kanban.inherited</field> <field name="model">project.project</field> @@ -427,7 +424,8 @@ </xpath> </field> </record> - <record id="analytic_account_inherited_issue_form" model="ir.ui.view"> + + <record id="analytic_account_inherited_issue_form" model="ir.ui.view"> <field name="name">account.analytic.account.issue.form.inherit</field> <field name="model">account.analytic.account</field> <field name="type">form</field> @@ -438,9 +436,10 @@ <separator colspan="4" string="Project Management" name="project_sep"/> <!-- removal of invisible attribute --> </xpath> <xpath expr='//separator[@name="project_sep"]' position='after'> - <field name="use_issues" /> + <field name="use_issues"/> </xpath> </field> </record> + </data> </openerp> diff --git a/addons/project_issue/report/project_issue_report.py b/addons/project_issue/report/project_issue_report.py index 5957ee284e8..b43cbc51c50 100644 --- a/addons/project_issue/report/project_issue_report.py +++ b/addons/project_issue/report/project_issue_report.py @@ -50,7 +50,6 @@ class project_issue_report(osv.osv): 'opening_date': fields.date('Date of Opening', readonly=True), 'creation_date': fields.date('Creation Date', readonly=True), 'date_closed': fields.date('Date of Closing', readonly=True), - 'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('section_id','=',section_id),('object_id.model', '=', 'project.issue')]"), 'stage_id': fields.many2one('project.task.type', 'Stage'), 'nbr': fields.integer('# of Issues', readonly=True), 'working_hours_open': fields.float('Avg. Working Hours to Open', readonly=True), @@ -86,7 +85,6 @@ class project_issue_report(osv.osv): c.working_hours_open, c.working_hours_close, c.section_id, - c.categ_id, c.stage_id, to_char(c.date_closed, 'YYYY-mm-dd') as date_closed, c.company_id as company_id, @@ -104,7 +102,7 @@ class project_issue_report(osv.osv): FROM project_issue c - WHERE c.active= 'true' and c.categ_id IN (select id from crm_case_categ where object_id in (select id from ir_model where model = 'project.issue')) + WHERE c.active= 'true' )""") project_issue_report() diff --git a/addons/project_issue/report/project_issue_report_view.xml b/addons/project_issue/report/project_issue_report_view.xml index 862f52b1931..d01acd6f558 100644 --- a/addons/project_issue/report/project_issue_report_view.xml +++ b/addons/project_issue/report/project_issue_report_view.xml @@ -17,19 +17,18 @@ <field name="company_id" invisible="1" groups="base.group_multi_company"/> <field name="section_id" invisible="1"/> <field name="user_id" invisible="1"/> - <field name="categ_id" invisible="1"/> <field name="channel_id" invisible="1"/> <field name="partner_id" invisible="1"/> - <field name="task_id" invisible="1"/> + <field name="task_id" invisible="1"/> <field name="date_closed" invisible="1"/> <field name="state" invisible="1"/> <field name="day" invisible="1"/> - <field name="nbr" string="#Project Issues" sum='#Number of Project Issues'/> - <field name="delay_open" avg='Avg Opening Delay'/> - <field name="delay_close" avg='Avg Closing Delay'/> - <field name="working_hours_open" avg='Open Working Hours'/> - <field name="working_hours_close" avg='Close Working hours'/> - <field name="email" sum='# Emails'/> + <field name="nbr" string="#Project Issues" sum="#Number of Project Issues"/> + <field name="delay_open" avg="Avg Opening Delay"/> + <field name="delay_close" avg="Avg Closing Delay"/> + <field name="working_hours_open" avg="Open Working Hours"/> + <field name="working_hours_close" avg="Close Working hours"/> + <field name="email" sum="# Emails"/> </tree> </field> </record> diff --git a/addons/project_issue/static/src/js/project_issue.js b/addons/project_issue/static/src/js/project_issue.js new file mode 100644 index 00000000000..24e5ff7cc49 --- /dev/null +++ b/addons/project_issue/static/src/js/project_issue.js @@ -0,0 +1,13 @@ +openerp.portal_project_issue = function(openerp) { + openerp.web_kanban.KanbanView.include({ + on_groups_started: function() { + var self = this; + self._super.apply(this, arguments); + + if (self.dataset.model === 'project.issue') { + // Load project's categories names from m2m field + self.project_display_categ_names(); + } + } + }); +}; |
