[IMP] add issue blocked subtype
bzr revid: fka@tinyerp.com-20121204073244-2m629bmhs394rpwb
This commit is contained in:
@@ -233,6 +233,12 @@ class project_issue(base_stage, osv.osv):
|
||||
When the case is over, the status is set to \'Done\'.\
|
||||
If the case needs to be reviewed then the status is \
|
||||
set to \'Pending\'.'),
|
||||
'kanban_state': fields.selection([('normal', 'Normal'),('blocked', 'Blocked'),('done', 'Ready for next stage')], 'Kanban State',
|
||||
help="A task's kanban state indicates special situations affecting it:\n"
|
||||
" * Normal is the default situation\n"
|
||||
" * Blocked indicates something is preventing the progress of this task\n"
|
||||
" * Ready for next stage indicates the task is ready to be pulled to the next stage",
|
||||
readonly=True, required=False),
|
||||
'email_from': fields.char('Email', size=128, help="These people will receive email.", select=1),
|
||||
'email_cc': fields.char('Watchers Emails', size=256, help="These email addresses will be added to the CC field of all inbound and outbound emails for this record before being sent. Separate multiple email addresses with a comma"),
|
||||
'date_open': fields.datetime('Opened', readonly=True,select=True),
|
||||
@@ -279,6 +285,7 @@ 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],
|
||||
'kanban_state': 'normal',
|
||||
}
|
||||
|
||||
_group_by_full = {
|
||||
@@ -551,7 +558,7 @@ class project_issue(base_stage, osv.osv):
|
||||
return self.message_post(cr, uid, ids, body=message, subtype="project_issue.mt_issue_new", context=context)
|
||||
|
||||
def case_open_send_note(self, cr, uid, ids, context=None):
|
||||
return self.message_post(cr, uid, ids, body=_("Task <b>started</b>."), subtype="project_issue.mt_issue_started", context=context)
|
||||
return self.message_post(cr, uid, ids, body=_("Issue <b>started</b>."), subtype="project_issue.mt_issue_started", context=context)
|
||||
|
||||
def case_escalate_send_note(self, cr, uid, ids, context=None):
|
||||
for obj in self.browse(cr, uid, ids, context=context):
|
||||
@@ -563,9 +570,25 @@ class project_issue(base_stage, osv.osv):
|
||||
obj.message_post(body=message)
|
||||
return True
|
||||
|
||||
def case_block_send_note(self, cr, uid, ids, context=None):
|
||||
return self.message_post(cr, uid, ids, body=_("Issue <b>blocked</b>."), subtype="project_issue.mt_issue_blocked", context=context)
|
||||
|
||||
def case_close_send_note(self, cr, uid, ids, context=None):
|
||||
return self.message_post(cr, uid, ids, body=_("Project issue <b>closed</b>."), subtype="project_issue.mt_issue_closed", context=context)
|
||||
|
||||
def set_kanban_state_blocked(self, cr, uid, ids, context=None):
|
||||
self.write(cr, uid, ids, {'kanban_state': 'blocked'}, context=context)
|
||||
self.case_block_send_note(cr, uid, ids, context=context)
|
||||
return True
|
||||
|
||||
def set_kanban_state_normal(self, cr, uid, ids, context=None):
|
||||
self.write(cr, uid, ids, {'kanban_state': 'normal'}, context=context)
|
||||
self.case_open_send_note(cr, uid, ids, context=context)
|
||||
return True
|
||||
|
||||
def set_kanban_state_done(self, cr, uid, ids, context=None):
|
||||
self.write(cr, uid, ids, {'kanban_state': 'done'}, context=context)
|
||||
return False
|
||||
project_issue()
|
||||
|
||||
class project(osv.osv):
|
||||
|
||||
@@ -54,6 +54,11 @@ Access all issues from the top Project menu, and access the issues of a specific
|
||||
<field name="res_model">project.issue</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mt_issue_blocked" model="mail.message.subtype">
|
||||
<field name="name">Issue Blocked</field>
|
||||
<field name="res_model">project.issue</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mt_issue_closed" model="mail.message.subtype">
|
||||
<field name="name">Issue Closed</field>
|
||||
<field name="res_model">project.issue</field>
|
||||
|
||||
@@ -240,6 +240,7 @@
|
||||
<field name="user_email"/>
|
||||
<field name="user_id"/>
|
||||
<field name="date_deadline"/>
|
||||
<field name="kanban_state"/>
|
||||
<templates>
|
||||
<t t-name="kanban-tooltip">
|
||||
<ul class="oe_kanban_tooltip">
|
||||
@@ -267,6 +268,9 @@
|
||||
<field name="categ_ids"/>
|
||||
<div class="oe_right">
|
||||
<span class="oe_kanban_highlight" groups="base.group_user">
|
||||
<a t-if="record.kanban_state.raw_value === 'normal'" type="object" string="In Progress" name="set_kanban_state_done" class="oe_kanban_status"> </a>
|
||||
<a t-if="record.kanban_state.raw_value === 'done'" type="object" string="Ready for next stage" name="set_kanban_state_blocked" class="oe_kanban_status oe_kanban_status_green"> </a>
|
||||
<a t-if="record.kanban_state.raw_value === 'blocked'" type="object" string="Blocked" name="set_kanban_state_normal" class="oe_kanban_status oe_kanban_status_red"> </a>
|
||||
<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"/>
|
||||
|
||||
Reference in New Issue
Block a user