FrappeModelController class
A controller containing methods and properties related to document CRUD operations of Frappé
- Inheritance
-
- Object
- RenovationController
- ModelController<
FrappeDocument> - FrappeModelController
Constructors
Properties
Methods
-
addChildDoc<
T extends FrappeDocument> (T childDoc, dynamic field) → Future< T> -
Returns a child doc instance, already attached to parent doc
override
-
addTag(
{required String doctype, required String docName, required String tag}) → Future< RequestResponse< String?> > -
Adds a tag to document
docName
of adoctype
.override -
addToLocals<
T extends FrappeDocument> (T doc) → void -
Adds the documents to a static local variable locals.
override
-
amendDoc<
T extends FrappeDocument> (T doc) → T -
Clones a doc, set amended_from property to the original doc.
override
-
assignDoc(
{String? assignTo, String? doctype, bool? myself = false, DateTime? dueDate, String? description, String? docName, List< String> ? docNames, bool notify = false, Priority? priority, bool bulkAssign = false}) → Future<RequestResponse< bool?> > -
Assigns a doc or a list of docs to a particular user.
override
-
cancelDoc<
T extends FrappeDocument> (T doc) → Future< RequestResponse< T?> > -
Returns the cancelled document
T
of a submitted document.override -
clearCache(
) → void -
Clears the
locals
andnewNameCount
and reset to{}
inherited -
completeDocAssignment(
{String? doctype, String? docName, String? assignedTo}) → Future< RequestResponse< bool?> > -
Sets the assignment to Status.Cancelled which means that the task is assigned.
override
-
copyDoc<
T extends FrappeDocument> (T doc) → T -
Returns a cloned doc, with a new local name.
override
-
deleteDoc(
String? doctype, String? docName) → Future< RequestResponse< String?> > -
Deletes the document from the backend, returning its name.
override
-
getCore(
) → Renovation -
Gets the reference to the Renovation instance
inherited
-
getDoc<
T extends FrappeDocument> (T obj, String docName, {bool? forceFetch = false}) → Future< RequestResponse< T?> > -
Returns the document specified by its
docName
.override -
getDocFromCache<
T extends K> (String? doctype, String docname) → T? -
Returns the document from the local map.
inherited
-
getDocsAssignedToUser(
{required String assignedTo, String? doctype, Status? status}) → Future< RequestResponse< List< >GetDocsAssignedToUserResponse> ?> -
Returns the list of documents assigned to a user.
override
-
getHostUrl(
) → String -
Returns the configured host URL towards the backend
inherited
-
getList<
T extends FrappeDocument> (T obj, {List< String> ? fields, dynamic filters, String? orderBy = 'modified desc', int? limitPageStart = 0, int? limitPageLength = 99, String? parent, Map<String, List< ? tableFields, List<String> >String> ? withLinkFields}) → Future<RequestResponse< List< >T?> ?> -
Returns list of documents
T
of a doctype specified byobj
.override -
getNewName(
String doctype) → String -
Returns a new name for a doctype.
override
-
getReport(
{required String report, dynamic filters, String? user}) → Future< RequestResponse< FrappeReport?> > -
Get report values in the form of FrappeReport.
override
-
getTaggedDocs(
{required String doctype, String? tag}) → Future< RequestResponse< List< >String> ?> -
Gets all the names of all documents with the param-tag.
override
-
getTags(
{required String doctype, String? likeTag}) → Future< RequestResponse< List< >String?> ?> -
Returns all tags of a doctype.
override
-
getUsersAssignedToDoc(
{required String doctype, required String docName}) → Future< RequestResponse< List< >ToDo?> ?> -
Returns the users assigned to a document of a certain doctype as list of ToDo.
override
-
getValue(
String doctype, String docName, String docField) → Future< RequestResponse< Map< >String, dynamic> ?> -
Returns a Map of docfield and its value of a specific
doctype
anddocName
from the backend. For instance:override -
handleError(
String? errorId, ErrorDetail? error) → ErrorDetail -
Returns the
ErrorDetail
after manipulating an existing one. -
newDoc<
T extends FrappeDocument> (T doc) → T -
Returns a new instance of
T
document with a new name based on getNewName.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
removeTag(
{required String doctype, required String docName, required String tag}) → Future< RequestResponse< String?> > -
Removes a tag from a document.
override
-
saveDoc<
T extends FrappeDocument> (T doc) → Future< RequestResponse< T?> > -
Returns the saved document
T
after saving in the backend and locally.override -
saveSubmitDoc<
T extends FrappeDocument> (T doc) → Future< RequestResponse< T?> > -
Saves the document first, then submit, in a single db transaction.
override
-
searchLink(
{required String doctype, required String txt, Map< String, dynamic> ? options}) → Future<RequestResponse< List< >SearchLinkResponse> ?> -
Returns a list of SearchLinkResponse after searching against fields.
override
-
setValue<
T extends FrappeDocument> (T obj, String? docName, String docField, dynamic docValue) → Future< RequestResponse< T?> > -
Returns the modified document
T
after setting thedocField
withdocValue
.override -
submitDoc<
T extends FrappeDocument> (T doc) → Future< RequestResponse< T?> > -
Submit a submittable document.
override
-
toString(
) → String -
A string representation of this object.
inherited
-
unAssignDoc(
{String? doctype, String? docName, String? unAssignFrom}) → Future< RequestResponse< bool?> > -
Un-assigns a user from the
doctype
anddocName
.override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- DOCFIELD_NOT_EXIST_TITLE → const String
- DOCNAME_NOT_EXIST_TITLE → const String
- DOCTYPE_NOT_EXIST_TITLE → const String
- DOCTYPE_OR_DOCNAME_NOT_EXIST_TITLE → const String