make content as read only (#5787)
if message type is file, make content read only
This commit is contained in:
parent
58733cdf29
commit
f32467dde8
2 changed files with 10 additions and 2 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue