[FIX] mail: display access button on discussion emails if recipient can see the document

Currently no access button is displayed if the email is a discussion and has
no contextual actions like creating a new document, or setting the responsible
of the document. However it leads to emails being sent without access button.
This can be extremely frustrating and make the notification email quite
impossible to use efficiently.

With this commit when an user has access to a document the link to the document
is always displayed in the notification email.
This commit is contained in:
Thibault Delavallée
2016-07-19 16:35:05 +02:00
parent bcbf4316e6
commit c70e2a5777
+2 -2
View File
@@ -69,7 +69,7 @@
<meta itemprop="name" content="View ${ctx['model_name']}"/>
</div>
</div>
% if not ctx['is_discussion'] or not len(ctx['actions']) == 0 or ctx.get('is_accessible'):
% if not ctx['is_discussion'] or not len(ctx['actions']) == 0 or ctx.get('button_access') or ctx.get('is_accessible'):
<div summary="o_mail_notification" style="padding:0px; width:600px; margin:0 auto; background: #FFFFFF repeat top /100%;color:#777777">
<table cellspacing="0" cellpadding="0" style="width:600px; border-collapse:collapse; background:inherit; color:inherit">
<tbody><tr>
@@ -155,7 +155,7 @@
</tbody>
</table>
</div>
% if not ctx['is_discussion'] or not len(ctx['actions']) == 0:
% if not ctx['is_discussion'] or not len(ctx['actions']) == 0 or ctx.get('button_access'):
<div style="padding:0px; width:600px; max-width:600px; margin:0 auto; background: #FFFFFF repeat top /100%;color:#777777">
% else:
<div style="padding:0px; width:600px; max-width:600px; margin:0 auto; background: #FFFFFF repeat top /100%;>