Task-3002515. * = hr_holidays, im_livechat closes odoo/odoo#101774 Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
45 lines
1.5 KiB
JavaScript
45 lines
1.5 KiB
JavaScript
/** @odoo-module **/
|
|
|
|
import { registerModel } from '@mail/model/model_core';
|
|
import { one } from '@mail/model/model_field';
|
|
|
|
registerModel({
|
|
name: 'ThreadIconView',
|
|
identifyingMode: 'xor',
|
|
fields: {
|
|
chatWindowHeaderViewOwner: one('ChatWindowHeaderView', {
|
|
identifying: true,
|
|
inverse: 'threadIconView',
|
|
}),
|
|
discussSidebarCategoryItemOwner: one('DiscussSidebarCategoryItem', {
|
|
identifying: true,
|
|
inverse: 'threadIconView',
|
|
}),
|
|
discussSidebarMailboxViewOwner: one('DiscussSidebarMailboxView', {
|
|
identifying: true,
|
|
inverse: 'threadIconView',
|
|
}),
|
|
thread: one('Thread', {
|
|
compute() {
|
|
if (this.chatWindowHeaderViewOwner) {
|
|
return this.chatWindowHeaderViewOwner.chatWindowOwner.thread;
|
|
}
|
|
if (this.discussSidebarCategoryItemOwner) {
|
|
return this.discussSidebarCategoryItemOwner.thread;
|
|
}
|
|
if (this.discussSidebarMailboxViewOwner) {
|
|
return this.discussSidebarMailboxViewOwner.mailbox.thread;
|
|
}
|
|
if (this.threadViewTopbarOwner) {
|
|
return this.threadViewTopbarOwner.thread
|
|
}
|
|
},
|
|
required: true,
|
|
}),
|
|
threadViewTopbarOwner: one('ThreadViewTopbar', {
|
|
identifying: true,
|
|
inverse: 'threadIconView',
|
|
}),
|
|
},
|
|
});
|