amendDoc<T extends FrappeDocument> method
Clones a doc, set amended_from property to the original doc.
Implementation
@override
T amendDoc<T extends FrappeDocument>(T doc) {
EmptyDoctypeError.verify(doc.doctype);
EmptyDocNameError.verify(doc.name);
if (doc.docStatus != FrappeDocStatus.Submitted) {
throw NotASubmittedDocument();
}
final newDoc = copyDoc(doc);
newDoc.amendedFrom = doc.name;
return newDoc;
}