2
0
mirror of https://github.com/frappe/books.git synced 2025-02-02 20:18:26 +00:00

fix: prevent cancelled editable

This commit is contained in:
18alantom 2022-09-15 14:55:05 +05:30
parent d92641f181
commit 18d3bbf959
2 changed files with 12 additions and 11 deletions

View File

@ -184,14 +184,6 @@ export default {
);
},
evaluateReadOnly(df) {
if (df.fieldname === 'numberSeries' && !this.doc.notInserted) {
return true;
}
if (this.submitted || this.doc.parentdoc?.isSubmitted) {
return true;
}
return evaluateReadOnly(df, this.doc);
},
async onChange(df, value) {
@ -317,9 +309,6 @@ export default {
'grid-template-columns': templateColumns,
};
},
submitted() {
return this.doc.isSubmitted;
},
},
};
</script>

View File

@ -6,6 +6,18 @@ export function evaluateReadOnly(field: Field, doc: Doc) {
return field.readOnly;
}
if (field.fieldname === 'numberSeries' && !doc.notInserted) {
return true;
}
if (doc.isSubmitted || doc.parentdoc?.isSubmitted) {
return true;
}
if (doc.isCancelled || doc.parentdoc?.isCancelled) {
return true;
}
const readOnlyFunc = doc.readOnly[field.fieldname];
if (readOnlyFunc !== undefined) {
return readOnlyFunc();