[IMP] mail: move hasParentReloadOnAttachmentsChanged code in models
Remove code from legacy form in preparation of Owl form. Part of task-2871070 Part-of: odoo/odoo#93273
This commit is contained in:
@@ -24,8 +24,8 @@ registerModel({
|
||||
async onClickOk() {
|
||||
const chatter = this.chatter;
|
||||
await this.attachment.remove();
|
||||
if (chatter && chatter.component) {
|
||||
chatter.component.trigger('o-attachments-changed');
|
||||
if (chatter && chatter.exists() && chatter.hasParentReloadOnAttachmentsChanged) {
|
||||
chatter.reloadParentView();
|
||||
}
|
||||
},
|
||||
/**
|
||||
|
||||
@@ -42,7 +42,6 @@ FormRenderer.include({
|
||||
destroy() {
|
||||
this._super(...arguments);
|
||||
this._chatterContainerComponent = undefined;
|
||||
this.off('o_attachments_changed', this);
|
||||
this.off('o_chatter_rendered', this);
|
||||
this.off('o_message_posted', this);
|
||||
Component.env.bus.off('Thread:promptAddFollower-closed', this);
|
||||
@@ -80,9 +79,6 @@ FormRenderer.include({
|
||||
this.trigger_up('reload', { keepChanges: true });
|
||||
});
|
||||
}
|
||||
if (this.chatterFields.hasRecordReloadOnAttachmentsChanged) {
|
||||
this.on('o_attachments_changed', this, ev => this.trigger_up('reload', { keepChanges: true }));
|
||||
}
|
||||
if (this.chatterFields.hasRecordReloadOnFollowersUpdate) {
|
||||
Component.env.bus.on('Thread:promptAddFollower-closed', this, ev => this.trigger_up('reload', { keepChanges: true }));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user