Merge pull request #9066 from vishdha/remove_attachment

fix: on image remove event remove attach file.
This commit is contained in:
mergify[bot] 2019-12-18 06:33:51 +00:00 committed by GitHub
commit 1f9b87f899
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -88,7 +88,10 @@ frappe.ui.form.setup_user_image_event = function(frm) {
}
field.$input.trigger('click');
} else {
field.set_value('').then(() => frm.save());
/// on remove event for a sidebar image wrapper remove attach file.
frm.attachments.remove_attachment_by_filename(frm.doc[frm.meta.image_field], function() {
field.set_value('').then(() => frm.save());
});
}
});
}
}