[IMP] mail: give access link to document in "light" notification layout

Light template is used is several notification processes as an alternate
layout to the classic one. It currently lacks any link to the document that
generated the notifications.

We add this behavior in this commit. Behavior is the same as the classic
notification email, aka a link to mail/view that chooses what to do based
on access rights and user status (internal, portal, ...).

Task-2621326 (Mail: add 'view' button in 'light notification template')

Part-of: odoo/odoo#76418
This commit is contained in:
Thibault Delavallée
2021-11-10 09:58:09 +00:00
parent f9dbd38720
commit 4059bbabac
@@ -74,10 +74,20 @@
<td align="center" style="min-width: 590px;">
<table border="0" cellpadding="0" cellspacing="0" width="100%" style="background-color: white; padding: 0; border-collapse:separate;">
<tr><td valign="middle">
<span style="font-size: 10px;">Your <t t-esc="model_description or 'document'"/></span><br/>
<span style="font-size: 20px; font-weight: bold;">
<t t-esc="message.record_name and message.record_name.replace('/','-') or ''"/>
</span>
<span style="font-size: 10px;">Your <t t-esc="model_description or 'document'"/></span>
<br/>
<t t-if="has_button_access">
<a t-att-href="button_access['url']">
<span style="font-size: 20px; font-weight: bold;">
<t t-esc="message.record_name and message.record_name.replace('/','-') or ''"/>
</span>
</a>
</t>
<t t-else="">
<span style="font-size: 20px; font-weight: bold;">
<t t-esc="message.record_name and message.record_name.replace('/','-') or ''"/>
</span>
</t>
</td><td valign="middle" align="right">
<img t-att-src="'/logo.png?company=%s' % (company.id or 0)" style="padding: 0px; margin: 0px; height: 48px;" t-att-alt="'%s' % company.name"/>
</td></tr>