Files
odoo_source/addons/website_livechat/static/src/models/thread_view.js
T
Alexandre Kühn 0ae4fadf08 [IMP] mail, *: convert all compute/sort method into inline field function
Task-2985304

closes odoo/odoo#100765

X-original-commit: e267d52cc4380c3acf7d2f9c9abf1acb59a598c1
Related: odoo/enterprise#31606
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-09-22 01:54:20 +02:00

18 lines
511 B
JavaScript

/** @odoo-module **/
import { addFields } from '@mail/model/model_core';
import { attr } from '@mail/model/model_field';
// ensure that the model definition is loaded before the patch
import '@mail/models/thread_view';
addFields('ThreadView', {
/**
* Determines whether visitor banner should be displayed.
*/
hasVisitorBanner: attr({
compute() {
return Boolean(this.thread && this.thread.visitor && this.threadViewer && this.threadViewer.discuss);
},
}),
});