[IMP] mail: improve activity done message template
Feedback should be the first part of the message without title to make it more concise. If the activity has a note, the note should be displayed but after the feedback. We can also remove the field feedback that was not so useful since it was only written just before unlink. Feedback is now passed as another parameter to the template. Task: 1918392 closes odoo/odoo#29605
This commit is contained in:
@@ -313,15 +313,15 @@
|
||||
<template id="message_activity_done">
|
||||
<div>
|
||||
<p>
|
||||
<strong><span t-attf-class="fa #{activity.activity_type_id.icon}"/></strong> <span t-field="activity.activity_type_id.name"/> done
|
||||
by <span t-field="activity.user_id.name"/><span t-if="activity.summary">:</span>
|
||||
<span t-if="activity.summary" t-field="activity.summary"/>
|
||||
<span t-attf-class="fa #{activity.activity_type_id.icon} fa-fw"/><span t-field="activity.activity_type_id.name"/> done
|
||||
<t t-if="display_assignee"> (originally assigned to <span t-field="activity.user_id.name"/>)</t>
|
||||
<span t-if="activity.summary">: </span><span t-if="activity.summary" t-field="activity.summary"/>
|
||||
</p>
|
||||
<div t-field="activity.note" style="margin-left: 8px;"/>
|
||||
<div t-if="activity.feedback" style="margin-top: 8px;">
|
||||
<strong> Feedback</strong>
|
||||
<div t-field="activity.feedback" style="margin-left: 8px;"></div>
|
||||
</div>
|
||||
<div t-if="feedback" t-esc="feedback"/>
|
||||
<t t-if="activity.note != '<p><br></p>'"><!-- <p></br></p> -->
|
||||
<div class="o_mail_note_title"><strong>Original note:</strong></div>
|
||||
<div t-field="activity.note"/>
|
||||
</t>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -126,7 +126,6 @@ class MailActivity(models.Model):
|
||||
icon = fields.Char('Icon', related='activity_type_id.icon', readonly=False)
|
||||
summary = fields.Char('Summary')
|
||||
note = fields.Html('Note')
|
||||
feedback = fields.Html('Feedback')
|
||||
date_deadline = fields.Date('Due Date', index=True, required=True, default=fields.Date.context_today)
|
||||
automated = fields.Boolean(
|
||||
'Automated activity', readonly=True,
|
||||
@@ -376,13 +375,15 @@ class MailActivity(models.Model):
|
||||
|
||||
def action_feedback(self, feedback=False):
|
||||
message = self.env['mail.message']
|
||||
if feedback:
|
||||
self.write(dict(feedback=feedback))
|
||||
for activity in self:
|
||||
record = self.env[activity.res_model].browse(activity.res_id)
|
||||
record.message_post_with_view(
|
||||
'mail.message_activity_done',
|
||||
values={'activity': activity},
|
||||
values={
|
||||
'activity': activity,
|
||||
'feedback': feedback,
|
||||
'display_assignee': activity.user_id != self.env.user
|
||||
},
|
||||
subtype_id=self.env['ir.model.data'].xmlid_to_res_id('mail.mt_activities'),
|
||||
mail_activity_type_id=activity.activity_type_id.id,
|
||||
)
|
||||
|
||||
@@ -137,7 +137,9 @@
|
||||
text-align: justify;
|
||||
}
|
||||
|
||||
|
||||
.o_mail_note_title {
|
||||
margin-top: 9px;
|
||||
}
|
||||
|
||||
.o_mail_subject {
|
||||
font-style: italic;
|
||||
|
||||
Reference in New Issue
Block a user