mirror of
https://github.com/frappe/books.git
synced 2025-02-08 23:18:31 +00:00
fix: prevent cancelled editable
This commit is contained in:
parent
d92641f181
commit
18d3bbf959
@ -184,14 +184,6 @@ export default {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
evaluateReadOnly(df) {
|
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);
|
return evaluateReadOnly(df, this.doc);
|
||||||
},
|
},
|
||||||
async onChange(df, value) {
|
async onChange(df, value) {
|
||||||
@ -317,9 +309,6 @@ export default {
|
|||||||
'grid-template-columns': templateColumns,
|
'grid-template-columns': templateColumns,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
submitted() {
|
|
||||||
return this.doc.isSubmitted;
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -6,6 +6,18 @@ export function evaluateReadOnly(field: Field, doc: Doc) {
|
|||||||
return field.readOnly;
|
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];
|
const readOnlyFunc = doc.readOnly[field.fieldname];
|
||||||
if (readOnlyFunc !== undefined) {
|
if (readOnlyFunc !== undefined) {
|
||||||
return readOnlyFunc();
|
return readOnlyFunc();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user