[FIX] mail: Refresh activities after calling mark as done from an editable form
Steps to follow - Go to contacts - Schedule an activity - Click on edit next to the activity - Click on the Mark as done button -> The activity isn't refreshed Cause of the issue - The record is deleted when clicking on the mark as done button - The fetchAndUpdate is called after the form is closed - An exception is thrown -> the method exists early Solution Handle odoo.exceptions.MissingError and delete the record client side opw-2702492 closes odoo/odoo#81182 X-original-commit: c56ae82bffb933090a8df33bc38ab979d5318df7 Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit is contained in:
@@ -135,11 +135,18 @@ registerModel({
|
||||
});
|
||||
},
|
||||
async fetchAndUpdate() {
|
||||
const [data] = await this.async(() => this.env.services.rpc({
|
||||
const [data] = await this.env.services.rpc({
|
||||
model: 'mail.activity',
|
||||
method: 'activity_format',
|
||||
args: [this.id],
|
||||
}, { shadow: true }));
|
||||
}, { shadow: true }).catch(e => {
|
||||
const errorName = e.message && e.message.data && e.message.data.name;
|
||||
if (errorName === 'odoo.exceptions.MissingError') {
|
||||
return [];
|
||||
} else {
|
||||
throw e;
|
||||
}
|
||||
});
|
||||
let shouldDelete = false;
|
||||
if (data) {
|
||||
this.update(this.constructor.convertData(data));
|
||||
|
||||
Reference in New Issue
Block a user