[IMP] [REVIEW] project: cleaned subtypes, added comments in data files. Updated messages body to have shorter sentences.
bzr revid: tde@openerp.com-20121203113906-g0nhtn9j22d3lf0b
This commit is contained in:
parent
c3a3492848
commit
300e802490
|
@ -1283,30 +1283,32 @@ class task(base_stage, osv.osv):
|
|||
return res + ['user_id', 'manager_id']
|
||||
|
||||
def create_send_note(self, cr, uid, ids, context=None):
|
||||
return self.message_post(cr, uid, ids, body=_("Task has been <b>created</b>."), subtype="project.mt_task_new", context=context)
|
||||
return self.message_post(cr, uid, ids, body=_("Task <b>created</b>."), subtype="project.mt_task_new", context=context)
|
||||
|
||||
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_post(cr, uid, ids, body=_("Stage changed to <b>%s</b>.") % (stage_name),
|
||||
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)
|
||||
return self.message_post(cr, uid, ids, body=_("Task <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)
|
||||
return self.message_post(cr, uid, ids, body=_("Task <b>closed</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)
|
||||
|
||||
return self.message_post(cr, uid, ids, body=_("Task <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)
|
||||
return self.message_post(cr, uid, ids, body=_('Task set as <b>draft</b>.'), context=context)
|
||||
|
||||
def do_delegation_send_note(self, cr, uid, ids, context=None):
|
||||
for task in self.browse(cr, uid, ids, context=context):
|
||||
msg = _('Task has been <b>delegated</b> to <em>%s</em>.') % (task.user_id.name)
|
||||
self.message_post(cr, uid, [task.id], body=msg, context=context)
|
||||
return True
|
||||
|
||||
|
||||
def project_task_reevaluate(self, cr, uid, ids, context=None):
|
||||
if self.pool.get('res.users').has_group(cr, uid, 'project.group_time_work_estimation_tasks'):
|
||||
return {
|
||||
|
|
|
@ -78,21 +78,26 @@
|
|||
<field name="fold" eval="True"/>
|
||||
</record>
|
||||
|
||||
<!-- mail: subtypes -->
|
||||
<record id="mt_project_new" model="mail.message.subtype">
|
||||
<!-- Project-related subtypes for messaging / Chatter -->
|
||||
<record id="mt_project_task_new" model="mail.message.subtype">
|
||||
<field name="name">Task Created</field>
|
||||
<field name="res_model">project.project</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mt_project_started" model="mail.message.subtype">
|
||||
<record id="mt_project_task_started" model="mail.message.subtype">
|
||||
<field name="name">Task Started</field>
|
||||
<field name="res_model">project.project</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mt_project_closed" model="mail.message.subtype">
|
||||
<record id="mt_project_task_blocked" model="mail.message.subtype">
|
||||
<field name="name">Task Blocked</field>
|
||||
<field name="res_model">project.project</field>
|
||||
</record>
|
||||
<record id="mt_project_task_closed" model="mail.message.subtype">
|
||||
<field name="name">Task Done</field>
|
||||
<field name="res_model">project.project</field>
|
||||
</record>
|
||||
|
||||
<!-- Task-related subtypes for messaging / Chatter -->
|
||||
<record id="mt_task_new" model="mail.message.subtype">
|
||||
<field name="name">Task Created</field>
|
||||
<field name="res_model">project.task</field>
|
||||
|
@ -101,11 +106,11 @@
|
|||
<record id="mt_task_started" model="mail.message.subtype">
|
||||
<field name="name">Task Started</field>
|
||||
<field name="res_model">project.task</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mt_task_blocked" model="mail.message.subtype">
|
||||
<field name="name">Task Blocked</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">Task Done</field>
|
||||
|
|
|
@ -532,11 +532,12 @@ class project_issue(base_stage, osv.osv):
|
|||
# -------------------------------------------------------
|
||||
# OpenChatter methods and notifications
|
||||
# -------------------------------------------------------
|
||||
|
||||
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_post(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'
|
||||
|
@ -544,10 +545,13 @@ class project_issue(base_stage, osv.osv):
|
|||
def convert_to_task_send_note(self, cr, uid, ids, context=None):
|
||||
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 <b>created</b>.")
|
||||
return self.message_post(cr, uid, ids, body=message, subtype="mt_issue_new", context=context)
|
||||
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)
|
||||
|
||||
def case_escalate_send_note(self, cr, uid, ids, context=None):
|
||||
for obj in self.browse(cr, uid, ids, context=context):
|
||||
|
@ -560,7 +564,7 @@ class project_issue(base_stage, osv.osv):
|
|||
return True
|
||||
|
||||
def case_close_send_note(self, cr, uid, ids, context=None):
|
||||
return self.message_post(cr, uid, ids, body=_("Project issue has been <b>done</b>."), subtype="mail.mt_issue_closed", context=context)
|
||||
return self.message_post(cr, uid, ids, body=_("Project issue <b>closed</b>."), subtype="project_issue.mt_issue_closed", context=context)
|
||||
|
||||
project_issue()
|
||||
|
||||
|
|
|
@ -43,29 +43,33 @@ You can record issues, assign them to a responsible person, and keep track of th
|
|||
Access all issues from the top Project menu, and access the issues of a specific project via the projects gallery view.</p>]]></field>
|
||||
</record>
|
||||
|
||||
<!-- Mail subtypes -->
|
||||
<record id="mail.mt_issue_new" model="mail.message.subtype">
|
||||
<!-- Issue-related subtypes for messaging / Chatter -->
|
||||
<record id="mt_issue_new" model="mail.message.subtype">
|
||||
<field name="name">Issue Created</field>
|
||||
<field name="res_model">project.issue</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mt_issue_change" model="mail.message.subtype">
|
||||
<record id="mt_issue_started" model="mail.message.subtype">
|
||||
<field name="name">Issue Started</field>
|
||||
<field name="res_model">project.issue</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mt_issue_closed" model="mail.message.subtype">
|
||||
<record id="mt_issue_closed" model="mail.message.subtype">
|
||||
<field name="name">Issue Closed</field>
|
||||
<field name="res_model">project.issue</field>
|
||||
</record>
|
||||
|
||||
<record id="mail.mt_prj_issue_new" model="mail.message.subtype">
|
||||
<!-- Project-related subtypes for messaging / Chatter -->
|
||||
<record id="mt_project_issue_new" model="mail.message.subtype">
|
||||
<field name="name">Issue Created</field>
|
||||
<field name="res_model">project.project</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mt_prj_issue_started" model="mail.message.subtype">
|
||||
<record id="mt_project_issue_started" model="mail.message.subtype">
|
||||
<field name="name">Issue Started</field>
|
||||
<field name="res_model">project.project</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mt_prj_issue_closed" model="mail.message.subtype">
|
||||
<record id="mt_project_issue_closed" model="mail.message.subtype">
|
||||
<field name="name">Issue Closed</field>
|
||||
<field name="res_model">project.project</field>
|
||||
</record>
|
||||
|
|
Loading…
Reference in New Issue