fix: Allow field of submitted doc to edit if field has allow_on_submit enabled
This commit is contained in:
parent
acc27a147a
commit
4f477cbc94
1 changed files with 12 additions and 9 deletions
|
|
@ -615,15 +615,18 @@ frappe.views.ReportView = class ReportView extends frappe.views.ListView {
|
|||
}
|
||||
|
||||
is_editable(df, data) {
|
||||
if (!df || data.docstatus !== 0) return false;
|
||||
const is_standard_field = frappe.model.std_fields_list.includes(df.fieldname);
|
||||
const can_edit = !(
|
||||
is_standard_field
|
||||
|| df.read_only
|
||||
|| df.hidden
|
||||
|| !frappe.model.can_write(this.doctype)
|
||||
);
|
||||
return can_edit;
|
||||
if (df
|
||||
&& frappe.model.can_write(this.doctype)
|
||||
// not a submitted doc or field is allowed to edit after submit
|
||||
&& (data.docstatus !== 1 || df.allow_on_submit)
|
||||
// not a cancelled doc
|
||||
&& data.docstatus !== 2
|
||||
&& !df.read_only
|
||||
&& !df.hidden
|
||||
// not a standard field i.e., owner, modified_by, etc.
|
||||
&& !frappe.model.std_fields_list.includes(df.fieldname))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
get_data(values) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue