diff options
| author | Amit Patel <apa@tinyerp.com> | 2012-09-12 11:13:36 +0530 |
|---|---|---|
| committer | Amit Patel <apa@tinyerp.com> | 2012-09-12 11:13:36 +0530 |
| commit | ec930cd97decfbe1cd138b638d081536bb9632e2 (patch) | |
| tree | 23bcb442d5ff6aaf16d80c28044a16eb8c4c794c /addons/project_issue | |
| parent | d52e25483482b464c37695abf8d24e94598f3516 (diff) | |
| parent | f1f23c52ea1601b7588a91497ba46e5b826719b7 (diff) | |
[MEREGE]:trunk
bzr revid: apa@tinyerp.com-20120912054336-9qq9zfewjh4f9432
Diffstat (limited to 'addons/project_issue')
| -rw-r--r-- | addons/project_issue/__openerp__.py | 4 | ||||
| -rw-r--r-- | addons/project_issue/board_project_issue_view.xml | 2 | ||||
| -rw-r--r-- | addons/project_issue/project_issue.py | 48 | ||||
| -rw-r--r-- | addons/project_issue/project_issue_data.xml | 18 | ||||
| -rw-r--r-- | addons/project_issue/project_issue_view.xml | 21 | ||||
| -rw-r--r-- | addons/project_issue/report/project_issue_report_view.xml | 1 |
6 files changed, 45 insertions, 49 deletions
diff --git a/addons/project_issue/__openerp__.py b/addons/project_issue/__openerp__.py index 07e453af885..3d005f3fad6 100644 --- a/addons/project_issue/__openerp__.py +++ b/addons/project_issue/__openerp__.py @@ -21,11 +21,11 @@ ############################################################################## { - 'name': 'Issues Tracker', + 'name': 'Issue Tracker', 'version': '1.0', 'category': 'Project Management', 'sequence': 22, - 'summary': 'Support, Bug Traker, Helpdesk', + 'summary': 'Support, Bug Tracker, Helpdesk', 'description': """ This module provides Issues/Bugs Management in Project. ======================================================= diff --git a/addons/project_issue/board_project_issue_view.xml b/addons/project_issue/board_project_issue_view.xml index 3b4fa57fc58..d7574042c37 100644 --- a/addons/project_issue/board_project_issue_view.xml +++ b/addons/project_issue/board_project_issue_view.xml @@ -16,7 +16,7 @@ <field name="version_id" widget="selection"/> <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="state" invisible="1"/> <field name="categ_ids" invisible="1"/> <field name="task_id" invisible="1"/> </tree> diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py index c2ff76d05a6..6121acbd607 100644 --- a/addons/project_issue/project_issue.py +++ b/addons/project_issue/project_issue.py @@ -46,8 +46,7 @@ class project_issue(base_stage, osv.osv): _name = "project.issue" _description = "Project Issue" _order = "priority, create_date desc" - _inherit = ['ir.needaction_mixin', 'mail.thread'] - _mail_compose_message = True + _inherit = ['mail.thread', 'ir.needaction_mixin'] def _get_default_project_id(self, cr, uid, context=None): """ Gives default project by checking if present in the context """ @@ -88,14 +87,18 @@ class project_issue(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), ('fold', '=', False)] - search_domain += ['|', ('id', 'in', ids), '&', ('case_default', '=', True), ('fold', '=', False)] + search_domain += ['|', ('project_ids', '=', project_id)] + search_domain += ['|', ('id', 'in', ids), ('case_default', '=', True)] # perform search 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 result.sort(lambda x,y: cmp(stage_ids.index(x[0]), stage_ids.index(y[0]))) - return result + + fold = {} + for stage in stage_obj.browse(cr, access_rights_uid, stage_ids, context=context): + fold[stage.id] = stage.fold or False + return result, fold def _compute_day(self, cr, uid, ids, fields, args, context=None): """ @@ -240,7 +243,7 @@ class project_issue(base_stage, osv.osv): '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', - domain="['|', ('project_ids', '=', project_id), ('case_default', '=', True)]"), + domain="['&', ('fold', '=', False), '|', ('project_ids', '=', project_id), ('case_default', '=', True)]"), 'project_id':fields.many2one('project.project', 'Project'), 'duration': fields.float('Duration'), 'task_id': fields.many2one('project.task', 'Task', domain="[('project_id','=',project_id)]"), @@ -364,7 +367,6 @@ class project_issue(base_stage, osv.osv): return super(project_issue, self).write(cr, uid, ids, vals, context) def onchange_task_id(self, cr, uid, ids, task_id, context=None): - result = {} if not task_id: return {'value':{}} task = self.pool.get('project.task').browse(cr, uid, task_id, context=context) @@ -454,14 +456,13 @@ class project_issue(base_stage, osv.osv): custom_values.update({ 'name': msg.get('subject') or _("No Subject"), - 'description': msg.get('body_text'), + 'description': msg.get('body'), 'email_from': msg.get('from'), 'email_cc': msg.get('cc'), 'user_id': False, }) if msg.get('priority'): custom_values['priority'] = msg.get('priority') - 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) @@ -477,16 +478,16 @@ class project_issue(base_stage, osv.osv): if update_vals is None: update_vals = {} # Update doc values according to the message - update_vals['description'] = msg.get('body_text', '') + update_vals['description'] = msg.get('body', '') if msg.get('priority'): update_vals['priority'] = msg.get('priority') - # Parse 'body_text' to find values to update + # Parse 'body' to find values to update maps = { 'cost': 'planned_cost', 'revenue': 'planned_revenue', 'probability': 'probability', } - for line in msg.get('body_text', '').split('\n'): + for line in msg.get('body', '').split('\n'): line = line.strip() res = tools.misc.command_re.match(line) if res and maps.get(res.group(1).lower(), False): @@ -499,36 +500,31 @@ class project_issue(base_stage, osv.osv): # OpenChatter methods and notifications # ------------------------------------------------------- - def message_get_monitored_follower_fields(self, cr, uid, ids, context=None): - """ Add 'user_id' to the monitored fields """ - res = super(project_issue, self).message_get_monitored_follower_fields(cr, uid, ids, context=context) - return res + ['user_id'] - def stage_set_send_note(self, cr, uid, ids, stage_id, context=None): """ Override of the (void) default notification method. """ stage_name = self.pool.get('project.task.type').name_get(cr, uid, [stage_id], context=context)[0][1] - return self.message_append_note(cr, uid, ids, body= _("Stage changed to <b>%s</b>.") % (stage_name), context=context) + return self.message_post(cr, uid, ids, body= _("Stage changed to <b>%s</b>.") % (stage_name), context=context) def case_get_note_msg_prefix(self, cr, uid, id, context=None): """ Override of default prefix for notifications. """ return 'Project issue' def convert_to_task_send_note(self, cr, uid, ids, context=None): - message = _("Project issue has been <b>converted</b> into task.") - return self.message_append_note(cr, uid, ids, body=message, context=context) + message = _("Project issue <b>converted</b> to task.") + return self.message_post(cr, uid, ids, body=message, context=context) def create_send_note(self, cr, uid, ids, context=None): - message = _("Project issue has been <b>created</b>.") - return self.message_append_note(cr, uid, ids, body=message, context=context) + message = _("Project issue <b>created</b>.") + return self.message_post(cr, uid, ids, body=message, context=context) def case_escalate_send_note(self, cr, uid, ids, context=None): for obj in self.browse(cr, uid, ids, context=context): if obj.project_id: - message = _("has been <b>escalated</b> to <em>'%s'</em>.") % (obj.project_id.name) - obj.message_append_note(body=message, context=context) + message = _("<b>escalated</b> to <em>'%s'</em>.") % (obj.project_id.name) + obj.message_post(body=message) else: - message = _("has been <b>escalated</b>.") - obj.message_append_note(body=message, context=context) + message = _("<b>escalated</b>.") + obj.message_post(body=message) return True project_issue() diff --git a/addons/project_issue/project_issue_data.xml b/addons/project_issue/project_issue_data.xml index a191cb4454f..ddb0d575e63 100644 --- a/addons/project_issue/project_issue_data.xml +++ b/addons/project_issue/project_issue_data.xml @@ -32,13 +32,15 @@ </record> <!-- notify all employees of module installation --> - <function model="mail.group" name="message_append_note"> - <!-- ids, subject, body, parent_id=False, type='notification', content_subtype='html' --> - <value eval="[ref('mail.group_all_employees')]"/> - <value>Module Issues Tracker has been installed.</value> - <value>Manage the issues you might face in a project, like bugs in a system, client complaints or material breakdowns. You can record issues, assign them to some responsible person, and keep track of their status as they evolve over time. - -You can access issues from the top menu Project, and access the issues of a specific project from the projects gallery view.</value> - </function> + <record model="mail.message" id="module_install_notification"> + <field name="model">mail.group</field> + <field name="res_id" ref="mail.group_all_employees"/> + <field name="type">notification</field> + <field name="subject">Issue Tracker application installed!</field> + <field name="body">Manage the issues you might face in a project, such as bugs in a system, client complaints or material breakdowns. +You can record issues, assign them to a responsible person, and keep track of their status as they evolve over time. +Access all issues from the top Project menu, and access the issues of a specific project via the projects gallery view.</field> + </record> + </data> </openerp> diff --git a/addons/project_issue/project_issue_view.xml b/addons/project_issue/project_issue_view.xml index 75bf50b23a4..fea22c519a8 100644 --- a/addons/project_issue/project_issue_view.xml +++ b/addons/project_issue/project_issue_view.xml @@ -151,7 +151,7 @@ <field name="id"/> <field name="active"/> </group> - <group colspan="4" col="4"> + <group colspan="4" col="4" invisible="1"> <separator string="Status" colspan="4"/> <field name="state" groups="base.group_no_one" string="Status"/> </group> @@ -170,8 +170,8 @@ <field name="name">Project Issue Tracker Tree</field> <field name="model">project.issue</field> <field name="arch" type="xml"> - <tree string="Issue Tracker Tree" fonts="bold:needaction_pending==True" colors="black:state=='open';blue:state=='pending';grey:state in ('cancel', 'done')"> - <field name="needaction_pending" invisible="1"/> + <tree string="Issue Tracker Tree" fonts="bold:message_unread==True" colors="black:state=='open';blue:state=='pending';grey:state in ('cancel', 'done')"> + <field name="message_unread" invisible="1"/> <field name="id"/> <field name="create_date" groups="base.group_no_one"/> <field name="name"/> @@ -182,7 +182,7 @@ <field name="user_id"/> <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="state" invisible="1"/> <field name="categ_ids" invisible="1"/> <field name="task_id" invisible="1"/> </tree> @@ -196,7 +196,7 @@ <search string="Issue Tracker Search"> <field name="name" string="Issue" filter_domain="['|', '|',('partner_id','ilike',self),('email_from','ilike',self),('name','ilike',self)]"/> <field name="id"/> - <filter icon="terp-mail-message-new" string="Inbox" help="Unread messages" name="needaction_pending" domain="[('needaction_pending','=',True)]"/> + <filter icon="terp-mail-message-new" string="Inbox" help="Unread messages" name="message_unread" domain="[('message_unread','=',True)]"/> <separator/> <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"/> @@ -212,7 +212,6 @@ <filter string="Category" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'categ_id'}"/> <filter string="Priority" icon="terp-rating-rated" domain="[]" context="{'group_by':'priority'}"/> <filter string="Stage" icon="terp-stage" domain="[]" context="{'group_by':'stage_id'}"/> - <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/> <filter string="Month" icon="terp-go-month" domain="[]" context="{'group_by':'create_date'}" help="Creation Month"/> </group> </search> @@ -253,12 +252,12 @@ </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 t-attf-class="oe_kanban_color_#{kanban_getcolor(record.color.raw_value)} oe_kanban_card oe_kanban_global_click oe_semantic_html_override"> <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> + <t t-if="widget.view.is_action_enabled('edit')"><li><a type="edit">Edit...</a></li></t> + <t t-if="widget.view.is_action_enabled('delete')"><li><a type="delete">Delete</a></li></t> <li><ul class="oe_kanban_colorpicker" data-field="color"/></li> </ul> </div> @@ -311,9 +310,9 @@ <field name="name">Project Issue- Feature Tracker Tree</field> <field name="model">project.issue</field> <field name="arch" type="xml"> - <tree string="Feature Tracker Tree" fonts="bold:needaction_pending==True" colors="red:state=='open';black:state in ('draft', 'cancel','done','pending')"> + <tree string="Feature Tracker Tree" fonts="bold:message_unread==True" colors="red:state=='open';black:state in ('draft', 'cancel','done','pending')"> <field name="id"/> - <field name="needaction_pending" invisible="1"/> + <field name="message_unread" invisible="1"/> <field name="name" string="Feature description"/> <field name="partner_id"/> <field name="priority" string="Priority"/> diff --git a/addons/project_issue/report/project_issue_report_view.xml b/addons/project_issue/report/project_issue_report_view.xml index 625e6e64374..f90f349ea3b 100644 --- a/addons/project_issue/report/project_issue_report_view.xml +++ b/addons/project_issue/report/project_issue_report_view.xml @@ -67,7 +67,6 @@ <filter string="Version" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'version_id'}"/> <filter string="Priority" icon="terp-rating-rated" domain="[]" context="{'group_by':'priority'}" /> <filter string="Stage" icon="terp-stage" domain="[]" context="{'group_by':'stage_id'}"/> - <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}" /> <filter string="Company" icon="terp-go-home" domain="[]" context="{'group_by':'company_id'}" groups="base.group_multi_company"/> <filter string="Day" icon="terp-go-today" domain="[]" context="{'group_by':'day'}" help="Creation Date"/> <filter string="Month" icon="terp-go-month" domain="[]" context="{'group_by':'month'}" help="Creation Date"/> |
