make content as read only (#5787)

if message type is file, make content read only
This commit is contained in:
Zarrar 2018-07-06 18:16:58 +05:30 committed by Rushabh Mehta
parent 58733cdf29
commit f32467dde8
2 changed files with 10 additions and 2 deletions

View file

@ -2,7 +2,9 @@
// For license information, please see license.txt
frappe.ui.form.on('Chat Message', {
refresh: function(frm) {
onload: function(frm) {
if(frm.doc.type == 'File') {
frm.set_df_property('content', 'read_only', 1);
}
}
});

View file

@ -186,6 +186,12 @@ frappe.quick_edit = (doctype, docname, fn) => {
const fields = meta.fields
const required = fields.filter(f => f.reqd || f.bold && !f.read_only)
required.map(f => {
if(f.fieldname == 'content' && doc.type == 'File') {
f['read_only'] = 1;
}
})
const dialog = new frappe.ui.Dialog({
title: __(`Edit ${doctype} (${docname})`),
fields: required,