[IMP] mail: guard NotificationRequestComponent

Task-2797754

closes odoo/odoo#86843

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit is contained in:
Alexandre Kühn
2022-03-23 14:37:59 +01:00
parent 5f6da59b02
commit 89e036f0cf
2 changed files with 11 additions and 4 deletions
@@ -20,6 +20,13 @@ export class NotificationRequest extends Component {
);
}
/**
* @returns {NotificationRequestView}
*/
get notificationRequestView() {
return this.messaging && this.messaging.models['NotificationRequestView'].get(this.props.localId);
}
//--------------------------------------------------------------------------
// Private
//--------------------------------------------------------------------------
@@ -2,8 +2,8 @@
<templates xml:space="preserve">
<t t-name="mail.NotificationRequest" owl="1">
<div class="o_NotificationRequest" t-attf-class="{{ className }}" t-on-click="_onClick" t-ref="root">
<t t-if="messaging">
<t t-if="notificationRequestView">
<div class="o_NotificationRequest" t-attf-class="{{ className }}" t-on-click="_onClick" t-ref="root">
<div class="o_NotificationRequest_sidebar">
<div class="o_NotificationRequest_imageContainer o_NotificationRequest_sidebarItem">
<img class="o_NotificationRequest_image rounded-circle" src="/mail/static/src/img/odoobot.png" alt="Avatar of OdooBot"/>
@@ -26,8 +26,8 @@
</span>
</div>
</div>
</t>
</div>
</div>
</t>
</t>
</templates>