[IMP] add the subtypes in project tasks
bzr revid: rma@tinyerp.com-20121120071715-ap0xs1aw8sfx66q6
This commit is contained in:
parent
8b9ceee890
commit
fd598ba6ff
|
@ -1109,11 +1109,13 @@ class task(base_stage, osv.osv):
|
|||
|
||||
def set_kanban_state_normal(self, cr, uid, ids, context=None):
|
||||
self.write(cr, uid, ids, {'kanban_state': 'normal'}, context=context)
|
||||
return False
|
||||
self.case_block_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
|
||||
self.case_open_send_note(cr, uid, ids, context=context)
|
||||
return True
|
||||
|
||||
def _store_history(self, cr, uid, ids, context=None):
|
||||
for task in self.browse(cr, uid, ids, context=context):
|
||||
|
@ -1295,8 +1297,17 @@ class task(base_stage, osv.osv):
|
|||
context=context)
|
||||
|
||||
def create_send_note(self, cr, uid, ids, context=None):
|
||||
return self.message_post(cr, uid, ids, body=_("Task has been <b>created</b>."), context=context)
|
||||
return self.message_post(cr, uid, ids, body=_("Task has been <b>created</b>."), subtype="project.mt_task_new", context=context)
|
||||
|
||||
def case_open_send_note(self, cr, uid, ids, context=None):
|
||||
return self.message_post(cr, uid, ids, body=_("Task has been <b>started</b>."), subtype="project.mt_task_started", context=context)
|
||||
|
||||
def case_close_send_note(self, cr, uid, ids, context=None):
|
||||
return self.message_post(cr, uid, ids, body=_("Task has been <b>done</b>."), subtype="project.mt_task_closed", context=context)
|
||||
|
||||
def case_block_send_note(self, cr, uid, ids, context=None):
|
||||
return self.message_post(cr, uid, ids, body=_("Task has been <b>blocked</b>."), subtype="project.mt_task_blocked", context=context)
|
||||
|
||||
def case_draft_send_note(self, cr, uid, ids, context=None):
|
||||
return self.message_post(cr, uid, ids, body=_('Task has been set as <b>draft</b>.'), context=context)
|
||||
|
||||
|
|
|
@ -104,20 +104,32 @@
|
|||
</record>
|
||||
|
||||
<record id="mt_task_new" model="mail.message.subtype">
|
||||
<field name="name">New</field>
|
||||
<field name="name">Task created</field>
|
||||
<field name="res_model">project.task</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mt_task_closed" model="mail.message.subtype">
|
||||
<field name="name">Closed</field>
|
||||
<field name="name">Done</field>
|
||||
<field name="res_model">project.task</field>
|
||||
</record>
|
||||
<record id="mt_task_started" model="mail.message.subtype">
|
||||
<field name="name">Task Started</field>
|
||||
<field name="res_model">project.task</field>
|
||||
</record>
|
||||
<record id="mt_task_blocked" model="mail.message.subtype">
|
||||
<field name="name">Tasks Blocked</field>
|
||||
<field name="res_model">project.task</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mt_task_canceled" model="mail.message.subtype">
|
||||
<field name="name">Canceled</field>
|
||||
<field name="res_model">project.task</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mt_task_change" model="mail.message.subtype">
|
||||
<field name="name">Stage Changed</field>
|
||||
<field name="res_model">project.task</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
|
||||
<!-- notify all employees of module installation -->
|
||||
|
|
Loading…
Reference in New Issue