summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/models/activity/activity.js
diff options
context:
space:
mode:
authorHiral Bhavsar <hbh@odoo.com>2020-10-09 11:45:32 +0000
committerHiral Bhavsar <hbh@odoo.com>2020-10-16 11:40:23 +0000
commit623c5176a37ae5fd048d6bb10e742fac5caa6cf2 (patch)
treed96fb486119c086b179ab27083920018d76994c4 /addons/mail/static/src/models/activity/activity.js
parent9ad1f0d43d3ab0d6262c4fb6d1ceb9f58763b2c1 (diff)
[FIX] mail: marking activity done from form view
Before this commit: When editing the activity, traceback while processing with buttons "Done & Schedule Next", "Mark as Done" from the form view. This is happening because when we process with these buttons it complete the action of respective buttons and then the trigger will go on the close window. Hence, we don't have activity data as "mark as done" remove the activity. After this commit: Footer buttons will be processed as expected without any traceback. Task-2357681 closes odoo/odoo#59643 Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Diffstat (limited to 'addons/mail/static/src/models/activity/activity.js')
-rw-r--r--addons/mail/static/src/models/activity/activity.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/addons/mail/static/src/models/activity/activity.js b/addons/mail/static/src/models/activity/activity.js
index b88c4b335d2..5b9af7013ca 100644
--- a/addons/mail/static/src/models/activity/activity.js
+++ b/addons/mail/static/src/models/activity/activity.js
@@ -160,8 +160,13 @@ function factory(dependencies) {
method: 'activity_format',
args: [this.id],
}, { shadow: true }));
- this.update(this.constructor.convertData(data));
- this.thread.refresh();
+ if (data) {
+ this.update(this.constructor.convertData(data));
+ this.thread.refresh();
+ } else {
+ this.thread.refresh();
+ this.delete();
+ }
}
/**