diff --git a/.gitignore b/.gitignore index 27b2369dab..a45a03de15 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,3 @@ locale *.egg-info dist/ build/ -docs/ diff --git a/frappe/config/docs.py b/frappe/config/docs.py new file mode 100644 index 0000000000..1f28f557dd --- /dev/null +++ b/frappe/config/docs.py @@ -0,0 +1,16 @@ + +source_link = "https://github.com/frappe/frappe" +docs_base_url = "https://frappe.github.io/frappe" +headline = "Full stack web framework to build complex apps" +sub_heading = "Build extensions to ERPNext or make your own database driven app" +hide_install = True +long_description = """The Frappe Framework is a server side and client side +framework and is built with the philosophy make it "battries included". +It has libraries and API for authentication, MVC, permissions, REST API, +templating, admin interface, forms, reports and much more. + +Frappe Framework was designed to build [ERPNext](https://erpnext.com), open source +ERP for managing small and medium sized businesses. +""" +def get_context(context): + context.title = "Frappe Framework" diff --git a/frappe/docs/assets/img/add_user_roles.png b/frappe/docs/assets/img/add_user_roles.png new file mode 100644 index 0000000000..49006acef9 Binary files /dev/null and b/frappe/docs/assets/img/add_user_roles.png differ diff --git a/frappe/docs/assets/img/attach_image.gif b/frappe/docs/assets/img/attach_image.gif new file mode 100644 index 0000000000..c360c8513e Binary files /dev/null and b/frappe/docs/assets/img/attach_image.gif differ diff --git a/frappe/docs/assets/img/autoname_and_search_field.png b/frappe/docs/assets/img/autoname_and_search_field.png new file mode 100644 index 0000000000..ea801805e5 Binary files /dev/null and b/frappe/docs/assets/img/autoname_and_search_field.png differ diff --git a/frappe/docs/assets/img/desk.png b/frappe/docs/assets/img/desk.png new file mode 100644 index 0000000000..311ff5a7cb Binary files /dev/null and b/frappe/docs/assets/img/desk.png differ diff --git a/frappe/docs/assets/img/doctype_adding_field.png b/frappe/docs/assets/img/doctype_adding_field.png new file mode 100644 index 0000000000..8ce7fdf284 Binary files /dev/null and b/frappe/docs/assets/img/doctype_adding_field.png differ diff --git a/frappe/docs/assets/img/doctype_adding_permission.png b/frappe/docs/assets/img/doctype_adding_permission.png new file mode 100644 index 0000000000..6853f42b01 Binary files /dev/null and b/frappe/docs/assets/img/doctype_adding_permission.png differ diff --git a/frappe/docs/assets/img/doctype_article.png b/frappe/docs/assets/img/doctype_article.png new file mode 100644 index 0000000000..3532ee2f74 Binary files /dev/null and b/frappe/docs/assets/img/doctype_article.png differ diff --git a/frappe/docs/assets/img/doctype_lib_member.png b/frappe/docs/assets/img/doctype_lib_member.png new file mode 100644 index 0000000000..3257fcf08e Binary files /dev/null and b/frappe/docs/assets/img/doctype_lib_member.png differ diff --git a/frappe/docs/assets/img/doctype_lib_membership.png b/frappe/docs/assets/img/doctype_lib_membership.png new file mode 100644 index 0000000000..c32e348e1d Binary files /dev/null and b/frappe/docs/assets/img/doctype_lib_membership.png differ diff --git a/frappe/docs/assets/img/doctype_lib_trans.png b/frappe/docs/assets/img/doctype_lib_trans.png new file mode 100644 index 0000000000..e7059290e9 Binary files /dev/null and b/frappe/docs/assets/img/doctype_lib_trans.png differ diff --git a/frappe/docs/assets/img/doctype_new.png b/frappe/docs/assets/img/doctype_new.png new file mode 100644 index 0000000000..e24c605e2b Binary files /dev/null and b/frappe/docs/assets/img/doctype_new.png differ diff --git a/frappe/docs/assets/img/fetch.png b/frappe/docs/assets/img/fetch.png new file mode 100644 index 0000000000..3ac38b8e08 Binary files /dev/null and b/frappe/docs/assets/img/fetch.png differ diff --git a/frappe/docs/assets/img/home.png b/frappe/docs/assets/img/home.png new file mode 100644 index 0000000000..cc34207724 Binary files /dev/null and b/frappe/docs/assets/img/home.png differ diff --git a/frappe/docs/assets/img/lib_management_module.png b/frappe/docs/assets/img/lib_management_module.png new file mode 100644 index 0000000000..be2a5d9820 Binary files /dev/null and b/frappe/docs/assets/img/lib_management_module.png differ diff --git a/frappe/docs/assets/img/lib_trans.png b/frappe/docs/assets/img/lib_trans.png new file mode 100644 index 0000000000..6ab4dbfa48 Binary files /dev/null and b/frappe/docs/assets/img/lib_trans.png differ diff --git a/frappe/docs/assets/img/link_field.png b/frappe/docs/assets/img/link_field.png new file mode 100644 index 0000000000..dac6600809 Binary files /dev/null and b/frappe/docs/assets/img/link_field.png differ diff --git a/frappe/docs/assets/img/login.png b/frappe/docs/assets/img/login.png new file mode 100644 index 0000000000..217d03f612 Binary files /dev/null and b/frappe/docs/assets/img/login.png differ diff --git a/frappe/docs/assets/img/naming_doctype.png b/frappe/docs/assets/img/naming_doctype.png new file mode 100644 index 0000000000..ca109e7c5d Binary files /dev/null and b/frappe/docs/assets/img/naming_doctype.png differ diff --git a/frappe/docs/assets/img/new_article.png b/frappe/docs/assets/img/new_article.png new file mode 100644 index 0000000000..6e17d82bfc Binary files /dev/null and b/frappe/docs/assets/img/new_article.png differ diff --git a/frappe/docs/assets/img/new_article_blank.png b/frappe/docs/assets/img/new_article_blank.png new file mode 100644 index 0000000000..54c8d9152a Binary files /dev/null and b/frappe/docs/assets/img/new_article_blank.png differ diff --git a/frappe/docs/assets/img/new_lib_membership.png b/frappe/docs/assets/img/new_lib_membership.png new file mode 100644 index 0000000000..ea8e16aa8b Binary files /dev/null and b/frappe/docs/assets/img/new_lib_membership.png differ diff --git a/frappe/docs/assets/img/new_member.png b/frappe/docs/assets/img/new_member.png new file mode 100644 index 0000000000..0bf0cea89d Binary files /dev/null and b/frappe/docs/assets/img/new_member.png differ diff --git a/frappe/docs/assets/img/report.png b/frappe/docs/assets/img/report.png new file mode 100644 index 0000000000..f0fe15bcfc Binary files /dev/null and b/frappe/docs/assets/img/report.png differ diff --git a/frappe/docs/assets/img/roles_creation.png b/frappe/docs/assets/img/roles_creation.png new file mode 100644 index 0000000000..e2733d7cd6 Binary files /dev/null and b/frappe/docs/assets/img/roles_creation.png differ diff --git a/frappe/docs/assets/img/select_field.png b/frappe/docs/assets/img/select_field.png new file mode 100644 index 0000000000..4ac4f213ad Binary files /dev/null and b/frappe/docs/assets/img/select_field.png differ diff --git a/frappe/docs/assets/img/system_settings.png b/frappe/docs/assets/img/system_settings.png new file mode 100644 index 0000000000..934dad3619 Binary files /dev/null and b/frappe/docs/assets/img/system_settings.png differ diff --git a/frappe/docs/assets/img/tab_single.png b/frappe/docs/assets/img/tab_single.png new file mode 100644 index 0000000000..e341313711 Binary files /dev/null and b/frappe/docs/assets/img/tab_single.png differ diff --git a/frappe/docs/contents.html b/frappe/docs/contents.html new file mode 100644 index 0000000000..59d0b4459d --- /dev/null +++ b/frappe/docs/contents.html @@ -0,0 +1,10 @@ + + +
+ + + frappe.config.desktop.get_data + () +
+No docs
++ + + frappe.config.docs.get_context + (context) +
+No docs
++ + + frappe.config.integrations.get_data + () +
+No docs
++ + + frappe.config.setup.get_data + () +
+No docs
++ + + frappe.config.website.get_data + () +
+No docs
++ + + frappe.core.notifications.get_notification_config + () +
+No docs
++ + + frappe.core.notifications.get_things_todo + () +
+Returns a count of incomplete todos
++ + + frappe.core.notifications.get_todays_events + () +
+Returns a count of todays events in calendar
++ + + frappe.core.notifications.get_unread_messages + () +
+returns unread (docstatus-0 messages for a user)
+Public API
+ /api/method/frappe.desk.form.assign_to.add
+
+ + + frappe.desk.form.assign_to.add + (args=None) +
+add in someone's to do list +args = { + "assign_to": , + "doctype": , + "name": , + "description": +}
++ + + frappe.desk.form.assign_to.clear + (doctype, name) +
+No docs
++ + + frappe.desk.form.assign_to.get + (args=None) +
+get assigned to
++ + + frappe.desk.form.assign_to.notify_assignment + (assigned_by, owner, doc_type, doc_name, action=CLOSE, description=None, notify=0) +
+Notify assignee that there is a change in assignment
+Public API
+ /api/method/frappe.desk.form.assign_to.remove
+
+ + + frappe.desk.form.assign_to.remove + (doctype, name, assign_to) +
+remove from todo
++ + + frappe.desk.form.linked_with._get_linked_doctypes + (doctype) +
+No docs
++ + + frappe.desk.form.linked_with.get_dynamic_linked_fields + (doctype) +
+No docs
+Public API
+ /api/method/frappe.desk.form.linked_with.get_linked_docs
+
+ + + frappe.desk.form.linked_with.get_linked_docs + (doctype, name, linkinfo=None) +
+No docs
+Public API
+ /api/method/frappe.desk.form.linked_with.get_linked_doctypes
+
+ + + frappe.desk.form.linked_with.get_linked_doctypes + (doctype) +
+add list of doctypes this doctype is 'linked' with.
+ +Example, for Customer:
+ +{"Address": {"fieldname": "customer"}..}
+
++ + + frappe.desk.form.linked_with.get_linked_fields + (doctype) +
+No docs
++ + + frappe.desk.form.load.get_assignments + (dt, dn) +
+No docs
++ + + frappe.desk.form.load.get_attachments + (dt, dn) +
+No docs
+Public API
+ /api/method/frappe.desk.form.load.get_badge_info
+
+ + + frappe.desk.form.load.get_badge_info + (doctypes, filters) +
+No docs
++ + + frappe.desk.form.load.get_comments + (dt, dn, limit=100) +
+No docs
+Public API
+ /api/method/frappe.desk.form.load.get_docinfo
+
+ + + frappe.desk.form.load.get_docinfo + (doc=None, doctype=None, name=None) +
+No docs
++ + + frappe.desk.form.load.get_meta_bundle + (doctype) +
+No docs
++ + + frappe.desk.form.load.get_user_permissions + (meta) +
+No docs
+Public API
+ /api/method/frappe.desk.form.load.getdoc
+
+ + + frappe.desk.form.load.getdoc + (doctype, name, user=None) +
+Loads a doclist for a given document. This method is called directly from the client. +Requries "doctype", "name" as form variables. +Will also call the "onload" method on the document.
+Public API
+ /api/method/frappe.desk.form.load.getdoctype
+
+ + + frappe.desk.form.load.getdoctype + (doctype, with_parent=False, cached_timestamp=None) +
+load doctype
++ + + frappe.desk.form.load.run_onload + (doc) +
+No docs
+Inherits from frappe.model.meta.Meta + +
+ + + __init__ + (self, doctype) +
+No docs
++ + + _add_code + (self, path, fieldname) +
+No docs
++ + + add_code + (self) +
+No docs
++ + + add_code_via_hook + (self, hook, fieldname) +
+No docs
++ + + add_custom_script + (self) +
+embed all require files
++ + + add_html_templates + (self, path) +
+No docs
++ + + add_linked_document_type + (self) +
+No docs
++ + + add_search_fields + (self) +
+add search fields found in the doctypes indicated by link fields' options
++ + + as_dict + (self, no_nulls=False) +
+No docs
++ + + load_assets + (self) +
+No docs
++ + + load_print_formats + (self) +
+No docs
++ + + load_templates + (self) +
+No docs
++ + + load_workflows + (self) +
+No docs
++ + + set_translations + (self, lang) +
+No docs
++ + + frappe.desk.form.meta.get_meta + (doctype, cached=True) +
+No docs
++ + + frappe.desk.form.run_method.make_csv_output + (res, dt) +
+send method response as downloadable CSV file
+Public API
+ /api/method/frappe.desk.form.run_method.runserverobj
+
+ + + frappe.desk.form.run_method.runserverobj + (method, docs=None, dt=None, dn=None, arg=None, args=None) +
+run controller method - old style
+Public API
+ /api/method/frappe.desk.form.save.cancel
+
+ + + frappe.desk.form.save.cancel + (doctype=None, name=None, workflow_state_fieldname=None, workflow_state=None) +
+cancel a doclist
+Public API
+ /api/method/frappe.desk.form.save.savedocs
+
+ + + frappe.desk.form.save.savedocs + () +
+save / submit / update doclist
++ + + frappe.desk.form.save.send_updated_docs + (doc) +
+No docs
++ + + frappe.desk.form.save.set_local_name + (doc) +
+No docs
+Inherits from unittest.case.TestCase + +
Public API
+ /api/method/frappe.desk.form.utils.add_comment
+
+ + + frappe.desk.form.utils.add_comment + (doc) +
+allow any logged user to post a comment
+Public API
+ /api/method/frappe.desk.form.utils.get_fields
+
+ + + frappe.desk.form.utils.get_fields + () +
+get fields
+Public API
+ /api/method/frappe.desk.form.utils.get_next
+
+ + + frappe.desk.form.utils.get_next + (doctype, value, prev, filters=None, order_by=modified desc) +
+No docs
+Public API
+ /api/method/frappe.desk.form.utils.remove_attach
+
+ + + frappe.desk.form.utils.remove_attach + () +
+remove attachment
+Public API
+ /api/method/frappe.desk.form.utils.validate_link
+
+ + + frappe.desk.form.utils.validate_link + () +
+validate link when updated by user
++ + + frappe.desk.calendar.get_event_conditions + (doctype, filters=None) +
+Returns SQL conditions with user permissions and filters for event queries
+Public API
+ /api/method/frappe.desk.calendar.update_event
+
+ + + frappe.desk.calendar.update_event + (args, field_map) +
+Updates Event (called via calendar) based on passed field_map
Public API
+ /api/method/frappe.desk.desk_page.get
+
+ + + frappe.desk.desk_page.get + (name) +
+Return the :term:doclist of the Page specified by name
Public API
+ /api/method/frappe.desk.desk_page.getpage
+
+ + + frappe.desk.desk_page.getpage + () +
+Load the page from frappe.form and send it via frappe.response
+ + + frappe.desk.desk_page.has_permission + (page) +
+No docs
++ + + frappe.desk.moduleview.add_custom_doctypes + (data, doctype_info) +
+Adds Custom DocTypes to modules setup via config/desktop.py.
+ + + frappe.desk.moduleview.add_section + (data, label, icon, items) +
+Adds a section to the module data.
++ + + frappe.desk.moduleview.add_setup_section + (config, app, module, label, icon) +
+Add common sections to /desk#Module/Setup
+ + + frappe.desk.moduleview.apply_permissions + (data) +
+No docs
++ + + frappe.desk.moduleview.build_config_from_file + (module) +
+Build module info from app/config/desktop.py files.
+ + + frappe.desk.moduleview.build_standard_config + (module, doctype_info) +
+Build standard module data from DocTypes.
++ + + frappe.desk.moduleview.combine_common_sections + (data) +
+Combine sections declared in separate apps.
+Public API
+ /api/method/frappe.desk.moduleview.get
+
+ + + frappe.desk.moduleview.get + (module) +
+Returns data (sections, list of reports, counts) to render module view in desk:
+/desk/#Module/[name].
+ + + frappe.desk.moduleview.get_config + (app, module) +
+Load module info from [app].config.[module].
+ + + frappe.desk.moduleview.get_data + (module) +
+Get module data for the module view desk/#Module/[name]
+ + + frappe.desk.moduleview.get_doctype_info + (module) +
+Returns list of non child DocTypes for given module.
++ + + frappe.desk.moduleview.get_last_modified + (doctype) +
+No docs
++ + + frappe.desk.moduleview.get_report_list + (module, is_standard=No) +
+Returns list on new style reports for modules.
++ + + frappe.desk.moduleview.get_setup_section + (app, module, label, icon) +
+Get the setup section from each module (for global Setup page).
++ + + frappe.desk.moduleview.set_last_modified + (data) +
+No docs
++ + + frappe.desk.notifications.clear_doctype_notifications + (doc, method=None) +
+No docs
++ + + frappe.desk.notifications.clear_notifications + (user=*) +
+No docs
++ + + frappe.desk.notifications.delete_notification_count_for + (doctype) +
+No docs
++ + + frappe.desk.notifications.get_new_messages + () +
+No docs
++ + + frappe.desk.notifications.get_notification_config + () +
+No docs
++ + + frappe.desk.notifications.get_notification_info_for_boot + () +
+No docs
+Public API
+ /api/method/frappe.desk.notifications.get_notifications
+
+ + + frappe.desk.notifications.get_notifications + () +
+No docs
++ + + frappe.desk.notifications.get_notifications_for_doctypes + (config, notification_count) +
+No docs
++ + + frappe.desk.notifications.get_notifications_for_modules + (config, notification_count) +
+No docs
++ + + frappe.desk.query_builder.add_limit_to_query + (query, args) +
+Add limit condition to query +can be used by methods called in listing to add limit condition
++ + + frappe.desk.query_builder.add_match_conditions + (q, tl) +
+No docs
++ + + frappe.desk.query_builder.build_description_simple + () +
+No docs
++ + + frappe.desk.query_builder.build_description_standard + (meta, tl) +
+No docs
++ + + frappe.desk.query_builder.get_parent_dt + (dt) +
+No docs
++ + + frappe.desk.query_builder.get_sql_meta + (tl) +
+No docs
++ + + frappe.desk.query_builder.get_sql_tables + (q) +
+No docs
++ + + frappe.desk.query_builder.guess_type + (m) +
+Returns fieldtype depending on the MySQLdb Description
+Public API
+ /api/method/frappe.desk.query_builder.runquery
+
+ + + frappe.desk.query_builder.runquery + (q=, ret=0, from_export=0) +
+No docs
+Public API
+ /api/method/frappe.desk.query_builder.runquery_csv
+
+ + + frappe.desk.query_builder.runquery_csv + () +
+No docs
++ + + frappe.desk.query_report.add_total_row + (result, columns) +
+No docs
++ + + frappe.desk.query_report.get_columns_dict + (columns) +
+Returns a dict with column docfield values as dict +The keys for the dict are both idx and fieldname, +so either index or fieldname can be used to search for a column's docfield properties
++ + + frappe.desk.query_report.get_filtered_data + (ref_doctype, columns, data) +
+No docs
++ + + frappe.desk.query_report.get_linked_doctypes + (columns, data) +
+No docs
++ + + frappe.desk.query_report.get_report_doc + (report_name) +
+No docs
++ + + frappe.desk.query_report.get_report_module_dotted_path + (module, report_name) +
+No docs
+Public API
+ /api/method/frappe.desk.query_report.get_script
+
+ + + frappe.desk.query_report.get_script + (report_name) +
+No docs
++ + + frappe.desk.query_report.get_user_match_filters + (doctypes, ref_doctype) +
+No docs
++ + + frappe.desk.query_report.has_match + (row, linked_doctypes, doctype_match_filters, ref_doctype, if_owner, columns_dict) +
+Returns True if after evaluating permissions for each linked doctype
+- There is an owner match for the ref_doctype
+- and There is a user permission match for all linked doctypes
Returns True if the row is empty
+ +Note: +Each doctype could have multiple conflicting user permission doctypes. +Hence even if one of the sets allows a match, it is true. +This behavior is equivalent to the trickling of user permissions of linked doctypes to the ref doctype.
+Public API
+ /api/method/frappe.desk.query_report.run
+
+ + + frappe.desk.query_report.run + (report_name, filters=()) +
+No docs
+Public API
+ /api/method/frappe.desk.report_dump.get_data
+
+ + + frappe.desk.report_dump.get_data + (doctypes, last_modified) +
+No docs
++ + + frappe.desk.reportview.build_match_conditions + (doctype, as_condition=True) +
+No docs
++ + + frappe.desk.reportview.compress + (data) +
+separate keys and values
+Public API
+ /api/method/frappe.desk.reportview.delete_items
+
+ + + frappe.desk.reportview.delete_items + () +
+delete selected items
++ + + frappe.desk.reportview.execute + (doctype) +
+No docs
+Public API
+ /api/method/frappe.desk.reportview.export_query
+
+ + + frappe.desk.reportview.export_query + () +
+export from report builder
+Public API
+ /api/method/frappe.desk.reportview.get
+
+ + + frappe.desk.reportview.get + () +
+No docs
++ + + frappe.desk.reportview.get_form_params + () +
+Stringify GET request parameters.
++ + + frappe.desk.reportview.get_labels + (fields, doctype) +
+get column labels based on column names
++ + + frappe.desk.reportview.get_match_cond + (doctype) +
+No docs
+Public API
+ /api/method/frappe.desk.reportview.get_stats
+
+ + + frappe.desk.reportview.get_stats + (stats, doctype) +
+get tag info
+Public API
+ /api/method/frappe.desk.reportview.save_report
+
+ + + frappe.desk.reportview.save_report + () +
+save report
++ + + frappe.desk.reportview.scrub_user_tags + (tagcount) +
+rebuild tag list for tags
++ + + frappe.desk.search.build_for_autosuggest + (res) +
+No docs
++ + + frappe.desk.search.get_std_fields_list + (meta, key) +
+No docs
++ + + frappe.desk.search.scrub_custom_query + (query, key, txt) +
+No docs
+Public API
+ /api/method/frappe.desk.search.search_link
+
+ + + frappe.desk.search.search_link + (doctype, txt, query=None, filters=None, page_len=20, searchfield=None) +
+No docs
+Public API
+ /api/method/frappe.desk.search.search_widget
+
+ + + frappe.desk.search.search_widget + (doctype, txt, query=None, searchfield=None, start=0, page_len=50, filters=None) +
+No docs
++ + + frappe.desk.star._toggle_star + (doctype, name, add=False, user=None) +
+Same as toggle_star but hides param user from API
Public API
+ /api/method/frappe.desk.star.toggle_star
+
+ + + frappe.desk.star.toggle_star + (doctype, name, add=False) +
+Adds / removes the current user in the __starred_by property of the given document.
+If column does not exist, will add it in the database.
The _starred_by property is always set from this function and is ignored if set via
+Document API
Parameters:
+ +doctype - DocType of the document to starname - Name of the document to staradd - Yes if star is to be added. If not Yes the star will be removed.Tags for a particular doctype
++ + + __init__ + (self, dt) +
+No docs
++ + + add + (self, dn, tag) +
+add a new user tag
++ + + get_tag_fields + (self) +
+returns tag_fields property
++ + + get_tags + (self, dn) +
+returns tag for a particular item
++ + + remove + (self, dn, tag) +
+remove a user tag
++ + + remove_all + (self, dn) +
+remove all user tags (call before delete)
++ + + setup + (self) +
+adds the usertags column if not exists
++ + + update + (self, dn, tl) +
+updates the usertag column in the table
+Public API
+ /api/method/frappe.desk.tags.add_tag
+
+ + + frappe.desk.tags.add_tag + () +
+adds a new tag to a record, and creates the Tag master
++ + + frappe.desk.tags.check_user_tags + (dt) +
+if the user does not have a tags column, then it creates one
+Public API
+ /api/method/frappe.desk.tags.get_tags
+
+ + + frappe.desk.tags.get_tags + (doctype, txt) +
+No docs
+Public API
+ /api/method/frappe.desk.tags.remove_tag
+
+ + + frappe.desk.tags.remove_tag + () +
+removes tag from the record
+Inherits from frappe.exceptions.ValidationError + +
+ + + frappe.email.bulk.add + (email, sender, subject, formatted, text_content=None, reference_doctype=None, reference_name=None, attachments=None, reply_to=None, cc=(), message_id=None, send_after=None, bulk_priority=1) +
+add to bulk mail queue
++ + + frappe.email.bulk.check_bulk_limit + (recipients) +
+No docs
++ + + frappe.email.bulk.clear_outbox + () +
+Remove mails older than 31 days in Outbox. Called daily via scheduler.
++ + + frappe.email.bulk.flush + (from_test=False) +
+flush email queue, every time: called from scheduler
++ + + frappe.email.bulk.get_unsubcribed_url + (reference_doctype, reference_name, email, unsubscribe_method, unsubscribe_params) +
+No docs
++ + + frappe.email.bulk.get_unsubscribe_link + (reference_doctype, reference_name, email, recipients, expose_recipients, show_as_cc, unsubscribe_method, unsubscribe_params, unsubscribe_message) +
+No docs
++ + + frappe.email.bulk.return_unsubscribed_page + (email, doctype, name) +
+No docs
++ + + frappe.email.bulk.send + (recipients=None, sender=None, subject=None, message=None, reference_doctype=None, reference_name=None, unsubscribe_method=None, unsubscribe_params=None, unsubscribe_message=None, attachments=None, reply_to=None, cc=(), show_as_cc=(), message_id=None, send_after=None, expose_recipients=False, bulk_priority=1) +
+Add email to sending queue (Bulk Email)
+ +Parameters:
+ +recipients - List of recipients.sender - Email sender.subject - Email subject.message - Email message.reference_doctype - Reference DocType of caller document.reference_name - Reference name of caller document.bulk_priority - Priority for bulk email, default 1.unsubscribe_method - URL method for unsubscribe. Default is /api/method/frappe.email.bulk.unsubscribe.unsubscribe_params - additional params for unsubscribed links. default are name, doctype, emailattachments - Attachments to be sent.reply_to - Reply to be captured here (default inbox)message_id - Used for threading. If a reply is received to this email, Message-Id is sent back as In-Reply-To in received email.send_after - Send this email after the given datetime. If value is in integer, then send_after will be the automatically set to no of days from current date.Public API
+ /api/method/frappe.email.bulk.unsubscribe
+
+ + + frappe.email.bulk.unsubscribe + (doctype, name, email) +
+No docs
+Wrapper on the email module. Email object represents emails to be sent to the client.
+Also provides a clean way to add binary FileData attachments
+Also sets all messages as multipart/alternative for cleaner reading in text-only clients
+ + + __init__ + (self, sender=, recipients=(), subject=, alternative=0, reply_to=None, cc=()) +
+No docs
++ + + add_attachment + (self, fname, fcontent, content_type=None) +
+add attachment
++ + + add_pdf_attachment + (self, name, html, options=None) +
+No docs
++ + + as_string + (self) +
+validate, build message and convert to string
++ + + attach_file + (self, n) +
+attach a file from the FileData table
+ + + get_default_sender + (self) +
+No docs
++ + + make + (self) +
+build into msg_root
++ + + set_html + (self, message, text_content=None, footer=None, print_html=None, formatted=None) +
+Attach message in the html portion of multipart/alternative
++ + + set_html_as_text + (self, html) +
+return html2text
++ + + set_message + (self, message, mime_type=text/html, as_attachment=0, filename=attachment.html) +
+Append the message with MIME content to the root node (as attachment)
++ + + set_message_id + (self, message_id) +
+No docs
++ + + set_part_html + (self, message) +
+No docs
++ + + set_text + (self, message) +
+Attach message in the text portion of multipart/alternative
++ + + validate + (self) +
+validate the email ids
++ + + frappe.email.email_body.get_email + (recipients, sender=, msg=, subject=[No Subject], text_content=None, footer=None, print_html=None, formatted=None, attachments=None, content=None, reply_to=None, cc=()) +
+send an html email as multipart with attachments and all
++ + + frappe.email.email_body.get_footer + (email_account, footer=None) +
+append a footer (signature)
++ + + frappe.email.email_body.get_formatted_html + (subject, message, footer=None, print_html=None) +
+No docs
++ + + frappe.email.email_body.get_signature + (email_account) +
+No docs
+Public API
+ /api/method/frappe.email.get_contact_list
+
+ + + frappe.email.get_contact_list + () +
+Returns contacts (from autosuggest)
++ + + frappe.email.get_system_managers + () +
+No docs
++ + + frappe.email.sendmail + (recipients, sender=, msg=, subject=[No Subject], attachments=None, content=None, reply_to=None, cc=(), message_id=None) +
+send an html email as multipart with attachments and all
++ + + frappe.email.sendmail_md + (recipients, sender=None, msg=None, subject=None, attachments=None, content=None, reply_to=None, cc=(), message_id=None) +
+send markdown email
++ + + frappe.email.sendmail_to_system_managers + (subject, content) +
+No docs
+Wrapper for an email.
++ + + __init__ + (self, content) +
+Parses headers, content, attachments from given raw message.
+ +Parameters:
+ +content - Raw message.+ + + get_attachment + (self, part, charset) +
+No docs
++ + + get_charset + (self, part) +
+Detect chartset.
++ + + get_payload + (self, part, charset) +
+No docs
++ + + get_thread_id + (self) +
+Extract thread ID from []
+ + + parse + (self) +
+Walk and process multi-part email.
++ + + process_part + (self, part) +
+Parse email part and set it to text_content, html_content or attachments.
+ + + save_attachments_in_doc + (self, doc) +
+Save email attachments in given document.
++ + + set_content_and_type + (self) +
+No docs
++ + + set_subject + (self) +
+Parse and decode Subject header.
Inherits from frappe.exceptions.ValidationError + +
Inherits from frappe.exceptions.ValidationError + +
Inherits from frappe.exceptions.ValidationError + +
Wrapper for POP server to pull emails.
++ + + __init__ + (self, args=None) +
+No docs
++ + + check_mails + (self) +
+No docs
++ + + connect + (self) +
+Connect to Email Account.
++ + + get_messages + (self) +
+Returns new email messages in a list.
++ + + has_login_limit_exceeded + (self, e) +
+No docs
++ + + is_temporary_system_problem + (self, e) +
+No docs
++ + + make_error_msg + (self, msg_num, incoming_mail) +
+No docs
++ + + process_message + (self, mail) +
+No docs
++ + + retrieve_message + (self, pop_meta, msg_num) +
+No docs
++ + + setup + (self, args=None) +
+No docs
++ + + validate_pop + (self, pop_meta) +
+No docs
+Inherits from frappe.email.receive.TimerMixin, poplib.POP3 + +
+ + + __init__ + (self) +
+No docs
++ + + _getline + (self) +
+No docs
++ + + quit + (self) +
+No docs
+Inherits from frappe.email.receive.TimerMixin, poplib.POP3_SSL + +
+ + + __init__ + (self) +
+No docs
++ + + _getline + (self) +
+No docs
++ + + quit + (self) +
+No docs
+Inherits from __builtin__.object + +
+ + + __init__ + (self) +
+No docs
++ + + _getline + (self) +
+No docs
++ + + quit + (self) +
+No docs
+Inherits from frappe.exceptions.ValidationError + +
+ + + __init__ + (self, login=None, password=None, server=None, port=None, use_ssl=None, append_to=None) +
+No docs
++ + + setup_email_account + (self, append_to=None) +
+No docs
++ + + frappe.email.smtp._get_email_account + (filters) +
+No docs
++ + + frappe.email.smtp.get_default_outgoing_email_account + (raise_exception_not_set=True) +
+No docs
++ + + frappe.email.smtp.get_outgoing_email_account + (raise_exception_not_set=True, append_to=None) +
+Returns outgoing email account based on append_to or the default
+outgoing account. If default outgoing account is not found, it will
+try getting settings from site_config.json.
+ + + frappe.email.smtp.send + (email, append_to=None) +
+send the message or add it to Outbox Email
+globals attached to frappe module ++ some utility functions that should probably be moved
++ + + frappe.__init__._ + (msg, lang=None) +
+Returns translated string in current lang, if exists.
+Inherits from __builtin__.dict + +
dict like object that exposes keys as attributes
++ + + __getattr__ + (self, key) +
+No docs
++ + + __getstate__ + (self) +
+No docs
++ + + __setattr__ + (self, key, value) +
+No docs
++ + + __setstate__ + (self, d) +
+No docs
++ + + copy + (self) +
+No docs
++ + + update + (self, d) +
+update and return self -- the missing dict feature in python
++ + + frappe.__init__.add_version + (doc) +
+Insert a new Version of the given document. +A Version is a JSON dump of the current document state.
++ + + frappe.__init__.are_emails_muted + () +
+No docs
++ + + frappe.__init__.as_json + (obj, indent=1) +
+No docs
++ + + frappe.__init__.attach_print + (doctype, name, file_name=None, print_format=None, style=None, html=None) +
+No docs
++ + + frappe.__init__.build_match_conditions + (doctype, as_condition=True) +
+Return match (User permissions) for given doctype as list or SQL.
++ + + frappe.__init__.cache + () +
+Returns memcache connection.
++ + + frappe.__init__.call + (fn) +
+Call a function and match arguments.
++ + + frappe.__init__.clear_cache + (user=None, doctype=None) +
+Clear User, DocType or global cache.
+ +Parameters:
+ +user - If user is given, only user cache is cleared.doctype - If doctype is given, only DocType cache is cleared.+ + + frappe.__init__.compare + (val1, condition, val2) +
+Compare two values using frappe.utils.compare
condition could be:
+- "^"
+- "in"
+- "not in"
+- "="
+- "!="
+- ">"
+- "<"
+- ">="
+- "<="
+- "not None"
+- "None"
+ + + frappe.__init__.connect + (site=None, db_name=None) +
+Connect to site database instance.
+ +Parameters:
+ +site - If site is given, calls frappe.init.db_name - Optional. Will use from site_config.json.+ + + frappe.__init__.copy_doc + (doc, ignore_no_copy=True) +
+No_copy fields also get copied.
++ + + frappe.__init__.create_folder + (path, with_init=False) +
+Create a folder in the given path and add an __init__.py file (optional).
Parameters:
+ +path - Folder path.with_init - Create __init__.py in the new folder.+ + + frappe.__init__.delete_doc + (doctype=None, name=None, force=0, ignore_doctypes=None, for_reload=False, ignore_permissions=False, flags=None) +
+Delete a document. Calls frappe.model.delete_doc.delete_doc.
Parameters:
+ +doctype - DocType of document to be delete.name - Name of document to be delete.force - Allow even if document is linked. Warning: This may lead to data integrity errors.ignore_doctypes - Ignore if child table is one of these.for_reload - Call before_reload trigger before deleting.ignore_permissions - Ignore user permissions.+ + + frappe.__init__.delete_doc_if_exists + (doctype, name) +
+Delete document if exists.
++ + + frappe.__init__.destroy + () +
+Closes connection and releases werkzeug local.
++ + + frappe.__init__.errprint + (msg) +
+Log error. This is sent back as exc in response.
Parameters:
+ +msg - Message.+ + + frappe.__init__.format_value + (value, df, doc=None, currency=None) +
+Format value with given field properties.
+ +Parameters:
+ +value - Value to be formatted.df - DocField object with properties fieldtype, options etc.+ + + frappe.__init__.generate_hash + (txt=None, length=None) +
+Generates random hash for given text + current timestamp + random string.
++ + + frappe.__init__.get_all + (doctype) +
+List database query via frappe.model.db_query. Will not check for conditions.
+Parameters are same as frappe.get_list
Parameters:
+ +doctype - DocType on which query is to be made.fields - List of fields or *. Default is: ["name"].filters - List of filters (see example).order_by - Order By e.g. modified desc.limit_page_start - Start results at record #. Default 0.limit_poge_length - No of records in the page. Default 20.Example usage:
+ +# simple dict filter
+frappe.get_all("ToDo", fields=["name", "description"], filters = {"owner":"test@example.com"})
+
+# filter as a list of lists
+frappe.get_all("ToDo", fields=["*"], filters = [["modified", ">", "2014-01-01"]])
+
+# filter as a list of dicts
+frappe.get_all("ToDo", fields=["*"], filters = {"description": ("like", "test%")})
+
++ + + frappe.__init__.get_all_apps + (with_frappe=False, with_internal_apps=True, sites_path=None) +
+Get list of all apps via sites/apps.txt.
+ + + frappe.__init__.get_app_path + (app_name) +
+Return path of given app.
+ +Parameters:
+ +app - App name.*joins - Join additional path elements using os.path.join.+ + + frappe.__init__.get_attr + (method_string) +
+Get python method object from its name.
++ + + frappe.__init__.get_doc + (arg1, arg2=None) +
+Return a frappe.model.document.Document object of the given type and name.
Parameters:
+ +arg1 - DocType name as string or document JSON.arg2 - [optional] Document name as string.Examples:
+ +# insert a new document
+todo = frappe.get_doc({"doctype":"ToDo", "description": "test"})
+tood.insert()
+
+# open an existing document
+todo = frappe.get_doc("ToDo", "TD0001")
+
++ + + frappe.__init__.get_file_items + (path, raise_not_found=False, ignore_empty_lines=True) +
+Returns items from text file as a list. Ignores empty lines.
++ + + frappe.__init__.get_file_json + (path) +
+Read a file and return parsed JSON object.
++ + + frappe.__init__.get_hooks + (hook=None, default=None, app_name=None) +
+Get hooks via app/hooks.py
Parameters:
+ +hook - Name of the hook. Will gather all hooks for this name and return as a list.default - Default if no hook found.app_name - Filter by app.+ + + frappe.__init__.get_installed_apps + (sort=False) +
+Get list of installed apps in current site.
++ + + frappe.__init__.get_lang_dict + (fortype, name=None) +
+Returns the translated language dict for the given type and name.
+ +Parameters:
+ +fortype - must be one of doctype, page, report, include, jsfile, bootname - name of the document for which assets are to be returned.+ + + frappe.__init__.get_last_doc + (doctype) +
+Get last created document of this type.
++ + + frappe.__init__.get_list + (doctype) +
+List database query via frappe.model.db_query. Will also check for permissions.
Parameters:
+ +doctype - DocType on which query is to be made.fields - List of fields or *.filters - List of filters (see example).order_by - Order By e.g. modified desc.limit_page_start - Start results at record #. Default 0.limit_poge_length - No of records in the page. Default 20.Example usage:
+ +# simple dict filter
+frappe.get_list("ToDo", fields=["name", "description"], filters = {"owner":"test@example.com"})
+
+# filter as a list of lists
+frappe.get_list("ToDo", fields="*", filters = [["modified", ">", "2014-01-01"]])
+
+# filter as a list of dicts
+frappe.get_list("ToDo", fields="*", filters = {"description": ("like", "test%")})
+
++ + + frappe.__init__.get_logger + (module=None) +
+No docs
++ + + frappe.__init__.get_meta + (doctype, cached=True) +
+Get frappe.model.meta.Meta instance of given doctype name.
+ + + frappe.__init__.get_meta_module + (doctype) +
+No docs
++ + + frappe.__init__.get_module + (modulename) +
+Returns a module object for given Python module name using importlib.import_module.
+ + + frappe.__init__.get_module_list + (app_name) +
+Get list of modules for given all via app/modules.txt.
+ + + frappe.__init__.get_module_path + (module) +
+Get the path of the given module name.
+ +Parameters:
+ +module - Module name.*joins - Join additional path elements using os.path.join.+ + + frappe.__init__.get_precision + (doctype, fieldname, currency=None, doc=None) +
+Get precision for a given field
++ + + frappe.__init__.get_print + (doctype, name, print_format=None, style=None, html=None, as_pdf=False) +
+Get Print Format for given document.
+ +Parameters:
+ +doctype - DocType of document.name - Name of document.print_format - Print Format name. Default 'Standard',style - Print Format style.as_pdf - Return as PDF. Default False.+ + + frappe.__init__.get_pymodule_path + (modulename) +
+Return path of given Python module name.
+ +Parameters:
+ +modulename - Python module name.*joins - Join additional path elements using os.path.join.+ + + frappe.__init__.get_request_header + (key, default=None) +
+Return HTTP request header.
+ +Parameters:
+ +key - HTTP header key.default - Default value.+ + + frappe.__init__.get_roles + (username=None) +
+Returns roles of current user.
++ + + frappe.__init__.get_single + (doctype) +
+Return a frappe.model.document.Document object of the given Single doctype.
+ + + frappe.__init__.get_site_config + (sites_path=None, site_path=None) +
+Returns site_config.json combined with sites/common_site_config.json.
+site_config is a set of site wide settings like database name, password, email etc.
+ + + frappe.__init__.get_site_path + () +
+Return path of current site.
+ +Parameters:
+ +*joins - Join additional path elements using os.path.join.+ + + frappe.__init__.get_test_records + (doctype) +
+Returns list of objects from test_records.json in the given doctype's folder.
+ + + frappe.__init__.get_traceback + () +
+Returns error traceback.
++ + + frappe.__init__.get_user + () +
+No docs
++ + + frappe.__init__.get_value + () +
+Returns a document property or list of properties.
+ +Alias for frappe.db.get_value
Parameters:
+ +doctype - DocType name.filters - Filters like {"x":"y"} or name of the document. None if Single DocType.fieldname - Column name.ignore - Don't raise exception if table, column is missing.as_dict - Return values as dict.debug - Print query in error log.+ + + frappe.__init__.has_permission + (doctype, ptype=read, doc=None, user=None, verbose=False) +
+Raises frappe.PermissionError if not permitted.
Parameters:
+ +doctype - DocType for which permission is to be check.ptype - Permission type (read, write, create, submit, cancel, amend). Default: read.doc - [optional] Checks User permissions for given doc.user - [optional] Check for given user. Default: current user.+ + + frappe.__init__.has_website_permission + (doctype, ptype=read, doc=None, user=None, verbose=False) +
+Raises frappe.PermissionError if not permitted.
Parameters:
+ +doctype - DocType for which permission is to be check.ptype - Permission type (read, write, create, submit, cancel, amend). Default: read.doc - Checks User permissions for given doc.user - [optional] Check for given user. Default: current user.+ + + frappe.__init__.import_doc + (path, ignore_links=False, ignore_insert=False, insert=False) +
+Import a file using Data Import Tool.
++ + + frappe.__init__.init + (site, sites_path=None) +
+Initialize frappe for the current site. Reset thread locals frappe.local
+ + + frappe.__init__.is_table + (doctype) +
+Returns True if istable property (indicating child Table) is set for given DocType.
+ + + frappe.__init__.local_cache + (namespace, key, generator, regenerate_if_none=False) +
+A key value store for caching within a request
+ +Parameters:
+ +namespace - frappe.local.cache[namespace]key - frappe.local.cache[namespace][key] used to retrieve valuegenerator - method to generate a value if not found in store+ + + frappe.__init__.log + (msg) +
+Add to debug_log.
Parameters:
+ +msg - Message.+ + + frappe.__init__.make_property_setter + (args, ignore_validate=False, validate_fields_for_doctype=True) +
+Create a new Property Setter (for overriding DocType and DocField properties).
++ + + frappe.__init__.msgprint + (msg, small=0, raise_exception=0, as_table=False) +
+Print a message to the user (via HTTP response).
+Messages are sent in the __server_messages property in the
+response JSON and shown in a pop-up / modal.
Parameters:
+ +msg - Message.small - [optional] Show as a floating message in the footer.raise_exception - [optional] Raise given exception and show message.as_table - [optional] If msg is a list of lists, render as HTML table.+ + + frappe.__init__.new_doc + (doctype, parent_doc=None, parentfield=None, as_dict=False) +
+Returns a new document of the given DocType with defaults set.
+ +Parameters:
+ +doctype - DocType of the new document.parent_doc - [optional] add to parent document.parentfield - [optional] add against this parentfield.+ + + frappe.__init__.only_for + (roles) +
+Raise frappe.PermissionError if the user does not have any of the given Roles.
Parameters:
+ +roles - List of roles to check.+ + + frappe.__init__.publish_realtime + () +
+Publish real-time updates
+ +Parameters:
+ +event - Event name, like task_progress etc.message - JSON message object. For async must contain task_idroom - Room in which to publish update (default entire site)user - Transmit to userdoctype - Transmit to doctype, docnamedocname - Transmit to doctype, docname+ + + frappe.__init__.read_file + (path, raise_not_found=False) +
+Open a file and return its content as Unicode.
++ + + frappe.__init__.reload_doc + (module, dt=None, dn=None, force=False) +
+Reload Document from model ([module]/[doctype]/[name]/[name].json) files.
Parameters:
+ +module - Module name.dt - DocType name.dn - Document name.force - Reload even if modified timestamp matches.+ + + frappe.__init__.reload_doctype + (doctype, force=False) +
+Reload DocType from model ([module]/[doctype]/[name]/[name].json) files.
+ + + frappe.__init__.rename_doc + (doctype, old, new, debug=0, force=False, merge=False, ignore_permissions=False) +
+Rename a document. Calls frappe.model.rename_doc.rename_doc
+ + + frappe.__init__.reset_metadata_version + () +
+Reset metadata_version (Client (Javascript) build ID) hash.
+ + + frappe.__init__.respond_as_web_page + (title, html, success=None, http_status_code=None) +
+Send response as a web page with a message rather than JSON. Used to show permission errors etc.
+ +Parameters:
+ +title - Page title and heading.message - Message to be shown.success - Alert message.http_status_code - HTTP status code.+ + + frappe.__init__.scrub + (txt) +
+Returns sluggified string. e.g. Sales Order becomes sales_order.
+ + + frappe.__init__.sendmail + (recipients=(), sender=, subject=No Subject, message=No Message, as_markdown=False, bulk=False, reference_doctype=None, reference_name=None, unsubscribe_method=None, unsubscribe_params=None, unsubscribe_message=None, attachments=None, content=None, doctype=None, name=None, reply_to=None, cc=(), show_as_cc=(), message_id=None, as_bulk=False, send_after=None, expose_recipients=False, bulk_priority=1) +
+Send email using user's default Email Account or global default Email Account.
+ +Parameters:
+ +recipients - List of recipients.sender - Email sender. Default is current user.subject - Email Subject.message - (or content) Email Content.as_markdown - Convert content markdown to HTML.bulk - Send via scheduled email sender Bulk Email. Don't send immediately.bulk_priority - Priority for bulk email, default 1.reference_doctype - (or doctype) Append as communication to this DocType.reference_name - (or name) Append as communication to this document name.unsubscribe_method - Unsubscribe url with options email, doctype, name. e.g. /api/method/unsubscribeunsubscribe_params - Unsubscribe paramaters to be loaded on the unsubscribe_method [optional] (dict).attachments - List of attachments.reply_to - Reply-To email id.message_id - Used for threading. If a reply is received to this email, Message-Id is sent back as In-Reply-To in received email.send_after - Send after the given datetime.expose_recipients - Display all recipients in the footer message - "This email was sent to"+ + + frappe.__init__.set_user + (username) +
+Set current user.
+ +Parameters:
+ +username - User name to set as current user.+ + + frappe.__init__.set_user_lang + (user, user_language=None) +
+Guess and set user language for the session. frappe.local.lang
+ + + frappe.__init__.set_value + (doctype, docname, fieldname, value) +
+Set document value. Calls frappe.client.set_value
+ + + frappe.__init__.setup_module_map + () +
+Rebuild map of all modules (internal).
+
+
+
+ frappe.__init__.throw
+ (msg, exc=
Throw execption and show message (msgprint).
Parameters:
+ +msg - Message.exc - Exception class. Default frappe.ValidationError+ + + frappe.__init__.unscrub + (txt) +
+Returns titlified string. e.g. sales_order becomes Sales Order.
+ + + frappe.__init__.whitelist + (allow_guest=False, xss_safe=False) +
+Decorator for whitelisting a function and making it accessible via HTTP.
+Standard request will be /api/method/[path.to.method]
Parameters:
+ +allow_guest - Allow non logged-in user to access this method.Use as:
+ +@frappe.whitelist()
+def myfunc(param1, param2):
+ pass
+
++ + + frappe.api.handle + () +
+Handler for /api methods
/api/method/{methodname} will call a whitelisted method
/api/resource/{doctype} will query a table
+ examples:
+ - ?fields=["name", "owner"]
+ - ?filters=[["Task", "name", "like", "%005"]]
+ - ?limit_start=0
+ - ?limit_page_length=20
/api/resource/{doctype}/{name} will point to a resource
+ GET will return doclist
+ POST will insert
+ PUT will update
+ DELETE will delete
/api/resource/{doctype}/{name}?run_method={method} will run a whitelisted controller method
Inherits from __builtin__.object + +
+ + + __enter__ + (self) +
+No docs
++ + + __exit__ + (self, type, value, traceback) +
+No docs
++ + + __init__ + (self, environ) +
+No docs
++ + + frappe.app.init_site + (request) +
+No docs
++ + + frappe.app.make_form_dict + (request) +
+No docs
++ + + frappe.app.serve + (port=8000, profile=False, site=None, sites_path=.) +
+No docs
+Inherits from __builtin__.file + +
+ + + __init__ + (self) +
+No docs
++ + + write + (self, data) +
+No docs
+Public API
+ /api/method/frappe.async.can_subscribe_doc
+
+ + + frappe.async.can_subscribe_doc + (doctype, docname, sid) +
+No docs
++ + + frappe.async.emit_via_redis + (event, message, room) +
+Publish real-time updates via redis
+ +Parameters:
+ +event - Event name, like task_progress etc.message - JSON message object. For async must contain task_idroom - name of the room+ + + frappe.async.get_doc_room + (doctype, docname) +
+No docs
+Public API
+ /api/method/frappe.async.get_pending_tasks_for_doc
+
+ + + frappe.async.get_pending_tasks_for_doc + (doctype, docname) +
+No docs
++ + + frappe.async.get_redis_server + () +
+Returns memcache connection.
++ + + frappe.async.get_site_room + () +
+No docs
++ + + frappe.async.get_std_streams + (task_id) +
+No docs
++ + + frappe.async.get_task_log_file_path + (task_id, stream_type) +
+No docs
++ + + frappe.async.get_task_progress_room + () +
+No docs
+Public API
+ /api/method/frappe.async.get_task_status
+
+ + + frappe.async.get_task_status + (task_id) +
+No docs
+Public API
+ /api/method/frappe.async.get_user_info
+
+ + + frappe.async.get_user_info + (sid) +
+No docs
++ + + frappe.async.get_user_room + (user) +
+No docs
++ + + frappe.async.handler + (f) +
+No docs
++ + + frappe.async.is_file_old + (file_path) +
+No docs
+Public API
+ /api/method/frappe.async.ping
+
+ + + frappe.async.ping + () +
+No docs
++ + + frappe.async.publish_realtime + (event=None, message=None, room=None, user=None, doctype=None, docname=None, now=False) +
+Publish real-time updates
+ +Parameters:
+ +event - Event name, like task_progress etc. that will be handled by the client (default is task_progress if within task or global)message - JSON message object. For async must contain task_idroom - Room in which to publish update (default entire site)user - Transmit to userdoctype - Transmit to doctype, docnamedocname - Transmit to doctype, docname+ + + frappe.async.put_log + (line_no, line, task_id=None) +
+No docs
++ + + frappe.async.remove_old_task_logs + () +
+No docs
++ + + frappe.async.set_task_status + (task_id, status, response=None) +
+No docs
++ + + __init__ + (self) +
+No docs
++ + + delete_cookie + (self, to_delete) +
+No docs
++ + + flush_cookies + (self, response) +
+No docs
++ + + init_cookies + (self) +
+No docs
++ + + set_cookie + (self, key, value, expires=None) +
+No docs
++ + + __init__ + (self) +
+No docs
++ + + connect + (self, ac_name=None) +
+connect to db, from acname or dbname
++ + + get_db_name + (self) +
+get database name from conf
++ + + set_lang + (self) +
+No docs
++ + + validate_csrf_token + (self) +
+No docs
++ + + __init__ + (self) +
+No docs
++ + + authenticate + (self, user=None, pwd=None) +
+No docs
++ + + check_if_enabled + (self, user) +
+raise exception if user not enabled
++ + + check_password + (self, user, pwd) +
+check password
++ + + clear_active_sessions + (self) +
+No docs
++ + + clear_cookies + (self) +
+No docs
++ + + fail + (self, message) +
+No docs
++ + + login + (self) +
+No docs
++ + + login_as + (self, user) +
+No docs
++ + + login_as_guest + (self) +
+login as guest
++ + + logout + (self, arg=, user=None) +
+No docs
++ + + make_session + (self, resume=False) +
+No docs
++ + + post_login + (self) +
+No docs
++ + + run_trigger + (self, event=on_login) +
+No docs
++ + + set_user_info + (self, resume=False) +
+No docs
++ + + validate_hour + (self) +
+check if user is logging in during restricted hours
++ + + validate_ip_address + (self) +
+check if IP Address is valid
++ + + frappe.auth._update_password + (user, password) +
+No docs
++ + + frappe.auth.clear_cookies + () +
+No docs
+Public API
+ /api/method/frappe.auth.get_logged_user
+
+ + + frappe.auth.get_logged_user + () +
+No docs
++ + + frappe.boot.add_home_page + (bootinfo, docs) +
+load home page
++ + + frappe.boot.add_timezone_info + (bootinfo) +
+No docs
++ + + frappe.boot.get_allowed_pages + () +
+No docs
++ + + frappe.boot.get_bootinfo + () +
+build and return boot info
++ + + frappe.boot.get_fullnames + () +
+map of user fullnames
++ + + frappe.boot.get_user + (bootinfo) +
+get user info
++ + + frappe.boot.load_conf_settings + (bootinfo) +
+No docs
++ + + frappe.boot.load_print + (bootinfo, doclist) +
+No docs
++ + + frappe.boot.load_print_css + (bootinfo, print_settings) +
+No docs
++ + + frappe.boot.load_translations + (bootinfo) +
+No docs
++ + + frappe.build.build + (no_compress=False, verbose=False) +
+No docs
++ + + frappe.build.bundle + (no_compress, make_copy=False, verbose=False) +
+concat / minify js files
++ + + frappe.build.compile_less + () +
+No docs
++ + + frappe.build.files_dirty + () +
+No docs
++ + + frappe.build.get_build_maps + () +
+get all build.jsons with absolute paths
++ + + frappe.build.html_to_js_template + (path, content) +
+No docs
++ + + frappe.build.make_asset_dirs + (make_copy=False) +
+No docs
++ + + frappe.build.pack + (target, sources, no_compress, verbose) +
+No docs
++ + + frappe.build.setup + () +
+No docs
++ + + frappe.build.watch + (no_compress) +
+watch and rebuild if necessary
+Inherits from __builtin__.object + +
Inherits from __builtin__.object + +
Thread manager for monitoring celery events
++ + + __init__ + (self, celery_app, interval=1) +
+No docs
++ + + catchall + (self, event) +
+No docs
++ + + run + (self) +
+No docs
+Inherits from __builtin__.object + +
+ + + frappe.celery_app.celery_task + () +
+No docs
++ + + frappe.celery_app.get_beat_schedule + (conf) +
+No docs
++ + + frappe.celery_app.get_celery + () +
+No docs
++ + + frappe.celery_app.get_celery_app + () +
+No docs
++ + + frappe.celery_app.get_queue + (site, prefix=None) +
+No docs
++ + + frappe.celery_app.get_site_config + () +
+No docs
++ + + frappe.celery_app.make_async_task + (args) +
+No docs
++ + + frappe.celery_app.run_test + () +
+No docs
+Public API
+ /api/method/frappe.client.bulk_update
+
+ + + frappe.client.bulk_update + (docs) +
+No docs
+Public API
+ /api/method/frappe.client.cancel
+
+ + + frappe.client.cancel + (doctype, name) +
+No docs
+Public API
+ /api/method/frappe.client.delete
+
+ + + frappe.client.delete + (doctype, name) +
+No docs
+Public API
+ /api/method/frappe.client.get
+
+ + + frappe.client.get + (doctype, name=None, filters=None) +
+No docs
+Public API
+ /api/method/frappe.client.get_js
+
+ + + frappe.client.get_js + (src) +
+No docs
+Public API
+ /api/method/frappe.client.get_list
+
+ + + frappe.client.get_list + (doctype, fields=None, filters=None, order_by=None, limit_start=None, limit_page_length=20) +
+No docs
+Public API
+ /api/method/frappe.client.get_value
+
+ + + frappe.client.get_value + (doctype, fieldname, filters=None, as_dict=True, debug=False) +
+No docs
+Public API
+ /api/method/frappe.client.has_permission
+
+ + + frappe.client.has_permission + (doctype, docname, perm_type=read) +
+No docs
+Public API
+ /api/method/frappe.client.insert
+
+ + + frappe.client.insert + (doc=None) +
+No docs
+Public API
+ /api/method/frappe.client.make_width_property_setter
+
+ + + frappe.client.make_width_property_setter + (doc) +
+No docs
+Public API
+ /api/method/frappe.client.rename_doc
+
+ + + frappe.client.rename_doc + (doctype, old_name, new_name, merge=False) +
+No docs
+Public API
+ /api/method/frappe.client.save
+
+ + + frappe.client.save + (doc) +
+No docs
+Public API
+ /api/method/frappe.client.set_default
+
+ + + frappe.client.set_default + (key, value, parent=None) +
+set a user default value
+Public API
+ /api/method/frappe.client.set_value
+
+ + + frappe.client.set_value + (doctype, name, fieldname, value) +
+No docs
+Public API
+ /api/method/frappe.client.submit
+
+ + + frappe.client.submit + (doc) +
+No docs
++ + + frappe.commands._is_scheduler_enabled + () +
+No docs
++ + + frappe.commands._new_site + (db_name, site, mariadb_root_username=None, mariadb_root_password=None, admin_password=None, verbose=False, install_apps=None, source_sql=None, force=False, reinstall=False) +
+Install a new Frappe site
++ + + frappe.commands.call_command + (cmd, context) +
+No docs
++ + + frappe.commands.get_single_site + (context) +
+No docs
++ + + frappe.commands.move + (dest_dir, site) +
+No docs
++ + + frappe.commands.pass_context + (f) +
+No docs
++ + + frappe.commands.prepare_for_update + () +
+No docs
++ + + frappe.commands.use + (site, sites_path=.) +
+No docs
+Open a database connection with the given parmeters, if use_default is True, use the
+login details from conf.py. This is called by the request handler and is accessible using
+the db global variable. the sql method is also global to run queries
+ + + __init__ + (self, host=None, user=None, password=None, ac_name=None, use_default=0) +
+No docs
++ + + _get_value_for_many_names + (self, doctype, names, field, debug=False) +
+No docs
++ + + _get_values_from_table + (self, fields, filters, doctype, as_dict, debug, order_by=None, update=None) +
+No docs
++ + + a_row_exists + (self, doctype) +
+Returns True if atleast one row exists.
++ + + add_default + (self, key, val, parent=__default, parenttype=None) +
+Append a default value for a key, there can be multiple default values for a particular key.
++ + + add_index + (self, doctype, fields, index_name=None) +
+Creates an index with given fields if not already created.
+Index name will be fieldname1_fieldname2_index
+ + + add_unique + (self, doctype, fields, constraint_name=None) +
+No docs
++ + + begin + (self) +
+No docs
++ + + build_conditions + (self, filters) +
+Convert filters sent as dict, lists to SQL conditions. filter's key +is passed by map function, build conditions like:
+ +fieldname, default_value) = %(fieldname)sfieldname [=, !=, >, >=, <, <=] %(fieldname)s+ + + check_transaction_status + (self, query) +
+Raises exception if more than 20,000 INSERT, UPDATE queries are
+executed in one transaction. This is to ensure that writes are always flushed otherwise this
+could cause the system to hang.
+ + + close + (self) +
+Close database connection.
++ + + commit + (self) +
+Commit current transaction. Calls SQL COMMIT.
+ + + connect + (self) +
+Connects to a database as set in site_config.json.
+ + + convert_to_lists + (self, res, formatted=0, as_utf8=0) +
+Convert tuple output to lists (internal).
++ + + convert_to_simple_type + (self, v, formatted=0) +
+Format date, time, longint values.
++ + + convert_to_utf8 + (self, res, formatted=0) +
+Encode result as UTF-8.
++ + + count + (self, dt, filters=None, debug=False) +
+Returns COUNT(*) for given DocType and filters.
+ + + escape + (self, s) +
+Excape quotes and percent in given string.
++ + + exists + (self, dt, dn=None) +
+Returns true if document exists.
+ +Parameters:
+ +dt - DocType name.dn - Document name or filter dict.+ + + explain_query + (self, query, values=None) +
+Print EXPLAIN in error log.
+ + + fetch_as_dict + (self, formatted=0, as_utf8=0) +
+Internal. Converts results to dict.
++ + + field_exists + (self, dt, fn) +
+Return true of field exists.
++ + + get + (self, doctype, filters=None, as_dict=True, cache=False) +
+Returns get_value with fieldname='*'
+ + + get_all + (self) +
+No docs
++ + + get_creation_count + (self, doctype, minutes) +
+Get count of records created in the last x minutes
++ + + get_db_login + (self, ac_name) +
+No docs
++ + + get_default + (self, key, parent=__default) +
+Returns default value as a list if multiple or single
++ + + get_defaults + (self, key=None, parent=__default) +
+Get all defaults
++ + + get_defaults_as_list + (self, key, parent=__default) +
+Returns default values as a list.
++ + + get_description + (self) +
+Returns result metadata.
++ + + get_global + (self, key, user=__global) +
+Returns a global key value.
++ + + get_list + (self) +
+No docs
++ + + get_single_value + (self, doctype, fieldname, cache=False) +
+Get property of Single DocType. Cache locally by default
++ + + get_singles_dict + (self, doctype) +
+Get Single DocType as dict.
++ + + get_singles_value + (self) +
+Alias for getsinglevalue
++ + + get_table_columns + (self, doctype) +
+Returns list of column names from given doctype.
++ + + get_tables + (self) +
+No docs
++ + + get_temp + (self, key) +
+Return the temperory value and delete it.
++ + + get_value + (self, doctype, filters=None, fieldname=name, ignore=None, as_dict=False, debug=False, cache=False) +
+Returns a document property or list of properties.
+ +Parameters:
+ +doctype - DocType name.filters - Filters like {"x":"y"} or name of the document. None if Single DocType.fieldname - Column name.ignore - Don't raise exception if table, column is missing.as_dict - Return values as dict.debug - Print query in error log.Example:
+ +# return first customer starting with a
+frappe.db.get_value("Customer", {"name": ("like a%")})
+
+# return last login of **User** `test@example.com`
+frappe.db.get_value("User", "test@example.com", "last_login")
+
+last_login, last_ip = frappe.db.get_value("User", "test@example.com",
+ ["last_login", "last_ip"])
+
+# returns default date_format
+frappe.db.get_value("System Settings", None, "date_format")
+
++ + + get_values + (self, doctype, filters=None, fieldname=name, ignore=None, as_dict=False, debug=False, order_by=None, update=None, cache=False) +
+Returns multiple document properties.
+ +Parameters:
+ +doctype - DocType name.filters - Filters like {"x":"y"} or name of the document.fieldname - Column name.ignore - Don't raise exception if table, column is missing.as_dict - Return values as dict.debug - Print query in error log.Example:
+ +# return first customer starting with a
+customers = frappe.db.get_values("Customer", {"name": ("like a%")})
+
+# return last login of **User** `test@example.com`
+user = frappe.db.get_values("User", "test@example.com", "*")[0]
+
++ + + get_values_from_single + (self, fields, filters, doctype, as_dict=False, debug=False, update=None) +
+Get values from tabSingles (Single DocTypes) (internal).
Parameters:
+ +fields - List of fields,filters - Filters (dict).doctype - DocType name.+ + + has_column + (self, doctype, column) +
+Returns True if column exists in database.
++ + + needs_formatting + (self, result, formatted) +
+Returns true if the first row in the result has a Date, Datetime, Long Int.
++ + + rollback + (self) +
+ROLLBACK current transaction.
+ + + set + (self, doc, field, val) +
+Set value in document. Avoid
++ + + set_default + (self, key, val, parent=__default, parenttype=None) +
+Sets a global / user default value.
++ + + set_global + (self, key, val, user=__global) +
+Save a global key value. Global values will be automatically set if they match fieldname.
++ + + set_temp + (self, value) +
+Set a temperory value and return a key.
++ + + set_value + (self, dt, dn, field, val, modified=None, modified_by=None, update_modified=True, debug=False) +
+Set a single value in the database, do not call the ORM triggers +but update the modified timestamp (unless specified not to).
+ +Warning: this function will not call Document events and should be avoided in normal cases.
+ +Parameters:
+ +dt - DocType name.dn - Document name.field - Property / field name.value - Value to be updated.modified - Use this as the modified timestamp.modified_by - Set this user as modified_by.update_modified - default True. Set as false, if you don't want to update the timestamp.debug - Print the query in the developer / js console.+ + + sql + (self, query, values=(), as_dict=0, as_list=0, formatted=0, debug=0, ignore_ddl=0, as_utf8=0, auto_commit=0, update=None) +
+Execute a SQL query and fetch all rows.
+ +Parameters:
+ +query - SQL query.values - List / dict of values to be escaped and substituted in the query.as_dict - Return as a dictionary.as_list - Always return as a list.formatted - Format values like date etc.debug - Print query and EXPLAIN in debug log.ignore_ddl - Catch exception if table, column missing.as_utf8 - Encode values as UTF 8.auto_commit - Commit after executing the query.update - Update this dict to all rows (if returned as_dict).Examples:
+ +# return customer names as dicts
+frappe.db.sql("select name from tabCustomer", as_dict=True)
+
+# return names beginning with a
+frappe.db.sql("select name from tabCustomer where name like %s", "a%")
+
+# values as dict
+frappe.db.sql("select name from tabCustomer where name like %(name)s and owner=%(owner)s",
+ {"name": "a%", "owner":"test@example.com"})
+
++ + + sql_ddl + (self, query, values=(), debug=False) +
+Commit and execute a query. DDL (Data Definition Language) queries that alter schema +autocommit in MariaDB.
++ + + sql_list + (self, query, values=(), debug=False) +
+Return data as list of single elements (first column).
+ +Example:
+ +# doctypes = ["DocType", "DocField", "User", ...]
+doctypes = frappe.db.sql_list("select name from DocType")
+
++ + + table_exists + (self, tablename) +
+Returns True if table exists.
++ + + touch + (self, doctype, docname) +
+Update the modified timestamp of this document.
++ + + update + (self) +
+Update multiple values. Alias for set_value.
+ + + use + (self, db_name) +
+USE db_name.
+ + + validate_query + (self, q) +
+Throw exception for dangerous queries: ALTER, DROP, TRUNCATE if not Administrator.
+ + + frappe.defaults._clear_cache + (parent) +
+No docs
++ + + frappe.defaults.add_default + (key, value, parent, parenttype=None) +
+No docs
++ + + frappe.defaults.add_global_default + (key, value) +
+No docs
++ + + frappe.defaults.add_user_default + (key, value, user=None, parenttype=None) +
+No docs
++ + + frappe.defaults.build_user_permissions + (user) +
+No docs
++ + + frappe.defaults.clear_cache + (user=None) +
+No docs
++ + + frappe.defaults.clear_default + (key=None, value=None, parent=None, name=None, parenttype=None) +
+Clear a default value by any of the given parameters and delete caches.
+ +Parameters:
+ +key - Default key.value - Default value.parent - User name, or __global, __default.name - Default ID.parenttype - Clear defaults table for a particular type e.g. User.+ + + frappe.defaults.clear_user_default + (key, user=None) +
+No docs
++ + + frappe.defaults.get_defaults + (user=None) +
+No docs
++ + + frappe.defaults.get_defaults_for + (parent=__default) +
+get all defaults
++ + + frappe.defaults.get_global_default + (key) +
+No docs
++ + + frappe.defaults.get_user_default + (key, user=None) +
+No docs
++ + + frappe.defaults.get_user_default_as_list + (key, user=None) +
+No docs
++ + + frappe.defaults.get_user_permissions + (user=None) +
+No docs
++ + + frappe.defaults.set_default + (key, value, parent, parenttype=__default) +
+Override or add a default value.
+Adds default value in table tabDefaultValue.
Parameters:
+ +key - Default key.value - Default value.parent - Usually, User to whom the default belongs.parenttype - [optional] default is __default.+ + + frappe.defaults.set_global_default + (key, value) +
+No docs
++ + + frappe.defaults.set_user_default + (key, value, user=None, parenttype=None) +
+No docs
+Inherits from exceptions.Exception + +
Inherits from exceptions.Exception + +
Inherits from frappe.exceptions.LinkValidationError + +
Inherits from frappe.exceptions.ValidationError + +
Inherits from frappe.exceptions.ValidationError + +
Inherits from frappe.exceptions.ValidationError + +
Inherits from frappe.exceptions.ValidationError + +
Inherits from frappe.exceptions.ValidationError + +
Inherits from frappe.exceptions.NameError + +
Inherits from frappe.exceptions.ValidationError + +
Inherits from frappe.exceptions.ValidationError + +
Inherits from frappe.exceptions.ValidationError + +
Inherits from frappe.exceptions.ValidationError + +
Inherits from frappe.exceptions.ValidationError + +
Inherits from frappe.exceptions.ValidationError + +
Inherits from frappe.exceptions.ValidationError + +
Inherits from frappe.exceptions.ValidationError + +
Inherits from exceptions.Exception + +
Inherits from exceptions.Exception + +
Inherits from exceptions.Exception + +
Inherits from frappe.exceptions.ValidationError + +
Inherits from exceptions.Exception + +
Inherits from exceptions.Exception + +
Inherits from frappe.exceptions.ValidationError + +
Inherits from frappe.exceptions.ValidationError + +
Inherits from frappe.exceptions.ValidationError + +
Inherits from exceptions.Exception + +
Inherits from exceptions.Exception + +
Inherits from frappe.exceptions.ValidationError + +
Inherits from exceptions.Exception + +
Inherits from exceptions.Exception + +
Inherits from __builtin__.object + +
+ + + __enter__ + (self) +
+No docs
++ + + __exit__ + (self) +
+No docs
++ + + __init__ + (self, url, username, password, verify=True) +
+No docs
++ + + bulk_update + (self, docs) +
+No docs
++ + + cancel + (self, doctype, name) +
+No docs
++ + + delete + (self, doctype, name) +
+No docs
++ + + get_api + (self, method, params={}) +
+No docs
++ + + get_doc + (self, doctype, name=, filters=None, fields=None) +
+No docs
++ + + get_list + (self, doctype, fields="*", filters=None, limit_start=0, limit_page_length=0) +
+Returns list of records of a particular type
++ + + get_request + (self, params) +
+No docs
++ + + get_value + (self, doctype, fieldname=None, filters=None) +
+No docs
++ + + insert + (self, doc) +
+No docs
++ + + login + (self, username, password) +
+No docs
++ + + logout + (self) +
+No docs
++ + + migrate_doctype + (self, doctype, filters=None, update=None, verbose=1, exclude=None, preprocess=None) +
+Migrate records from another doctype
++ + + migrate_single + (self, doctype) +
+No docs
++ + + post_api + (self, method, params={}) +
+No docs
++ + + post_process + (self, response) +
+No docs
++ + + post_request + (self, data) +
+No docs
++ + + preprocess + (self, params) +
+convert dicts, lists to json
++ + + rename_doc + (self, doctype, old_name, new_name) +
+No docs
++ + + set_value + (self, doctype, docname, fieldname, value) +
+No docs
++ + + submit + (self, doclist) +
+No docs
++ + + update + (self, doc) +
+No docs
+Inherits from exceptions.Exception + +
Public API
+ /api/method/frappe.handler.async_ping
+
+ + + frappe.handler.async_ping + () +
+No docs
++ + + frappe.handler.execute_cmd + (cmd, from_async=False) +
+execute a request as python module
+Public API
+ /api/method/frappe.handler.get_async_task_status
+
+ + + frappe.handler.get_async_task_status + (task_id) +
+No docs
++ + + frappe.handler.get_attr + (cmd) +
+get method object from cmd
++ + + frappe.handler.handle + () +
+handle request
+Public API
+ /api/method/frappe.handler.logout
+
+ + + frappe.handler.logout + () +
+No docs
+Public API
+ /api/method/frappe.handler.ping
+
+ + + frappe.handler.ping + () +
+No docs
+Public API
+ /api/method/frappe.handler.run_custom_method
+
+ + + frappe.handler.run_custom_method + (doctype, name, custom_method) +
+cmd=runcustommethod&doctype={doctype}&name={name}&custommethod={custommethod}
+Public API
+ /api/method/frappe.handler.runserverobj
+
+ + + frappe.handler.runserverobj + (method, docs=None, dt=None, dn=None, arg=None, args=None) +
+No docs
+Public API
+ /api/method/frappe.handler.uploadfile
+
+ + + frappe.handler.uploadfile + () +
+No docs
+Public API
+ /api/method/frappe.handler.version
+
+ + + frappe.handler.version + () +
+No docs
+Public API
+ /api/method/frappe.handler.web_logout
+
+ + + frappe.handler.web_logout + () +
+No docs
++ + + frappe.installer.add_module_defs + (app) +
+No docs
++ + + frappe.installer.add_to_installed_apps + (app_name, rebuild_website=True) +
+No docs
++ + + frappe.installer.check_if_ready_for_barracuda + () +
+No docs
++ + + frappe.installer.create_auth_table + () +
+No docs
++ + + frappe.installer.create_database_and_user + (force, verbose) +
+No docs
++ + + frappe.installer.get_conf_params + (db_name=None, db_password=None) +
+No docs
++ + + frappe.installer.get_current_host + () +
+No docs
++ + + frappe.installer.get_site_config_path + () +
+No docs
++ + + frappe.installer.import_db_from_sql + (source_sql, verbose) +
+No docs
++ + + frappe.installer.init_singles + () +
+No docs
++ + + frappe.installer.install_app + (name, verbose=False, set_as_patched=True) +
+No docs
++ + + frappe.installer.install_db + (root_login=root, root_password=None, db_name=None, source_sql=None, admin_password=None, verbose=True, force=0, site_config=None, reinstall=False) +
+No docs
++ + + frappe.installer.make_conf + (db_name=None, db_password=None, site_config=None) +
+No docs
++ + + frappe.installer.make_connection + (root_login, root_password) +
+No docs
++ + + frappe.installer.make_site_config + (db_name=None, db_password=None, site_config=None) +
+No docs
++ + + frappe.installer.make_site_dirs + () +
+No docs
++ + + frappe.installer.post_install + (rebuild_website=False) +
+No docs
++ + + frappe.installer.remove_app + (app_name, dry_run=False) +
+Delete app and all linked to the app's module with the app.
++ + + frappe.installer.remove_from_installed_apps + (app_name) +
+No docs
++ + + frappe.installer.remove_missing_apps + () +
+No docs
++ + + frappe.installer.set_all_patches_as_completed + (app) +
+No docs
++ + + frappe.installer.update_site_config + (key, value) +
+Update a value in site_config
+Inherits from werkzeug.wsgi.SharedDataMiddleware + +
+ + + __call__ + (self, environ, start_response) +
+No docs
++ + + get_directory_loader + (self, directory) +
+No docs
++ + + frappe.permissions.add_user_permission + (doctype, name, user, with_message=False) +
+No docs
++ + + frappe.permissions.apply_user_permissions + (doctype, ptype, user=None) +
+Check if applyuserpermissions is checked for a doctype, perm type, user combination
++ + + frappe.permissions.can_export + (doctype, raise_exception=False) +
+No docs
++ + + frappe.permissions.can_import + (doctype, raise_exception=False) +
+No docs
++ + + frappe.permissions.can_set_user_permissions + (doctype, docname=None) +
+No docs
++ + + frappe.permissions.check_admin_or_system_manager + (user=None) +
+No docs
++ + + frappe.permissions.clear_user_permissions_for_doctype + (doctype) +
+No docs
++ + + frappe.permissions.get_doc_permissions + (doc, verbose=False, user=None) +
+Returns a dict of evaluated permissions for given doc like {"read":1, "write":1}
+ + + frappe.permissions.get_linked_doctypes + (dt) +
+No docs
++ + + frappe.permissions.get_role_permissions + (meta, user=None, verbose=False) +
+Returns dict of evaluated role permissions like {"read": True, "write":False}
If user permissions are applicable, it adds a dict of user permissions like
+ +{
+ // user permissions will apply on these rights
+ "apply_user_permissions": {"read": 1, "write": 1},
+
+ // doctypes that will be applicable for each right
+ "user_permission_doctypes": {
+ "read": [
+ // AND between "DocType 1" and "DocType 2"
+ ["DocType 1", "DocType 2"],
+
+ // OR
+
+ ["DocType 3"]
+
+ ]
+ }
+
+ "if_owner": {"read": 1, "write": 1}
+}
+
++ + + frappe.permissions.get_user_permission_doctypes + (user_permission_doctypes, user_permissions) +
+returns a list of list like [["User", "Blog Post"], ["User"]]
++ + + frappe.permissions.has_controller_permissions + (doc, ptype, user=None) +
+Returns controller permissions if defined. None if not defined
++ + + frappe.permissions.has_permission + (doctype, ptype=read, doc=None, verbose=False, user=None) +
+Returns True if user has permission ptype for given doctype.
+If doc is passed, it also checks user, share and owner permissions.
Note: if Table DocType is passed, it always returns True.
++ + + frappe.permissions.remove_user_permission + (doctype, name, user, default_value_name=None) +
+No docs
++ + + frappe.permissions.reset_perms + (doctype) +
+Reset permissions for given doctype.
++ + + frappe.permissions.set_user_permission_if_allowed + (doctype, name, user, with_message=False) +
+No docs
++ + + frappe.permissions.update_share_permissions + (role_permissions, doc, user) +
+Updates share permissions on role_permissions for given doc, if shared
+ + + frappe.permissions.user_has_permission + (doc, verbose=True, user=None, user_permission_doctypes=None) +
+No docs
++ + + __init__ + (self, user, resume=False, full_name=None, user_type=None) +
+No docs
++ + + delete_session + (self) +
+No docs
++ + + get_expiry_in_seconds + (self, expiry) +
+No docs
++ + + get_session_data + (self) +
+No docs
++ + + get_session_data_from_cache + (self) +
+No docs
++ + + get_session_data_from_db + (self) +
+No docs
++ + + get_session_record + (self) +
+get session record, or return the standard Guest Record
++ + + insert_session_record + (self) +
+No docs
++ + + resume + (self) +
+non-login request: load a session
++ + + start + (self) +
+start a new session
++ + + start_as_guest + (self) +
+all guests share the same 'Guest' session
++ + + update + (self, force=False) +
+extend session expiry
+Public API
+ /api/method/frappe.sessions.clear
+
+ + + frappe.sessions.clear + (user=None) +
+No docs
++ + + frappe.sessions.clear_all_sessions + () +
+This effectively logs out all users
++ + + frappe.sessions.clear_cache + (user=None) +
+No docs
++ + + frappe.sessions.clear_expired_sessions + () +
+This function is meant to be called from scheduler
++ + + frappe.sessions.clear_global_cache + () +
+No docs
++ + + frappe.sessions.clear_sessions + (user=None, keep_current=False) +
+No docs
++ + + frappe.sessions.delete_session + (sid=None, user=None) +
+No docs
++ + + frappe.sessions.generate_csrf_token + () +
+No docs
++ + + frappe.sessions.get + () +
+get session boot info
++ + + frappe.sessions.get_csrf_token + () +
+No docs
++ + + frappe.sessions.get_expiry_period + (device=desktop) +
+No docs
++ + + frappe.sessions.get_geo_from_ip + (ip_addr) +
+No docs
++ + + frappe.sessions.get_geo_ip_country + (ip_addr) +
+No docs
+Inherits from logging.Filter + +
This is a filter which injects request information (if available) into the log.
++ + + frappe.setup_logging.setup_logging + () +
+No docs
+Public API
+ /api/method/frappe.share.add
+
+ + + frappe.share.add + (doctype, name, user=None, read=1, write=0, share=0, everyone=0, flags=None) +
+Share the given document with a user.
++ + + frappe.share.check_share_permission + (doctype, name) +
+Check if the user can share with other users
++ + + frappe.share.get_share_name + (doctype, name, user, everyone) +
+No docs
++ + + frappe.share.get_shared + (doctype, user=None, rights=None) +
+Get list of shared document names for given user and DocType.
+ +Parameters:
+ +doctype - DocType of which shared names are queried.user - User for which shared names are queried.rights - List of rights for which the document is shared. List of read, write, share+ + + frappe.share.get_shared_doctypes + (user=None) +
+Return list of doctypes in which documents are shared for the given user.
+Public API
+ /api/method/frappe.share.get_users
+
+ + + frappe.share.get_users + (doctype, name, fields=*) +
+Get list of users with which this document is shared
++ + + frappe.share.remove + (doctype, name, user, flags=None) +
+No docs
+Public API
+ /api/method/frappe.share.set_permission
+
+ + + frappe.share.set_permission + (doctype, name, user, permission_to, value=1, everyone=0) +
+Set share permission.
++ + + frappe.tasks.get_active_queues + (app, worker) +
+No docs
++ + + frappe.tasks.get_required_queues + (app, prefix=) +
+No docs
++ + + frappe.tasks.get_workers + (app) +
+No docs
++ + + frappe.tasks.sync_worker + (app, worker, prefix=) +
+No docs
++ + + frappe.test_runner._add_test + (path, filename, verbose, test_suite=None) +
+No docs
++ + + frappe.test_runner._run_unittest + (module, verbose=False, tests=()) +
+No docs
++ + + frappe.test_runner.get_dependencies + (doctype) +
+No docs
++ + + frappe.test_runner.get_modules + (doctype) +
+No docs
++ + + frappe.test_runner.main + (app=None, module=None, doctype=None, verbose=False, tests=(), force=False) +
+No docs
++ + + frappe.test_runner.make_test_objects + (doctype, test_records, verbose=None) +
+No docs
++ + + frappe.test_runner.make_test_records + (doctype, verbose=0, force=False) +
+No docs
++ + + frappe.test_runner.make_test_records_for_doctype + (doctype, verbose=0, force=False) +
+No docs
++ + + frappe.test_runner.print_mandatory_fields + (doctype) +
+No docs
++ + + frappe.test_runner.run_all_tests + (app=None, verbose=False) +
+No docs
++ + + frappe.test_runner.run_tests_for_doctype + (doctype, verbose=False, tests=(), force=False) +
+No docs
++ + + frappe.test_runner.run_tests_for_module + (module, verbose=False, tests=()) +
+No docs
++ + + frappe.test_runner.set_test_email_config + () +
+No docs
++ + + frappe.translate._get_messages_from_page_or_report + (doctype, name, module=None) +
+No docs
++ + + frappe.translate.add_lang_dict + (code) +
+Extracts messages and returns Javascript code snippet to be appened at the end +of the given script
+ +Parameters:
+ +code - Javascript code snippet to which translations needs to be appended.+ + + frappe.translate.clear_cache + () +
+Clear all translation assets from :meth:frappe.cache
+ + + frappe.translate.deduplicate_messages + (messages) +
+No docs
++ + + frappe.translate.extract_messages_from_code + (code, is_py=False) +
+Extracts translatable srings from a code file
+ +Parameters:
+ +code - code from which translatable files are to be extractedis_py - include messages in triple quotes e.g. _('''message''')+ + + frappe.translate.get_all_languages + () +
+Returns all language codes ar, ch etc
++ + + frappe.translate.get_all_messages_from_js_files + (app_name=None) +
+Extracts all translatable strings from app .js files
+ + + frappe.translate.get_bench_dir + () +
+No docs
++ + + frappe.translate.get_dict + (fortype, name=None) +
+Returns translation dict for a type of object.
+ +Parameters:
+ +fortype - must be one of doctype, page, report, include, jsfile, bootname - name of the document for which assets are to be returned.+ + + frappe.translate.get_dict_from_hooks + (fortype, name) +
+No docs
++ + + frappe.translate.get_full_dict + (lang) +
+Load and return the entire translations dictionary for a language from :meth:frape.cache
Parameters:
+ +lang - Language Code, e.g. hi+ + + frappe.translate.get_lang_dict + () +
+Returns all languages in dict format, full name is the key e.g. {"english":"en"}
+ + + frappe.translate.get_lang_info + () +
+Returns a listified version of apps/languages.txt
+ + + frappe.translate.get_lang_js + (fortype, name) +
+Returns code snippet to be appended at the end of a JS script.
+ +Parameters:
+ +fortype - Type of object, e.g. DocTypename - Document name+ + + frappe.translate.get_language_from_code + (lang) +
+No docs
++ + + frappe.translate.get_messages_for_app + (app) +
+Returns all messages (list) for a specified app
+ + + frappe.translate.get_messages_from_doctype + (name) +
+Extract all translatable messages for a doctype. Includes labels, Python code, +Javascript code, html templates
++ + + frappe.translate.get_messages_from_file + (path) +
+Returns a list of transatable strings from a code file
+ +Parameters:
+ +path - path of the code file+ + + frappe.translate.get_messages_from_include_files + (app_name=None) +
+Returns messages from js files included at time of boot like desk.min.js for desk and web
++ + + frappe.translate.get_messages_from_page + (name) +
+Returns all translatable strings from a :class:frappe.core.doctype.Page
+ + + frappe.translate.get_messages_from_report + (name) +
+Returns all translatable strings from a :class:frappe.core.doctype.Report
+ + + frappe.translate.get_server_messages + (app) +
+Extracts all translatable strings (tagged with :func:frappe._) from Python modules inside an app
+ + + frappe.translate.get_untranslated + (lang, untranslated_file, get_all=False) +
+Returns all untranslated strings for a language and writes in a file
+ +Parameters:
+ +lang - Language code.untranslated_file - Output file path.get_all - Return all strings, translated or not.+ + + frappe.translate.get_user_lang + (user=None) +
+Set frappe.local.lang from user preferences on session beginning or resumption
++ + + frappe.translate.guess_language + (lang_list=None) +
+Set frappe.local.lang from HTTP headers at beginning of request
+ + + frappe.translate.is_translatable + (m) +
+No docs
++ + + frappe.translate.load_lang + (lang, apps=None) +
+Combine all translations from .csv files in all apps
+ + + frappe.translate.make_dict_from_messages + (messages, full_dict=None) +
+Returns translated messages as a dict in Language specified in frappe.local.lang
Parameters:
+ +messages - List of untranslated messages+ + + frappe.translate.pos_to_line_no + (messages, code) +
+No docs
++ + + frappe.translate.read_csv_file + (path) +
+Read CSV file and return as list of list
+ +Parameters:
+ +path - File path+ + + frappe.translate.rebuild_all_translation_files + () +
+Rebuild all translation files: [app]/translations/[lang].csv.
+ + + frappe.translate.rename_language + (old_name, new_name) +
+No docs
++ + + frappe.translate.send_translations + (translation_dict) +
+Append translated dict in frappe.local.response
+ + + frappe.translate.set_default_language + (language) +
+Set Global default language
++ + + frappe.translate.update_translations + (lang, untranslated_file, translated_file) +
+Update translations from a source and target file for a given language.
+ +Parameters:
+ +lang - Language code (e.g. en).untranslated_file - File path with the messages in English.translated_file - File path with messages in language to be updated.+ + + frappe.translate.write_csv_file + (path, app_messages, lang_dict) +
+Write translation CSV file.
+ +Parameters:
+ +path - File path, usually [app]/translations.app_messages - Translatable strings for this app.lang_dict - Full translated dict.+ + + frappe.translate.write_translations_file + (app, lang, full_dict=None, app_messages=None) +
+Write a translation file for a given language.
+ +Parameters:
+ +app - app for which translations are to be written.lang - Language code.full_dict - Full translated langauge dict (optional).app_messages - Source strings (optional).+ + + frappe.geo.country_info.get_all + () +
+No docs
++ + + frappe.geo.country_info.get_country_info + (country=None) +
+No docs
+Public API
+ /api/method/frappe.geo.country_info.get_country_timezone_info
+
+ + + frappe.geo.country_info.get_country_timezone_info + () +
+No docs
++ + + frappe.geo.country_info.get_translated_dict + () +
+No docs
++ + + frappe.geo.country_info.update + () +
+No docs
+Inherits from __builtin__.object + +
+ + + __init__ + (self, d) +
+No docs
++ + + _extract_images_from_text_editor + (self) +
+No docs
++ + + _fix_numeric_types + (self) +
+No docs
++ + + _get_missing_mandatory_fields + (self) +
+Get mandatory fields that do not have any values
++ + + _init_child + (self, value, key) +
+No docs
++ + + _validate_constants + (self) +
+No docs
++ + + _validate_length + (self) +
+No docs
++ + + _validate_selects + (self) +
+No docs
++ + + _validate_update_after_submit + (self) +
+No docs
++ + + append + (self, key, value=None) +
+No docs
++ + + as_dict + (self, no_nulls=False, no_default_fields=False) +
+No docs
++ + + as_json + (self) +
+No docs
++ + + cast + (self, val, df) +
+No docs
++ + + db_insert + (self) +
+INSERT the document (with valid columns) in the database.
++ + + db_set + (self, fieldname, value, update_modified=True) +
+No docs
++ + + db_update + (self) +
+No docs
++ + + delete_key + (self, key) +
+No docs
++ + + extend + (self, key, value) +
+No docs
++ + + get + (self, key=None, filters=None, limit=None, default=None) +
+No docs
++ + + get_db_value + (self, key) +
+No docs
++ + + get_formatted + (self, fieldname, doc=None, currency=None, absolute_value=False) +
+No docs
++ + + get_invalid_links + (self, is_submittable=False) +
+No docs
++ + + get_parentfield_of_doctype + (self, doctype) +
+No docs
++ + + get_table_field_doctype + (self, fieldname) +
+No docs
++ + + get_valid_columns + (self) +
+No docs
++ + + get_valid_dict + (self) +
+No docs
++ + + get_value + (self, fieldname) +
+No docs
++ + + getone + (self, key, filters=None) +
+No docs
++ + + in_format_data + (self, fieldname) +
+Returns True if shown via Print Format::format_data property.
+Called from within standard print format.
+ + + init_valid_columns + (self) +
+No docs
++ + + is_new + (self) +
+No docs
++ + + is_print_hide + (self, fieldname, df=None, for_print=True) +
+Returns true if fieldname is to be hidden for print.
+ +Print Hide can be set via the Print Format Builder or in the controller as a list +of hidden fields. Example
+ +class MyDoc(Document):
+ def __setup__(self):
+ self.print_hide = ["field1", "field2"]
+
+
+Parameters:
+ +fieldname - Fieldname to be checked if hidden.+ + + precision + (self, fieldname, parentfield=None) +
+Returns float precision for a particular field (or get global default).
+ +Parameters:
+ +fieldname - Fieldname for which precision is required.parentfield - If fieldname is in child table.+ + + remove + (self, doc) +
+No docs
++ + + reset_values_if_no_permlevel_access + (self, has_access_to, high_permlevel_fields) +
+If the user does not have permissions at permlevel > 0, then reset the values to original / default
++ + + set + (self, key, value, as_value=False) +
+No docs
++ + + show_unique_validation_message + (self, e) +
+No docs
++ + + update + (self, d) +
+No docs
++ + + update_if_missing + (self, d) +
+No docs
++ + + frappe.model.base_document._filter + (data, filters, limit=None) +
+pass filters as: +{"key": "val", "key": ["!=", "val"], +"key": ["in", "val"], "key": ["not in", "val"], "key": "^val", +"key" : True (exists), "key": False (does not exist) }
++ + + frappe.model.base_document.get_controller + (doctype) +
+Returns the class object of the given DocType.
+For custom type, returns frappe.model.document.Document.
Parameters:
+ +doctype - DocType name as string.+ + + frappe.model.create_new.get_default_based_on_another_field + (df, user_permissions, parent_doc) +
+No docs
++ + + frappe.model.create_new.get_new_doc + (doctype, parent_doc=None, parentfield=None, as_dict=False) +
+No docs
++ + + frappe.model.create_new.get_static_default_value + (df, user_permissions) +
+No docs
++ + + frappe.model.create_new.get_user_default_value + (df, defaults, user_permissions) +
+No docs
++ + + frappe.model.create_new.make_new_doc + (doctype) +
+No docs
++ + + frappe.model.create_new.set_dynamic_default_values + (doc, parent_doc, parentfield) +
+No docs
++ + + frappe.model.create_new.set_user_and_static_default_values + (doc) +
+No docs
++ + + frappe.model.create_new.user_permissions_exist + (df, user_permissions) +
+No docs
+Inherits from __builtin__.object + +
+ + + __init__ + (self, doctype) +
+No docs
++ + + add_limit + (self) +
+No docs
++ + + add_user_permissions + (self, user_permissions, user_permission_doctypes=None) +
+No docs
++ + + append_table + (self, table_name) +
+No docs
++ + + build_and_run + (self) +
+No docs
++ + + build_conditions + (self) +
+No docs
++ + + build_filter_conditions + (self, filters, conditions) +
+build conditions from user filters
++ + + build_match_conditions + (self, as_condition=True) +
+add match conditions if applicable
++ + + check_sort_by_table + (self, order_by) +
+No docs
++ + + execute + (self, query=None, fields=None, filters=None, or_filters=None, docstatus=None, group_by=None, order_by=None, limit_start=False, limit_page_length=None, as_list=False, with_childnames=False, debug=False, ignore_permissions=False, user=None) +
+No docs
++ + + extract_tables + (self) +
+extract tables from fields
++ + + get_filter + (self, f) +
+Returns a _dict like
+ +{ + "doctype": "DocType", + "fieldname": "fieldname", + "operator": "=", + "value": "value" +}
++ + + get_permission_query_conditions + (self) +
+No docs
++ + + get_share_condition + (self) +
+No docs
++ + + make_filter_tuple + (self, key, value) +
+No docs
++ + + parse_args + (self) +
+Convert fields and filters from strings to list, dicts
++ + + prepare_args + (self) +
+No docs
++ + + prepare_filter_condition + (self, f) +
+Returns a filter condition in the format:
+ +ifnull(tabDocType.fieldname, fallback) operator "value"
+ + + remove_user_tags + (self) +
+Removes optional columns like _user_tags, _comments etc. if not in table
+ + + run_custom_query + (self, query) +
+No docs
++ + + set_order_by + (self, args) +
+No docs
++ + + __init__ + (self, table, fieldname, fieldtype, length, default, set_index, options, unique, precision) +
+No docs
++ + + build_for_alter_table + (self, current_def) +
+No docs
++ + + default_changed + (self, current_def) +
+No docs
++ + + default_changed_for_decimal + (self, current_def) +
+No docs
++ + + get_definition + (self, with_default=1) +
+No docs
+Basically, a wrapper for oft-used mysql commands. like show tables,databases, variables etc...
+ +0. Simplify / create settings for the restore database source folder
+0a. Merge restore database and extract_sql(from frappe_server_tools).
+1. Setter and getter for different mysql variables.
+2. Setter and getter for mysql variables at global level??
+
++ + + __init__ + (self, db) +
+Pass root_conn here for access to all databases.
++ + + create_database + (self, target) +
+No docs
++ + + create_user + (self, user, password, host) +
+No docs
++ + + delete_user + (self, target, host) +
+No docs
++ + + drop_database + (self, target) +
+No docs
++ + + drop_table + (self, table_name) +
+drop table if exists
++ + + flush_privileges + (self) +
+No docs
++ + + get_database_list + (self) +
+get list of databases
++ + + get_table_schema + (self, table) +
+Just returns the output of Desc tables.
++ + + get_tables_list + (self, target=None) +
+get list of tables
++ + + get_variables + (self, regex) +
+Get variables that match the passed pattern regex
++ + + grant_all_privileges + (self, target, user, host) +
+No docs
++ + + grant_select_privilges + (self, db, table, user, host) +
+No docs
++ + + restore_database + (self, target, source, user, password) +
+No docs
++ + + __init__ + (self, doctype, prefix=tab) +
+No docs
++ + + alter + (self) +
+No docs
++ + + create + (self) +
+No docs
++ + + drop_foreign_keys + (self) +
+No docs
++ + + get_column_definitions + (self) +
+No docs
++ + + get_columns_from_db + (self) +
+No docs
++ + + get_columns_from_docfields + (self) +
+get columns from docfields and custom fields
++ + + get_foreign_keys + (self) +
+No docs
++ + + get_index_definitions + (self) +
+No docs
++ + + is_new + (self) +
+No docs
++ + + sync + (self) +
+No docs
++ + + validate + (self) +
+Check if change in varchar length isn't truncating the columns
+Inherits from frappe.exceptions.ValidationError + +
+ + + frappe.model.db_schema.add_column + (doctype, column_name, fieldtype, precision=None) +
+No docs
++ + + frappe.model.db_schema.get_definition + (fieldtype, precision=None, length=None) +
+No docs
++ + + frappe.model.db_schema.remove_all_foreign_keys + () +
+No docs
++ + + frappe.model.db_schema.updatedb + (dt) +
+Syncs a DocType to the table
+ * creates if required
+ * updates columns
+ * updates indices
+ + + frappe.model.db_schema.validate_column_name + (n) +
+No docs
++ + + frappe.model.delete_doc.check_if_doc_is_dynamically_linked + (doc, method=Delete) +
+No docs
++ + + frappe.model.delete_doc.check_if_doc_is_linked + (doc, method=Delete) +
+Raises excption if the given doc(dt, dn) is linked in another record.
++ + + frappe.model.delete_doc.check_permission_and_not_submitted + (doc) +
+No docs
++ + + frappe.model.delete_doc.delete_doc + (doctype=None, name=None, force=0, ignore_doctypes=None, for_reload=False, ignore_permissions=False, flags=None, ignore_on_trash=False) +
+Deletes a doc(dt, dn) and validates if it is not submitted and not linked in a live record
++ + + frappe.model.delete_doc.delete_from_table + (doctype, name, ignore_doctypes, doc) +
+No docs
++ + + frappe.model.delete_doc.delete_linked_comments + (doc) +
+Delete comments from the document
++ + + frappe.model.delete_doc.delete_linked_communications + (doc) +
+No docs
++ + + frappe.model.delete_doc.delete_linked_todos + (doc) +
+No docs
++ + + frappe.model.delete_doc.delete_shared + (doc) +
+No docs
++ + + frappe.model.delete_doc.insert_feed + (doc) +
+No docs
++ + + frappe.model.delete_doc.update_naming_series + (doc) +
+No docs
++ + + frappe.model.docfield.get_change_column_query + (f, new) +
+generate change fieldname query
++ + + frappe.model.docfield.rename + (doctype, fieldname, newname) +
+rename docfield
++ + + frappe.model.docfield.update_parent_field + (f, new) +
+update 'parentfield' in tables
++ + + frappe.model.docfield.update_single + (f, new) +
+update in tabSingles
++ + + frappe.model.docfield.update_table + (f, new) +
+update table
+Inherits from frappe.model.base_document.BaseDocument + +
All controllers inherit from Document.
+ + + __init__ + (self, arg1, arg2=None) +
+Constructor.
+ +Parameters:
+ +arg1 - DocType name as string or document dictarg2 - Document name, if arg1 is DocType name.If DocType name and document name are passed, the object will load +all values (including child documents) from the database.
++ + + _set_defaults + (self) +
+No docs
++ + + _validate + (self) +
+No docs
++ + + _validate_links + (self) +
+No docs
++ + + _validate_mandatory + (self) +
+No docs
++ + + add_comment + (self, comment_type, text=None, comment_by=None) +
+Add a comment to this document.
+ +Parameters:
+ +comment_type - e.g. Comment. See Comment for more info.+ + + cancel + (self) +
+Cancel the document. Sets docstatus = 2, then saves.
+ + + check_docstatus_transition + (self, docstatus) +
+Ensures valid docstatus transition.
+Valid transitions are (number in brackets is docstatus):
+ + + check_if_latest + (self) +
+Checks if modified timestamp provided by document being updated is same as the
+modified timestamp in the database. If there is a different, the document has been
+updated in the database after the current copy was read. Will throw an error if
+timestamps don't match.
Will also validate document transitions (Save > Submit > Cancel) calling
+self.check_docstatus_transition.
+ + + check_no_back_links_exist + (self) +
+Check if document links to any active document before Cancel.
++ + + check_permission + (self, permtype, permlabel=None) +
+Raise frappe.PermissionError if not permitted
+ + + clear_cache + (self) +
+No docs
++ + + clear_linked_with_cache + (self) +
+No docs
++ + + delete + (self) +
+Delete document.
++ + + get_all_children + (self, parenttype=None) +
+Returns all children documents from Table type field in a list.
++ + + get_latest + (self) +
+No docs
++ + + get_permlevel_access + (self) +
+No docs
++ + + get_signature + (self) +
+Returns signature (hash) for private URL.
++ + + get_starred_by + (self) +
+No docs
++ + + get_url + (self) +
+Returns Desk URL for this document. /desk#Form/{doctype}/{name}
+ + + has_permission + (self, permtype=read, verbose=False) +
+Call frappe.has_permission if self.flags.ignore_permissions
+is not set.
Parameters:
+ +permtype - one of read, write, submit, cancel, delete+ + + has_website_permission + (self, permtype=read, verbose=False) +
+Call frappe.has_website_permission if self.flags.ignore_permissions
+is not set.
Parameters:
+ +permtype - one of read, write, submit, cancel, delete+ + + insert + (self, ignore_permissions=None) +
+Insert the document in the database (as a new document).
+This will check for user permissions and execute before_insert,
+validate, on_update, after_insert methods if they are written.
Parameters:
+ +ignore_permissions - Do not check permissions if True.+ + + is_whitelisted + (self, method) +
+No docs
++ + + load_from_db + (self) +
+Load document and children from database and create properties +from fields
++ + + notify_update + (self) +
+Publish realtime that the current document is modified
++ + + raise_no_permission_to + (self, perm_type) +
+Raise frappe.PermissionError.
+ + + reload + (self) +
+Reload document from database
++ + + round_floats_in + (self, doc, fieldnames=None) +
+Round floats for all Currency, Float, Percent fields for the given doc.
Parameters:
+ +doc - Document whose numeric properties are to be rounded.fieldnames - [Optional] List of fields to be rounded.+ + + run_before_save_methods + (self) +
+Run standard methods before INSERT or UPDATE. Standard Methods are:
validate, before_save for Save.validate, before_submit for Submit.before_cancel for Cancelbefore_update_after_submit for Update after SubmitWill also update title_field if set
++ + + run_method + (self, method) +
+run standard triggers, plus those in hooks
++ + + run_post_save_methods + (self) +
+Run standard methods after INSERT or UPDATE. Standard Methods are:
on_update for Save.on_update, on_submit for Submit.on_cancel for Cancelupdate_after_submit for Update after Submit+ + + save + (self, ignore_permissions=None) +
+Save the current document in the database in the DocType's table or
+tabSingles (for single types).
This will check for user permissions and execute
+validate before updating, on_update after updating triggers.
Parameters:
+ +ignore_permissions - Do not check permissions if True.+ + + set_docstatus_user_and_timestamp + (self) +
+No docs
++ + + set_new_name + (self) +
+Calls frappe.naming.se_new_name for parent and child docs.
+ + + set_onload + (self, key, value) +
+No docs
++ + + set_parent_in_children + (self) +
+Updates parent and parenttype property in all children.
+ + + set_title_field + (self) +
+Set title field based on template
++ + + submit + (self) +
+Submit the document. Sets docstatus = 1, then saves.
+ + + update_children + (self) +
+No docs
++ + + update_single + (self, d) +
+Updates values for Single type Document in tabSingles.
+ + + validate_higher_perm_levels + (self) +
+If the user does not have permissions at permlevel > 0, then reset the values to original / default
++ + + validate_table_has_rows + (self, parentfield, raise_exception=None) +
+Raise exception if Table field is empty.
++ + + validate_update_after_submit + (self) +
+No docs
++ + + validate_value + (self, fieldname, condition, val2, doc=None, raise_exception=None) +
+Check that value of fieldname should be 'condition' val2 +else throw Exception.
++ + + frappe.model.document.get_doc + (arg1, arg2=None) +
+returns a frappe.model.Document object.
+ +Parameters:
+ +arg1 - Document dict or DocType name.arg2 - [optional] document name.There are two ways to call get_doc
# will fetch the latest user object (with child table) from the database
+user = get_doc("User", "test@example.com")
+
+# create a new object
+user = get_doc({
+ "doctype":"User"
+ "email_id": "test@example.com",
+ "user_roles: [
+ {"role": "System Manager"}
+ ]
+})
+
++ + + frappe.model.copytables + (srctype, src, srcfield, tartype, tar, tarfield, srcfields, tarfields=[]) +
+No docs
++ + + frappe.model.db_exists + (dt, dn) +
+No docs
++ + + frappe.model.delete_fields + (args_dict, delete=0) +
+Delete a field.
+* Deletes record from tabDocField
+* If not single doctype: Drops column from table
+* If single, deletes record from tabSingles
args_dict = { dt: [field names] }
++ + + frappe.model.rename + (doctype, old, new, debug=False) +
+No docs
++ + + frappe.model.mapper.get_mapped_doc + (from_doctype, from_docname, table_maps, target_doc=None, postprocess=None, ignore_permissions=False) +
+No docs
++ + + frappe.model.mapper.map_child_doc + (source_d, target_parent, table_map, source_parent=None) +
+No docs
++ + + frappe.model.mapper.map_doc + (source_doc, target_doc, table_map, source_parent=None) +
+No docs
++ + + frappe.model.mapper.map_fetch_fields + (target_doc, df, no_copy_fields) +
+No docs
++ + + frappe.model.mapper.map_fields + (source_doc, target_doc, table_map, source_parent) +
+No docs
+Inherits from frappe.model.document.Document + +
+ + + __init__ + (self, doctype) +
+No docs
++ + + add_custom_fields + (self) +
+No docs
++ + + apply_property_setters + (self) +
+No docs
++ + + get_dynamic_link_fields + (self) +
+No docs
++ + + get_field + (self, fieldname) +
+No docs
++ + + get_fields_to_check_permissions + (self, user_permission_doctypes) +
+No docs
++ + + get_high_permlevel_fields + (self) +
+Build list of fields with high perm level and all the higher perm levels defined.
++ + + get_label + (self, fieldname) +
+No docs
++ + + get_link_fields + (self) +
+No docs
++ + + get_list_fields + (self) +
+No docs
++ + + get_options + (self, fieldname) +
+No docs
++ + + get_search_fields + (self) +
+No docs
++ + + get_select_fields + (self) +
+No docs
++ + + get_table_field_doctype + (self, fieldname) +
+No docs
++ + + get_table_fields + (self) +
+No docs
++ + + get_title_field + (self) +
+No docs
++ + + get_valid_columns + (self) +
+No docs
++ + + load_from_db + (self) +
+No docs
++ + + process + (self) +
+No docs
++ + + sort_fields + (self) +
+sort on basis of previous_field
++ + + frappe.model.meta.clear_cache + (doctype=None) +
+No docs
++ + + frappe.model.meta.get_default_df + (fieldname) +
+No docs
++ + + frappe.model.meta.get_field_currency + (df, doc=None) +
+get currency based on DocField options and fieldvalue in doc
++ + + frappe.model.meta.get_field_precision + (df, doc=None, currency=None) +
+get precision based on DocField options and fieldvalue in doc
++ + + frappe.model.meta.get_meta + (doctype, cached=True) +
+No docs
++ + + frappe.model.meta.get_parent_dt + (dt) +
+No docs
++ + + frappe.model.meta.get_table_columns + (doctype) +
+No docs
++ + + frappe.model.meta.is_single + (doctype) +
+No docs
++ + + frappe.model.meta.load_doctype_from_file + (doctype) +
+No docs
++ + + frappe.model.meta.set_fieldname + (field_id, fieldname) +
+No docs
++ + + frappe.model.meta.trim_tables + () +
+Use this to remove columns that don't exist in meta
++ + + frappe.model.naming._set_amended_name + (doc) +
+No docs
++ + + frappe.model.naming.append_number_if_name_exists + (doc) +
+No docs
++ + + frappe.model.naming.de_duplicate + (doctype, name) +
+No docs
++ + + frappe.model.naming.get_default_naming_series + (doctype) +
+get default value for naming_series property
+ + + frappe.model.naming.getseries + (key, digits, doctype=) +
+No docs
++ + + frappe.model.naming.make_autoname + (key, doctype=) +
+Creates an autoname from the given key:
+ +Autoname rules:
+ + * The key is separated by '.'
+ * '####' represents a series. The string before this part becomes the prefix:
+ Example: ABC.#### creates a series ABC0001, ABC0002 etc
+ * 'MM' represents the current month
+ * 'YY' and 'YYYY' represent the current year
+
+
+Example:
+ + * DE/./.YY./.MM./.##### will create a series like
+ DE/09/01/0001 where 09 is the year, 01 is the month and 0001 is the series
+
++ + + frappe.model.naming.revert_series_if_last + (key, name) +
+No docs
++ + + frappe.model.naming.set_name_by_naming_series + (doc) +
+Sets name by the naming_series property
+ + + frappe.model.naming.set_new_name + (doc) +
+Sets the `name`` property for the document based on various rules.
+ +autoname method is declared, then call it.autoname property is set in the DocType (meta), then build it using the autoname property.name is already defined, use that nameParameters:
+ +doc - Document to be named.+ + + frappe.model.naming.validate_name + (doctype, name, case=None, merge=False) +
+No docs
++ + + frappe.model.rename_doc.bulk_rename + (doctype, rows=None, via_console=False) +
+Bulk rename documents
+ +Parameters:
+ +doctype - DocType to be renamedrows - list of documents as ((oldname, newname), ..)+ + + frappe.model.rename_doc.get_link_fields + (doctype) +
+No docs
++ + + frappe.model.rename_doc.get_select_fields + (old, new) +
+get select type fields where doctype's name is hardcoded as +new line separated list
+Public API
+ /api/method/frappe.model.rename_doc.rename_doc
+
+ + + frappe.model.rename_doc.rename_doc + (doctype, old, new, force=False, merge=False, ignore_permissions=False) +
+Renames a doc(dt, old) to doc(dt, new) and +updates all linked fields of type "Link"
++ + + frappe.model.rename_doc.rename_doctype + (doctype, old, new, force=False) +
+No docs
++ + + frappe.model.rename_doc.rename_dynamic_links + (doctype, old, new) +
+No docs
++ + + frappe.model.rename_doc.rename_parent_and_child + (doctype, old, new, meta) +
+No docs
++ + + frappe.model.rename_doc.rename_versions + (doctype, old, new) +
+No docs
++ + + frappe.model.rename_doc.update_attachments + (doctype, old, new) +
+No docs
++ + + frappe.model.rename_doc.update_child_docs + (old, new, meta) +
+No docs
++ + + frappe.model.rename_doc.update_comments + (doctype, old, new, force=False) +
+No docs
++ + + frappe.model.rename_doc.update_link_field_values + (link_fields, old, new, doctype) +
+No docs
++ + + frappe.model.rename_doc.update_options_for_fieldtype + (fieldtype, old, new) +
+No docs
++ + + frappe.model.rename_doc.update_parenttype_values + (old, new) +
+No docs
++ + + frappe.model.rename_doc.update_select_field_values + (old, new) +
+No docs
++ + + frappe.model.rename_doc.validate_rename + (doctype, new, meta, merge, force, ignore_permissions) +
+No docs
++ + + frappe.model.sync.get_doc_files + (files, start_path, force=0, sync_everything=False, verbose=False) +
+walk and sync all doctypes and pages
++ + + frappe.model.sync.sync_all + (force=0, verbose=False) +
+No docs
++ + + frappe.model.sync.sync_for + (app_name, force=0, sync_everything=False, verbose=False) +
+No docs
++ + + frappe.model.workflow.get_default_state + (doctype) +
+No docs
++ + + frappe.model.workflow.get_state_fieldname + (doctype) +
+No docs
++ + + frappe.model.workflow.get_workflow_name + (doctype) +
+No docs
++ + + frappe.model.utils.set_default + (doc, key) +
+Set is_default property of given doc and unset all others filtered by given key.
++ + + frappe.model.utils.rename_field.rename_field + (doctype, old_fieldname, new_fieldname) +
+This functions assumes that doctype is already synced
++ + + frappe.model.utils.rename_field.update_reports + (doctype, old_fieldname, new_fieldname) +
+No docs
++ + + frappe.model.utils.rename_field.update_users_report_view_settings + (doctype, ref_fieldname, new_fieldname) +
+No docs
++ + + frappe.modules.export_file.create_folder + (module, dt, dn, create_init) +
+No docs
++ + + frappe.modules.export_file.create_init_py + (module_path, dt, dn) +
+No docs
++ + + frappe.modules.export_file.export_doc + (doc) +
+No docs
++ + + frappe.modules.export_file.export_to_files + (record_list=None, record_module=None, verbose=0, create_init=None) +
+Export recordlist to files. recordlist is a list of lists ([doctype],[docname] ) ,
++ + + frappe.modules.export_file.get_module_name + (doc) +
+No docs
++ + + frappe.modules.export_file.write_document_file + (doc, record_module=None, create_init=None) +
+No docs
++ + + frappe.modules.export_doc + (doctype, name, module=None) +
+Write a doc to standard path.
++ + + frappe.modules.get_app_publisher + (module) +
+No docs
++ + + frappe.modules.get_doc_path + (module, doctype, name) +
+No docs
++ + + frappe.modules.get_doctype_module + (doctype) +
+Returns Module Def name of given doctype.
++ + + frappe.modules.get_module_app + (module) +
+No docs
++ + + frappe.modules.get_module_name + (doctype, module, prefix=, app=None) +
+No docs
++ + + frappe.modules.get_module_path + (module) +
+Returns path of the given module
++ + + frappe.modules.load_doctype_module + (doctype, module=None, prefix=) +
+Returns the module object for given doctype.
++ + + frappe.modules.make_boilerplate + (template, doc, opts=None) +
+No docs
++ + + frappe.modules.reload_doc + (module, dt=None, dn=None, force=True) +
+No docs
++ + + frappe.modules.scrub + (txt) +
+No docs
++ + + frappe.modules.scrub_dt_dn + (dt, dn) +
+Returns in lowercase and code friendly names of doctype and name for certain types
++ + + frappe.modules.import_file.get_file_path + (module, dt, dn) +
+No docs
++ + + frappe.modules.import_file.import_doc + (docdict, force=False, data_import=False, pre_process=None) +
+No docs
++ + + frappe.modules.import_file.import_file + (module, dt, dn, force=False, pre_process=None) +
+Sync a file from txt if modifed, return false if not updated
++ + + frappe.modules.import_file.import_file_by_path + (path, force=False, data_import=False, pre_process=None) +
+No docs
++ + + frappe.modules.import_file.import_files + (module, dt=None, dn=None, force=False, pre_process=None) +
+No docs
++ + + frappe.modules.import_file.read_doc_from_file + (path) +
+No docs
+Inherits from exceptions.Exception + +
+ + + frappe.modules.patch_handler.block_user + (block) +
+stop/start execution till patch is run
++ + + frappe.modules.patch_handler.check_session_stopped + () +
+No docs
++ + + frappe.modules.patch_handler.execute_patch + (patchmodule, method=None, methodargs=None) +
+execute the patch
++ + + frappe.modules.patch_handler.executed + (patchmodule) +
+return True if is executed
++ + + frappe.modules.patch_handler.get_all_patches + () +
+No docs
++ + + frappe.modules.patch_handler.log + (msg) +
+No docs
++ + + frappe.modules.patch_handler.reload_doc + (args) +
+No docs
++ + + frappe.modules.patch_handler.run_all + () +
+run all pending patches
++ + + frappe.modules.patch_handler.run_single + (patchmodule=None, method=None, methodargs=None, force=False) +
+No docs
++ + + frappe.modules.patch_handler.update_patch_log + (patchmodule) +
+update patch_file in patch log
++ + + frappe.modules.utils.commonify_doclist + (doclist, with_comments=1) +
+Makes a doclist more readable by extracting common properties. +This is used for printing Documents in files
++ + + frappe.modules.utils.listfolders + (path, only_name=0) +
+Returns the list of folders (with paths) in the given path, +If only_name is set, it returns only the folder names
++ + + frappe.modules.utils.peval_doclist + (txt) +
+No docs
++ + + frappe.modules.utils.pprint_doclist + (doclist, with_comments=1) +
+No docs
++ + + frappe.modules.utils.switch_module + (dt, dn, to, frm=None, export=None) +
+Change the module of the given doctype, if export is true, then also export txt and copy +code files from src
++ + + frappe.modules.utils.uncommonify_doclist + (dl) +
+Expands an commonified doclist
+frappe.utils.autodoc +~~~~~~~~~~~~~~~~~~~~
+ +Inspect elements of a given module and return its objects
++ + + frappe.utils.autodoc.automodel + (doctype) +
+return doctype template
++ + + frappe.utils.autodoc.automodule + (name) +
+Returns a list of attributes for given module string.
+ +Attribute Format:
+ +{
+ "name": [__name__],
+ "type": ["function" or "class"]
+ "args": [inspect.getargspec(value) (for function)]
+ "docs": [__doc__ as markdown]
+}
+
+
+Parameters:
+ +name - Module name as string.+ + + frappe.utils.autodoc.get_class_info + (class_obj, module_name) +
+No docs
++ + + frappe.utils.autodoc.get_function_info + (value) +
+No docs
++ + + frappe.utils.autodoc.get_version + (name) +
+No docs
++ + + frappe.utils.autodoc.parse + (docs) +
+Parameters:
+ +Parse docs text into markdown. Will parse directives like - **name** - etc
+ + + frappe.utils.autodoc.strip_leading_tabs + (docs) +
+Strip leading tabs from doc text.
+This module handles the On Demand Backup utility
+This class contains methods to perform On Demand Backup
+ +To initialize, specify (dbname, user, password, dbfilename=None, dbhost="localhost") +If specifying dbfilename, also append ".sql.gz"
++ + + __init__ + (self, db_name, user, password, backup_path_db=None, backup_path_files=None, db_host=localhost) +
+No docs
++ + + get_backup + (self, older_than=24, ignore_files=False, force=False) +
+Takes a new dump if existing file is old +and sends the link to the file as email
++ + + get_recent_backup + (self, older_than) +
+No docs
++ + + send_email + (self) +
+Sends the link to backup file located at erpnext/backups
++ + + set_backup_file_name + (self) +
+No docs
++ + + take_dump + (self) +
+No docs
++ + + zip_files + (self) +
+No docs
++ + + frappe.utils.backups.delete_temp_backups + (older_than=24) +
+Cleans up the backuplinkpath directory by deleting files older than 24 hours
+Public API
+ /api/method/frappe.utils.backups.get_backup
+
+ + + frappe.utils.backups.get_backup + () +
+This function is executed when the user clicks on +Toos > Download Backup
++ + + frappe.utils.backups.get_backup_path + () +
+No docs
++ + + frappe.utils.backups.is_file_old + (db_file_name, older_than=24) +
+Checks if file exists and is older than specified hours +Returns -> +True: file does not exist or file is old +False: file is new
++ + + frappe.utils.backups.new_backup + (older_than=6, ignore_files=False, backup_path_db=None, backup_path_files=None, force=False) +
+No docs
++ + + frappe.utils.backups.scheduled_backup + (older_than=6, ignore_files=False, backup_path_db=None, backup_path_files=None, force=False) +
+this function is called from scheduler +deletes backups older than 7 days +takes backup
++ + + frappe.utils.bench_helper.app_group + (ctx, site=False, force=False, verbose=False, profile=False) +
+No docs
++ + + frappe.utils.bench_helper.get_app_commands + (app) +
+No docs
++ + + frappe.utils.bench_helper.get_app_group + (app) +
+No docs
++ + + frappe.utils.bench_helper.get_app_groups + () +
+No docs
++ + + frappe.utils.bench_helper.get_apps + () +
+No docs
++ + + frappe.utils.bench_helper.get_sites + (site_arg) +
+No docs
++ + + frappe.utils.bench_helper.main + () +
+No docs
++ + + frappe.utils.boilerplate.make_boilerplate + (dest, app_name) +
+No docs
++ + + frappe.utils.change_log.get_change_log + (user=None) +
+No docs
++ + + frappe.utils.change_log.get_change_log_for_app + (app, from_version, to_version) +
+No docs
+Public API
+ /api/method/frappe.utils.change_log.get_versions
+
+ + + frappe.utils.change_log.get_versions + () +
+Get versions of all installed apps.
+ +Example:
+ +{
+ "frappe": {
+ "title": "Frappe Framework",
+ "version": "5.0.0"
+ }
+}
+
+Public API
+ /api/method/frappe.utils.change_log.update_last_known_versions
+
+ + + frappe.utils.change_log.update_last_known_versions + () +
+No docs
++ + + __init__ + (self, encoding=utf-8) +
+No docs
++ + + getvalue + (self) +
+No docs
++ + + writerow + (self, row) +
+No docs
++ + + frappe.utils.csvutils.check_record + (d) +
+check for mandatory, select options, dates. these should ideally be in doclist
++ + + frappe.utils.csvutils.getlink + (doctype, name) +
+No docs
++ + + frappe.utils.csvutils.import_doc + (d, doctype, overwrite, row_idx, submit=False, ignore_links=False) +
+import main (non child) document
++ + + frappe.utils.csvutils.read_csv_content + (fcontent, ignore_encoding=False) +
+No docs
++ + + frappe.utils.csvutils.read_csv_content_from_attached_file + (doc) +
+No docs
++ + + frappe.utils.csvutils.read_csv_content_from_uploaded_file + (ignore_encoding=False) +
+No docs
+Public API
+ /api/method/frappe.utils.csvutils.send_csv_to_client
+
+ + + frappe.utils.csvutils.send_csv_to_client + (args) +
+No docs
++ + + frappe.utils.csvutils.to_csv + (data) +
+No docs
++ + + frappe.utils.data._get_time_zone + () +
+No docs
++ + + frappe.utils.data.add_days + (date, days) +
+No docs
++ + + frappe.utils.data.add_months + (date, months) +
+No docs
++ + + frappe.utils.data.add_to_date + (date, years=0, months=0, days=0) +
+Adds days to the given date
+ + + frappe.utils.data.add_years + (date, years) +
+No docs
++ + + frappe.utils.data.cint + (s) +
+Convert to integer
++ + + frappe.utils.data.comma_and + (some_list) +
+No docs
++ + + frappe.utils.data.comma_or + (some_list) +
+No docs
++ + + frappe.utils.data.comma_sep + (some_list, pattern) +
+No docs
++ + + frappe.utils.data.compare + (val1, condition, val2) +
+No docs
++ + + frappe.utils.data.convert_utc_to_user_timezone + (utc_timestamp) +
+No docs
++ + + frappe.utils.data.cstr + (s) +
+No docs
++ + + frappe.utils.data.date_diff + (string_ed_date, string_st_date) +
+No docs
++ + + frappe.utils.data.encode + (obj, encoding=utf-8) +
+No docs
++ + + frappe.utils.data.escape_html + (text) +
+No docs
++ + + frappe.utils.data.expand_relative_urls + (html) +
+No docs
++ + + frappe.utils.data.filter_strip_join + (some_list, sep) +
+given a list, filter None values, strip spaces and join
++ + + frappe.utils.data.flt + (s, precision=None) +
+Convert to float (ignore commas)
++ + + frappe.utils.data.fmt_money + (amount, precision=None, currency=None) +
+Convert to string with commas for thousands, millions etc
++ + + frappe.utils.data.format_datetime + (datetime_string, format_string=None) +
+No docs
++ + + frappe.utils.data.format_time + (txt) +
+No docs
++ + + frappe.utils.data.formatdate + (string_date=None, format_string=None) +
+Convers the given string date to :data:user_format
+ser format specified in defaults
Examples:
+ ++ + + frappe.utils.data.get_datetime + (datetime_str=None) +
+No docs
++ + + frappe.utils.data.get_datetime_str + (datetime_obj) +
+No docs
++ + + frappe.utils.data.get_first_day + (dt, d_years=0, d_months=0) +
+Returns the first day of the month for the date specified by date object
+Also adds d_years and d_months if specified
+ + + frappe.utils.data.get_host_name + () +
+No docs
++ + + frappe.utils.data.get_last_day + (dt) +
+Returns last day of the month using:
+get_first_day(dt, 0, 1) + datetime.timedelta(-1)
+ + + frappe.utils.data.get_link_to_form + (doctype, name, label=None) +
+No docs
++ + + frappe.utils.data.get_number_format_info + (format) +
+No docs
++ + + frappe.utils.data.get_time + (time_str) +
+No docs
++ + + frappe.utils.data.get_time_zone + () +
+No docs
++ + + frappe.utils.data.get_url + (uri=None, full_address=False) +
+get app url from request
++ + + frappe.utils.data.get_url_to_form + (doctype, name) +
+No docs
++ + + frappe.utils.data.get_url_to_list + (doctype) +
+No docs
++ + + frappe.utils.data.get_user_format + () +
+No docs
++ + + frappe.utils.data.getdate + (string_date=None) +
+Coverts string date (yyyy-mm-dd) to datetime.date object
++ + + frappe.utils.data.global_date_format + (date) +
+returns date as 1 January 2012
++ + + frappe.utils.data.has_common + (l1, l2) +
+Returns truthy value if there are common elements in lists l1 and l2
++ + + frappe.utils.data.in_words + (integer, in_million=True) +
+Returns string in words for the given integer.
++ + + frappe.utils.data.is_html + (text) +
+No docs
++ + + frappe.utils.data.money_in_words + (number, main_currency=None, fraction_currency=None) +
+Returns string in words with currency and fraction currency.
++ + + frappe.utils.data.now + () +
+return current datetime as yyyy-mm-dd hh:mm:ss
++ + + frappe.utils.data.now_datetime + () +
+No docs
++ + + frappe.utils.data.nowdate + () +
+return current date as yyyy-mm-dd
++ + + frappe.utils.data.nowtime + () +
+return current time in hh:mm
++ + + frappe.utils.data.parse_val + (v) +
+Converts to simple datatypes from SQL query results
++ + + frappe.utils.data.pretty_date + (iso_datetime) +
+Takes an ISO time and returns a string representing how +long ago the date represents. +Ported from PrettyDate by John Resig
++ + + frappe.utils.data.quote_urls + (html) +
+No docs
++ + + frappe.utils.data.quoted + (url) +
+No docs
++ + + frappe.utils.data.rounded + (num, precision=0) +
+round method for round halfs to nearest even algorithm aka banker's rounding - compatible with python3
++ + + frappe.utils.data.scrub_urls + (html) +
+No docs
++ + + frappe.utils.data.strip + (val, chars=None) +
+No docs
++ + + frappe.utils.data.strip_html + (text) +
+removes anything enclosed in and including <>
++ + + frappe.utils.data.time_diff + (string_ed_date, string_st_date) +
+No docs
++ + + frappe.utils.data.time_diff_in_hours + (string_ed_date, string_st_date) +
+No docs
++ + + frappe.utils.data.time_diff_in_seconds + (string_ed_date, string_st_date) +
+No docs
++ + + frappe.utils.data.to_timedelta + (time_str) +
+No docs
++ + + frappe.utils.data.today + () +
+No docs
++ + + frappe.utils.data.unique + (seq) +
+use this instead of list(set()) to preserve order of the original list. +Thanks to Stackoverflow: http://stackoverflow.com/questions/480214/how-do-you-remove-duplicates-from-a-list-in-python-whilst-preserving-order
++ + + frappe.utils.dateutils.datetime_in_user_format + (date_time) +
+No docs
++ + + frappe.utils.dateutils.get_user_date_format + () +
+No docs
++ + + frappe.utils.dateutils.parse_date + (date) +
+tries to parse given date to system's format i.e. yyyy-mm-dd. returns a string
++ + + frappe.utils.dateutils.user_to_str + (date, date_format=None) +
+No docs
++ + + frappe.utils.doctor.celery_doctor + (site=None) +
+No docs
++ + + frappe.utils.doctor.check_if_workers_online + () +
+No docs
++ + + frappe.utils.doctor.doctor + () +
+Prints diagnostic information for the scheduler
++ + + frappe.utils.doctor.dump_queue_status + (site=None) +
+Dumps pending events and tasks per queue
++ + + frappe.utils.doctor.get_pending_task_count + () +
+Get count of pending tasks
++ + + frappe.utils.doctor.get_queues + (site=None) +
+Returns the name of queues where frappe enqueues tasks as per the configuration
++ + + frappe.utils.doctor.get_redis_conn + () +
+Returns the redis connection that celery would use
++ + + frappe.utils.doctor.get_running_tasks + () +
+No docs
++ + + frappe.utils.doctor.get_task_body + (taskstr) +
+No docs
++ + + frappe.utils.doctor.get_task_count_for_queue + (queue) +
+For a given queue, returns the count of every pending task and aggregate of +events pending
++ + + frappe.utils.doctor.get_timedout_locks + () +
+Get list of stale locks from all sites
++ + + frappe.utils.doctor.purge_pending_tasks + (event=all) +
+Purge tasks of the event event type. Passing 'all' will not purge all +events but of the all event type, ie. the ones that are enqueued every five +mintues and would any leave daily, hourly and weekly tasks
+Inherits from exceptions.Exception + +
+ + + frappe.utils.file_lock.check_lock + (path) +
+No docs
++ + + frappe.utils.file_lock.create_lock + (name) +
+No docs
++ + + frappe.utils.file_lock.delete_lock + (name) +
+No docs
++ + + frappe.utils.file_lock.get_lock_path + (name) +
+No docs
+Inherits from frappe.exceptions.ValidationError + +
+ + + frappe.utils.file_manager.check_max_file_size + (content) +
+No docs
++ + + frappe.utils.file_manager.delete_file + (path) +
+Delete file from public folder
+ + + frappe.utils.file_manager.delete_file_data_content + (doc, only_thumbnail=False) +
+No docs
++ + + frappe.utils.file_manager.delete_file_from_filesystem + (doc, only_thumbnail=False) +
+Delete file, thumbnail from File document
++ + + frappe.utils.file_manager.extract_images_from_doc + (doc, fieldname) +
+No docs
++ + + frappe.utils.file_manager.extract_images_from_html + (doc, content) +
+No docs
++ + + frappe.utils.file_manager.get_content_hash + (content) +
+No docs
++ + + frappe.utils.file_manager.get_file + (fname) +
+No docs
++ + + frappe.utils.file_manager.get_file_data_from_hash + (content_hash) +
+No docs
++ + + frappe.utils.file_manager.get_file_name + (fname, optional_suffix) +
+No docs
++ + + frappe.utils.file_manager.get_file_url + (file_data_name) +
+No docs
++ + + frappe.utils.file_manager.get_random_filename + (extn=None, content_type=None) +
+No docs
++ + + frappe.utils.file_manager.get_uploaded_content + () +
+No docs
++ + + frappe.utils.file_manager.remove_all + (dt, dn) +
+remove all files in a transaction
++ + + frappe.utils.file_manager.remove_file + (fid, attached_to_doctype=None, attached_to_name=None) +
+Remove file and File entry
++ + + frappe.utils.file_manager.remove_file_by_url + (file_url, doctype=None, name=None) +
+No docs
++ + + frappe.utils.file_manager.save_file + (fname, content, dt, dn, folder=None, decode=False) +
+No docs
++ + + frappe.utils.file_manager.save_file_on_filesystem + (fname, content, content_type=None) +
+No docs
++ + + frappe.utils.file_manager.save_uploaded + (dt, dn, folder) +
+No docs
++ + + frappe.utils.file_manager.save_url + (file_url, dt, dn, folder) +
+No docs
++ + + frappe.utils.file_manager.upload + () +
+No docs
++ + + frappe.utils.file_manager.write_file + (content, file_path, fname) +
+write file to disk with a random name (to compare)
++ + + frappe.utils.fixtures.export_fixtures + () +
+Export fixtures as JSON to [app]/fixtures
+ + + frappe.utils.fixtures.import_custom_scripts + (app) +
+Import custom scripts from [app]/fixtures/custom_scripts
+ + + frappe.utils.fixtures.sync_fixtures + (app=None) +
+Import, overwrite fixtures from [app]/fixtures
+ + + frappe.utils.formatters.format_value + (value, df, doc=None, currency=None) +
+No docs
++ + + frappe.utils.decode_dict + (d, encoding=utf-8) +
+No docs
++ + + frappe.utils.dict_to_str + (args, sep=&) +
+Converts a dictionary to URL
++ + + frappe.utils.encode_dict + (d, encoding=utf-8) +
+No docs
++ + + frappe.utils.esc + (s, esc_chars) +
+Escape special characters
++ + + frappe.utils.execute_in_shell + (cmd, verbose=0) +
+No docs
++ + + frappe.utils.extract_email_id + (email) +
+fetch only the email part of the email id
++ + + frappe.utils.getCSVelement + (v) +
+Returns the CSV value of v, For example:
+ + + frappe.utils.get_backups_path + () +
+No docs
++ + + frappe.utils.get_common + (d1, d2) +
+returns (list of keys) the common part of two dicts
++ + + frappe.utils.get_common_dict + (d1, d2) +
+return common dictionary of d1 and d2
++ + + frappe.utils.get_defaults + (key=None) +
+Get dictionary of default values from the defaults, or a value if key is passed
++ + + frappe.utils.get_diff_dict + (d1, d2) +
+return common dictionary of d1 and d2
++ + + frappe.utils.get_disk_usage + () +
+get disk usage of files folder
++ + + frappe.utils.get_file_timestamp + (fn) +
+Returns timestamp of the given file
++ + + frappe.utils.get_files_path + () +
+No docs
++ + + frappe.utils.get_formatted_email + (user) +
+get email id of user formatted as: John Doe johndoe@example.com
++ + + frappe.utils.get_fullname + (user=None) +
+get the full name (first name + last name) of the user from User
++ + + frappe.utils.get_gravatar + (email) +
+No docs
++ + + frappe.utils.get_hook_method + (hook_name, fallback=None) +
+No docs
++ + + frappe.utils.get_html_format + (print_path) +
+No docs
++ + + frappe.utils.get_path + () +
+No docs
++ + + frappe.utils.get_request_session + (max_retries=3) +
+No docs
++ + + frappe.utils.get_request_site_address + (full_address=False) +
+No docs
++ + + frappe.utils.get_site_base_path + (sites_dir=None, hostname=None) +
+No docs
++ + + frappe.utils.get_site_name + (hostname) +
+No docs
++ + + frappe.utils.get_site_path + () +
+No docs
++ + + frappe.utils.get_sites + (sites_path=None) +
+No docs
++ + + frappe.utils.get_test_client + () +
+No docs
++ + + frappe.utils.get_traceback + () +
+Returns the traceback of the Exception
++ + + frappe.utils.is_markdown + (text) +
+No docs
++ + + frappe.utils.log + (event, details) +
+No docs
++ + + frappe.utils.make_esc + (esc_chars) +
+Function generator for Escaping special characters
++ + + frappe.utils.pprint_dict + (d, level=1, no_blanks=True) +
+Pretty print a dictionary with indents
++ + + frappe.utils.random_string + (length) +
+generate a random string
++ + + frappe.utils.remove_blanks + (d) +
+Returns d with empty ('' or None) values stripped
++ + + frappe.utils.set_default + (key, val) +
+Set / add a default value to defaults`
++ + + frappe.utils.split_emails + (txt) +
+No docs
++ + + frappe.utils.strip_html_tags + (text) +
+Remove html tags from text
++ + + frappe.utils.touch_file + (path) +
+No docs
++ + + frappe.utils.unesc + (s, esc_chars) +
+UnEscape special characters
++ + + frappe.utils.update_progress_bar + (txt, i, l) +
+No docs
++ + + frappe.utils.validate_email_add + (email_str, throw=False) +
+Validates the email string
++ + + frappe.utils.image.resize_images + (path, maxdim=700) +
+No docs
++ + + frappe.utils.install.add_country_and_currency + (name, country) +
+No docs
++ + + frappe.utils.install.after_install + () +
+No docs
++ + + frappe.utils.install.before_install + () +
+No docs
++ + + frappe.utils.install.before_tests + () +
+No docs
++ + + frappe.utils.install.get_admin_password + () +
+No docs
++ + + frappe.utils.install.import_country_and_currency + () +
+No docs
++ + + frappe.utils.jinja.get_allowed_functions_for_jenv + () +
+No docs
++ + + frappe.utils.jinja.get_jenv + () +
+No docs
++ + + frappe.utils.jinja.get_jloader + () +
+No docs
++ + + frappe.utils.jinja.get_template + (path) +
+No docs
++ + + frappe.utils.jinja.render_include + (content) +
+No docs
++ + + frappe.utils.jinja.render_template + (template, context, is_path=None) +
+No docs
++ + + frappe.utils.jinja.set_filters + (jenv) +
+No docs
++ + + frappe.utils.make_random.add_random_children + (doc, fieldname, rows, randomize, unique=None) +
+No docs
++ + + frappe.utils.make_random.can_make + (doctype) +
+No docs
++ + + frappe.utils.make_random.get_random + (doctype, filters=None) +
+No docs
++ + + frappe.utils.make_random.how_many + (doctype) +
+No docs
+Inherits from __builtin__.object + +
+ + + _action + (self, action) +
+do something! What you do is determined by the argument: +1 Output A. Copy B to A. Get the next B. +2 Copy B to A. Get the next B. (Delete A). +3 Get the next B. (Delete B). +action treats a string as a single character. Wow! +action recognizes a regular expression if it is preceded by ( or , or =.
++ + + _get + (self) +
+return the next character from stdin. Watch out for lookahead. If +the character is a control character, translate it to a space or +linefeed.
++ + + _jsmin + (self) +
+Copy the input to the output, deleting the characters which are +insignificant to JavaScript. Comments will be removed. Tabs will be +replaced with spaces. Carriage returns will be replaced with linefeeds. +Most spaces and linefeeds will be removed.
++ + + _next + (self) +
+get the next character, excluding comments. peek() is used to see +if an unescaped '/' is followed by a '/' or '*'.
++ + + _outA + (self) +
+No docs
++ + + _outB + (self) +
+No docs
++ + + _peek + (self) +
+No docs
++ + + minify + (self, instream, outstream) +
+No docs
+Inherits from exceptions.Exception + +
Inherits from exceptions.Exception + +
Inherits from exceptions.Exception + +
+ + + frappe.utils.minify.isAlphanum + (c) +
+return true if the character is a letter, digit, underscore, +dollar sign, or non-ASCII character.
++ + + frappe.utils.minify.jsmin + (js) +
+No docs
++ + + frappe.utils.momentjs.get_all_timezones + () +
+No docs
++ + + frappe.utils.momentjs.update + (tz, out) +
+No docs
+Inherits from frappe.model.document.Document + +
+ + + after_rename + (self, olddn, newdn, merge=False) +
+No docs
++ + + before_rename + (self, olddn, newdn, merge=False, group_fname=is_group) +
+No docs
++ + + get_ancestors + (self) +
+No docs
++ + + on_trash + (self) +
+No docs
++ + + on_update + (self) +
+No docs
++ + + validate_ledger + (self, group_identifier=is_group) +
+No docs
++ + + validate_one_root + (self) +
+No docs
+Inherits from frappe.exceptions.ValidationError + +
Inherits from frappe.exceptions.ValidationError + +
Inherits from frappe.exceptions.ValidationError + +
Inherits from frappe.exceptions.ValidationError + +
+ + + frappe.utils.nestedset.get_ancestors_of + (doctype, name) +
+Get ancestor elements of a DocType with a tree structure
++ + + frappe.utils.nestedset.get_root_of + (doctype) +
+Get root element of a DocType with a tree structure
++ + + frappe.utils.nestedset.rebuild_node + (doctype, parent, left, parent_field) +
+reset lft, rgt and recursive call for all children
++ + + frappe.utils.nestedset.rebuild_tree + (doctype, parent_field) +
+call rebuild_node for all root nodes
++ + + frappe.utils.nestedset.update_add_node + (doc, parent, parent_field) +
+insert a new node
++ + + frappe.utils.nestedset.update_move_node + (doc, parent_field) +
+No docs
++ + + frappe.utils.nestedset.update_nsm + (doc) +
+No docs
++ + + frappe.utils.nestedset.validate_loop + (doctype, name, lft, rgt) +
+check if item not an ancestor (loop)
++ + + frappe.utils.pdf.get_pdf + (html, options=None) +
+No docs
+Inherits from redis.client.Redis + +
Redis client that will automatically prefix conf.db_name
++ + + delete_key + (self) +
+No docs
++ + + delete_keys + (self, key) +
+Delete keys with wildcard *.
+ + + delete_value + (self, keys, user=None, make_keys=True) +
+Delete value, list of values.
++ + + get_all + (self, key) +
+No docs
++ + + get_keys + (self, key) +
+Return keys starting with key.
+ + + get_value + (self, key, generator=None, user=None) +
+Returns cache value. If not found and generator function is +given, it will call the generator.
+ +param key: Cache key.
+param generator: Function to be called to generate a value if None is returned.
+ + + hdel + (self, name, key) +
+No docs
++ + + hdel_keys + (self, name_starts_with, key) +
+Delete hash names with wildcard * and key
+ + + hget + (self, name, key, generator=None) +
+No docs
++ + + hkeys + (self, name) +
+No docs
++ + + hset + (self, name, key, value) +
+No docs
++ + + make_key + (self, key, user=None) +
+No docs
++ + + set_value + (self, key, val, user=None) +
+Sets cache value.
++ + + frappe.utils.response.as_csv + () +
+No docs
++ + + frappe.utils.response.as_json + () +
+No docs
++ + + frappe.utils.response.as_page + () +
+print web page
++ + + frappe.utils.response.as_raw + () +
+No docs
++ + + frappe.utils.response.build_response + (response_type=None) +
+No docs
++ + + frappe.utils.response.download_backup + (path) +
+No docs
++ + + frappe.utils.response.handle_session_stopped + () +
+No docs
++ + + frappe.utils.response.json_handler + (obj) +
+serialize non-serializable data for json
++ + + frappe.utils.response.make_logs + (response=None) +
+make strings for msgprint and errprint
++ + + frappe.utils.response.redirect + () +
+No docs
++ + + frappe.utils.response.report_error + (status_code) +
+No docs
++ + + frappe.utils.response.send_private_file + (path) +
+No docs
+Events: + always + daily + monthly + weekly
++ + + frappe.utils.scheduler.disable_scheduler + () +
+No docs
++ + + frappe.utils.scheduler.enable_scheduler + () +
+No docs
++ + + frappe.utils.scheduler.enqueue_applicable_events + (site, nowtime, last) +
+No docs
++ + + frappe.utils.scheduler.enqueue_events + (site) +
+No docs
++ + + frappe.utils.scheduler.get_enabled_scheduler_events + () +
+No docs
++ + + frappe.utils.scheduler.get_error_report + (from_date=None, to_date=None, limit=10) +
+No docs
++ + + frappe.utils.scheduler.get_errors + (from_date, to_date, limit) +
+No docs
++ + + frappe.utils.scheduler.is_scheduler_disabled + () +
+No docs
++ + + frappe.utils.scheduler.log + (method, message=None) +
+log error in patch_log
++ + + frappe.utils.scheduler.toggle_scheduler + (enable) +
+No docs
++ + + frappe.utils.scheduler.trigger + (site, event, now=False) +
+trigger method in startup.schedule_handler
++ + + frappe.utils.sel.add_child + (fieldname) +
+No docs
++ + + frappe.utils.sel.close + () +
+No docs
++ + + frappe.utils.sel.done_add_child + (fieldname) +
+No docs
++ + + frappe.utils.sel.execute_script + (js) +
+No docs
++ + + frappe.utils.sel.find + (selector, everywhere=False) +
+No docs
++ + + frappe.utils.sel.get + (url) +
+No docs
++ + + frappe.utils.sel.get_localhost + () +
+No docs
++ + + frappe.utils.sel.get_wait + () +
+No docs
++ + + frappe.utils.sel.go_to_module + (module_name, item=None) +
+No docs
++ + + frappe.utils.sel.login + (wait_for_id=#page-desktop) +
+No docs
++ + + frappe.utils.sel.new_doc + (module, doctype) +
+No docs
++ + + frappe.utils.sel.primary_action + () +
+No docs
++ + + frappe.utils.sel.scroll_to + (selector) +
+No docs
++ + + frappe.utils.sel.set_field + (fieldname, value, fieldtype=input) +
+No docs
++ + + frappe.utils.sel.set_input + (selector, text, key=None) +
+No docs
++ + + frappe.utils.sel.set_select + (fieldname, value) +
+No docs
++ + + frappe.utils.sel.signal_handler + (signal, frame) +
+No docs
++ + + frappe.utils.sel.start + (verbose=None, driver=None) +
+No docs
++ + + frappe.utils.sel.start_test_server + (verbose) +
+No docs
++ + + frappe.utils.sel.wait + (selector, everywhere=False) +
+No docs
++ + + frappe.utils.sel.wait_for_ajax + () +
+No docs
++ + + frappe.utils.sel.wait_for_page + (name) +
+No docs
++ + + frappe.utils.sel.wait_for_state + (state) +
+No docs
++ + + frappe.utils.sel.wait_till_clickable + (selector) +
+No docs
++ + + frappe.utils.sel.wait_till_visible + (selector) +
+No docs
+Automatically setup docs for a project
+ +Call from command line:
+ +bench setup-docs app path
+
+Inherits from __builtin__.object + +
+ + + __init__ + (self, app) +
+Generate source templates for models reference and module API
+and templates at templates/autodoc
+ + + build + (self, docs_version) +
+Build templates for docs models and Python API
++ + + build_user_docs + (self) +
+Build templates for user docs pages, if missing.
++ + + copy_assets + (self) +
+Copy jquery, bootstrap and other assets to files
++ + + is_py_module + (self, basepath, folders, files) +
+No docs
++ + + make_docs + (self, target, local=False) +
+No docs
++ + + make_folder + (self, path, template=None, context=None) +
+No docs
++ + + make_home_pages + (self) +
+Make standard home pages for docs, developer docs, api and models +from templates
++ + + setup_app_context + (self) +
+No docs
++ + + sync_docs + (self) +
+Sync docs from /docs folder to Web Page.
+ +Called as bench --site [sitename] sync-docs [appname]
+ + + update_index_txt + (self, path) +
+No docs
++ + + write_files + (self) +
+render templates and write files to target folder
++ + + write_model_file + (self, basepath, module, doctype) +
+No docs
++ + + write_modules + (self, basepath, folders, files) +
+No docs
+A user permission object can be accessed as frappe.get_user()
+ + + __init__ + (self, name=) +
+No docs
++ + + _get + (self, key) +
+No docs
++ + + build_doctype_map + (self) +
+build map of special doctype properties
++ + + build_perm_map + (self) +
+build map of permissions at level 0
++ + + build_permissions + (self) +
+build lists of what the user can read / write / create +quirks: + readonly => Not in Search + increate => Not in create
++ + + get_block_modules + (self) +
+Returns list of blocked modules
++ + + get_can_read + (self) +
+return list of doctypes that the user can read
++ + + get_defaults + (self) +
+No docs
++ + + get_roles + (self) +
+get list of roles
++ + + load_user + (self) +
+No docs
++ + + setup_user + (self) +
+No docs
++ + + update_recent + (self, dt, dn) +
+No docs
++ + + frappe.utils.user.add_role + (user, role) +
+No docs
++ + + frappe.utils.user.add_system_manager + (email, first_name=None, last_name=None) +
+No docs
++ + + frappe.utils.user.get_enabled_system_users + () +
+No docs
++ + + frappe.utils.user.get_fullname_and_avatar + (user) +
+No docs
++ + + frappe.utils.user.get_roles + (user=None, with_standard=True) +
+get roles of current user
++ + + frappe.utils.user.get_system_managers + (only_name=False) +
+returns all system manager's user details
++ + + frappe.utils.user.get_user_fullname + (user) +
+No docs
++ + + frappe.utils.user.is_system_user + (username) +
+No docs
++ + + frappe.utils.user.is_website_user + () +
+No docs
++ + + frappe.utils.verified_command.get_secret + () +
+No docs
++ + + frappe.utils.verified_command.get_signature + (params, nonce, secret=None) +
+No docs
++ + + frappe.utils.verified_command.get_signed_params + (params) +
+Sign a url by appending &_signature=xxxxx to given params (string or dict).
Parameters:
+ +params - String or dict of parameters.+ + + frappe.utils.verified_command.get_url + (cmd, params, nonce=None, secret=None) +
+No docs
++ + + frappe.utils.verified_command.get_url_using_doc + (doc, cmd) +
+No docs
++ + + frappe.utils.verified_command.verify_request + () +
+Verify if the incoming signed request if it is correct.
++ + + frappe.utils.verified_command.verify_using_doc + (doc, signature, cmd) +
+No docs
++ + + frappe.website.context.add_metatags + (context) +
+No docs
++ + + frappe.website.context.build_context + (context) +
+get_context method of doc or module is supposed to render content templates and push it into context
++ + + frappe.website.context.get_context + (path, args=None) +
+No docs
+Inherits from exceptions.Exception + +
+ + + frappe.website.render.add_csrf_token + (data) +
+No docs
++ + + frappe.website.render.build + (path) +
+No docs
++ + + frappe.website.render.build_json + (path) +
+No docs
++ + + frappe.website.render.build_page + (path) +
+No docs
++ + + frappe.website.render.build_response + (path, data, http_status_code, headers=None) +
+No docs
++ + + frappe.website.render.clear_cache + (path=None) +
+No docs
++ + + frappe.website.render.get_doctype_from_path + (path) +
+No docs
++ + + frappe.website.render.is_ajax + () +
+No docs
++ + + frappe.website.render.render + (path, http_status_code=None) +
+render html page
++ + + frappe.website.render.render_403 + (e, pathname) +
+No docs
++ + + frappe.website.render.render_page + (path) +
+get page html
++ + + frappe.website.render.render_page_by_language + (path) +
+No docs
++ + + frappe.website.render.resolve_from_map + (path) +
+No docs
++ + + frappe.website.render.resolve_path + (path) +
+No docs
++ + + frappe.website.render.set_content_type + (response, data, path) +
+No docs
++ + + frappe.website.router.build_route + (path) +
+No docs
++ + + frappe.website.router.clear_sitemap + () +
+No docs
++ + + frappe.website.router.get_generator_route + (path) +
+No docs
++ + + frappe.website.router.get_generator_routes + () +
+No docs
++ + + frappe.website.router.get_page_route + (path) +
+No docs
++ + + frappe.website.router.get_pages + () +
+No docs
++ + + frappe.website.router.get_route_info + (path) +
+No docs
++ + + frappe.website.router.process_generators + (func) +
+No docs
++ + + frappe.website.router.resolve_route + (path) +
+Returns the page route object based on searching in pages and generators.
+The www folder is also a part of generator Web Page.
The only exceptions are /about and /contact these will be searched in Web Pages
+first before checking the standard pages.
Inherits from __builtin__.object + +
+ + + __init__ + (self, verbose=False, path=None) +
+No docs
++ + + cleanup + (self) +
+No docs
++ + + get_index_txt + (self, basepath, files) +
+No docs
++ + + get_title + (self, fpath, content) +
+No docs
++ + + start + (self, rebuild=False, path=www, apps=None) +
+No docs
++ + + sync_alphabetically + (self, basepath, folders, files, app) +
+No docs
++ + + sync_file + (self, fname, template_path, priority, app) +
+No docs
++ + + sync_folder + (self, basepath, folders, files, app) +
+No docs
++ + + sync_for_app + (self, app) +
+No docs
++ + + sync_index_page + (self, basepath, files, app) +
+No docs
++ + + sync_using_given_index + (self, basepath, folders, files, app) +
+No docs
++ + + frappe.website.statics.sync_statics + (rebuild=False) +
+No docs
++ + + frappe.website.template.add_hero + (out, context) +
+Add a hero element if specified in content or hooks. +Hero elements get full page width.
++ + + frappe.website.template.add_index + (out, context) +
+Add index, next button if {index}, {next} is present.
+ + + frappe.website.template.build_template + (context) +
+Returns a dict of block name and its rendered content
++ + + frappe.website.template.render_blocks + (template_path, out, context) +
+Build the template block by block from the main template.
++ + + frappe.website.template.separate_style_and_script + (out, context) +
+Extract style and script tags into separate blocks
+ + + frappe.website.template.set_breadcrumbs + (out, context) +
+Build breadcrumbs template (deprecated)
++ + + frappe.website.template.set_sidebar + (out, context) +
+Include sidebar (deprecated)
++ + + frappe.website.template.set_title_and_header + (out, context) +
+Extract and set title and header from content or context.
++ + + frappe.website.utils.abs_url + (path) +
+Deconstructs and Reconstructs a URL into an absolute URL or a URL relative from root '/'
++ + + frappe.website.utils.can_cache + (no_cache=False) +
+No docs
++ + + frappe.website.utils.cleanup_page_name + (title) +
+make page name from title
++ + + frappe.website.utils.convert_to_hex + (channel_value) +
+No docs
++ + + frappe.website.utils.delete_page_cache + (path) +
+No docs
++ + + frappe.website.utils.detect_color_format + (color) +
+No docs
++ + + frappe.website.utils.find_first_image + (html) +
+No docs
++ + + frappe.website.utils.format_color + (r, g, b, a, color_format) +
+No docs
++ + + frappe.website.utils.get_comment_list + (doctype, name) +
+No docs
++ + + frappe.website.utils.get_full_index + (route=None, doctype=Web Page, extn=False) +
+Returns full index of the website (on Web Page) upto the n-th level
++ + + frappe.website.utils.get_home_page + () +
+No docs
++ + + frappe.website.utils.get_shade + (color, percent) +
+No docs
++ + + frappe.website.utils.get_shade_for_channel + (channel_value, percent) +
+No docs
++ + + frappe.website.utils.is_signup_enabled + () +
+No docs
+Inherits from frappe.model.document.Document + +
+ + + after_rename + (self, olddn, newdn, merge) +
+No docs
++ + + autoname + (self) +
+No docs
++ + + before_rename + (self, oldname, name, merge) +
+No docs
++ + + clear_cache + (self) +
+No docs
++ + + get_children + (self, context=None) +
+No docs
++ + + get_children_of + (self, route) +
+Return list of children of given route, for generating index in Web Page
++ + + get_next + (self) +
+No docs
++ + + get_or_make_page_name + (self) +
+No docs
++ + + get_page_name + (self) +
+No docs
++ + + get_parent + (self) +
+No docs
++ + + get_parents + (self, context) +
+No docs
++ + + get_route + (self, doc=None) +
+No docs
++ + + get_route_context + (self) +
+No docs
++ + + has_children + (self, route) +
+No docs
++ + + make_page_name + (self) +
+No docs
++ + + on_trash + (self) +
+No docs
++ + + on_update + (self) +
+No docs
++ + + onload + (self) +
+No docs
++ + + set_parent_website_route + (self) +
+No docs
++ + + update_routes_of_descendants + (self, old_route=None) +
+No docs
++ + + validate + (self) +
+No docs
++ + + website_published + (self) +
+No docs
++ + + frappe.website.website_generator.make_route + (doc) +
+No docs
+| + App Name + | +
+ frappe
+ |
+
| + Publisher + | +
+ Frappe Technologies Pvt. Ltd.
+ |
+
| + Version + | +
+ 6.6.1
+ |
+
Table Name: tabAsync Task
| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +status |
+ + Select | ++ Status + + | +
+ +Queued +Running +Succeeded +Failed ++ |
+
| 2 | +task_name |
+ + Data | ++ Task Name + + | ++ |
| 3 | +runtime |
+ + Data | ++ Runtime + + | ++ |
| 4 | +result |
+ + Code | ++ Result + + | ++ |
| 5 | +traceback |
+ + Code | ++ Traceback + + | ++ |
| 6 | +section_break_6 |
+ + Section Break | ++ + + | ++ |
| 7 | +reference_doctype |
+ + Link | ++ Reference DocType + + | ++ + + + +DocType + + + + | +
| 8 | +reference_name |
+ + Dynamic Link | ++ Reference Doc + + | +
+ reference_doctype+ |
+
Inherits from frappe.model.document.Document + +
Table Name: tabBlock Module
| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +module |
+ + Data | ++ Module + + | ++ |
Table Name: tabComment
| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +comment |
+ + Text | ++ Comment + + | ++ |
| 2 | +comment_type |
+ + Data | ++ Comment Type + + | +
+ Email +Chat +Phone +SMS +Created +Submitted +Cancelled +Assigned +Assignment Completed +Comment +Workflow +Label +Attachment +Attachment Removed+ |
+
| 3 | +comment_by |
+ + Data | ++ Comment By + + | ++ |
| 4 | +comment_by_fullname |
+ + Data | ++ Comment By Fullname + + | ++ |
| 5 | +comment_date |
+ + Date | ++ Comment Date + + | ++ |
| 6 | +comment_time |
+ + Data | ++ Comment Time + + | ++ |
| 7 | +comment_doctype |
+ + Data | ++ Comment Doctype + + | ++ |
| 8 | +comment_docname |
+ + Data | ++ Comment Docname + + | ++ |
| 9 | +post_topic |
+ + Data | ++ Post Topic + + | ++ |
| 10 | +unsubscribed |
+ + Check | ++ Unsubscribed + + | ++ |
| 11 | +reference_doctype |
+ + Link | ++ Reference DocType + + | ++ + + + +DocType + + + + | +
| 12 | +reference_name |
+ + Dynamic Link | +
+ Reference Name
+ + Reference DocType and Reference Name are used to render a comment as a link (href) to a Doc. + |
+
+ reference_doctype+ |
+
Inherits from frappe.model.document.Document + +
Comments are added to Documents via forms or views like blogs etc.
++ + + after_insert + (self) +
+Send realtime updates
++ + + get_comments_from_parent + (self) +
+No docs
++ + + get_feed + (self) +
+Returns feed HTML from Comment.
++ + + on_trash + (self) +
+Removes from _comments in parent Document
+ + + on_update + (self) +
+Updates _comments property in parent Document.
+ + + update_comment_in_doc + (self) +
+Updates _comments (JSON) property in parent Document.
+Creates a column _comments if property does not exist.
_comments format
{
+ "comment": [String],
+ "by": [user],
+ "name": [Comment Document name]
+}
+
++ + + update_comments_in_parent + (self, _comments) +
+Updates _comments property in parent Document with given dict.
Parameters:
+ +_comments - Dict of comments.+ + + validate + (self) +
+Raise exception for more than 50 comments.
++ + + frappe.core.doctype.comment.comment.on_doctype_update + () +
+Add index to tabComment (comment_doctype, comment_name)
Table Name: tabCommunication
| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +naming_series |
+ + Select | ++ Series + + | +
+ COMM-+ |
+
| 2 | +communication_medium |
+ + Select | ++ Communication Medium + + | +
+ +Chat +Phone +Email +SMS +Visit +Other+ |
+
| 3 | +recipients |
+ + Data | ++ Recipients + + | ++ |
| 4 | +cc |
+ + Data | ++ CC + + | ++ |
| 5 | +phone_no |
+ + Data | ++ Phone No. + + | ++ |
| 6 | +column_break_5 |
+ + Column Break | ++ + + | ++ |
| 7 | +status |
+ + Select | ++ Status + + | +
+ Open +Replied +Closed +Linked+ |
+
| 8 | +sent_or_received |
+ + Select | ++ Sent or Received + + | +
+ Sent +Received+ |
+
| 9 | +delivery_status |
+ + Select | +
+ Delivery Status
+ + Integrations can use this field to set email delivery status + |
+
+ +Sent +Bounced +Opened +Marked As Spam +Rejected +Delayed +Soft-Bounced +Clicked +Recipient Unsubscribed+ |
+
| 10 | +section_break_10 |
+ + Section Break | ++ + + | ++ |
| 11 | +subject |
+ + Data | ++ Subject + + | ++ |
| 12 | +section_break_8 |
+ + Section Break | ++ + + | ++ |
| 13 | +content |
+ + Text Editor | ++ Content + + | ++ |
| 14 | +additional_info |
+ + Section Break | ++ More Information + + | ++ |
| 15 | +sender |
+ + Data | ++ Sender + + | ++ |
| 16 | +sender_full_name |
+ + Data | ++ Sender Full Name + + | ++ |
| 17 | +communication_date |
+ + Datetime | ++ Date + + | ++ |
| 18 | +column_break_14 |
+ + Column Break | ++ + + | ++ |
| 19 | +reference_doctype |
+ + Link | ++ Reference DocType + + | ++ + + + +DocType + + + + | +
| 20 | +reference_name |
+ + Dynamic Link | ++ Reference Name + + | +
+ reference_doctype+ |
+
| 21 | +in_reply_to |
+ + Link | ++ In Reply To + + | ++ + + + +Communication + + + + | +
| 22 | +email_account |
+ + Link | ++ Email Account + + | ++ + + + +Email Account + + + + | +
| 23 | +user |
+ + Link | ++ User + + | ++ + + + +User + + + + | +
| 24 | +unread_notification_sent |
+ + Check | ++ Unread Notification Sent + + | ++ |
| 25 | +_user_tags |
+ + Data | ++ User Tags + + | ++ |
Inherits from frappe.model.document.Document + +
+ + + _notify + (self, print_html=None, print_format=None, attachments=None, recipients=None, cc=None) +
+No docs
++ + + after_insert + (self) +
+No docs
++ + + filter_email_list + (self, email_list, exclude, is_cc=False) +
+No docs
++ + + get_assignees + (self) +
+No docs
++ + + get_attach_link + (self, print_format) +
+Returns public link for the attachment via templates/emails/print_link.html.
+ + + get_cc + (self, recipients=None, fetched_from_email_account=False) +
+Build a list of email addresses for CC
++ + + get_owner_email + (self) +
+No docs
++ + + get_parent_doc + (self) +
+Returns document of reference_doctype, reference_doctype
+ + + get_recipients + (self, fetched_from_email_account=False) +
+Build a list of email addresses for To
++ + + get_recipients_and_cc + (self, recipients, cc, fetched_from_email_account=False) +
+No docs
++ + + get_starrers + (self) +
+Return list of users who have starred this document.
++ + + notify + (self, print_html=None, print_format=None, attachments=None, recipients=None, cc=None, fetched_from_email_account=False) +
+Calls a delayed celery task 'sendmail' that enqueus email in Bulk Email queue
+ +Parameters:
+ +print_html - Send given value as HTML attachmentprint_format - Attach print format of parent documentattachments - A list of filenames that should be attached when sending this emailrecipients - Email recipientscc - Send email as CC tofetched_from_email_account - True when pulling email, the notification shouldn't go to the main recipient+ + + on_update + (self) +
+Update parent status as Open or Replied.
+ + + prepare_to_notify + (self, print_html=None, print_format=None, attachments=None) +
+Prepare to make multipart MIME Email
+ +Parameters:
+ +print_html - Send given value as HTML attachment.print_format - Attach print format of parent document.+ + + send + (self, print_html=None, print_format=None, attachments=None, send_me_a_copy=False, recipients=None) +
+Send communication via Email.
+ +Parameters:
+ +print_html - Send given value as HTML attachment.print_format - Attach print format of parent document.+ + + set_incoming_outgoing_accounts + (self) +
+No docs
++ + + update_parent + (self) +
+Update status of parent document based on who is replying.
++ + + validate + (self) +
+No docs
+Public API
+ /api/method/frappe.core.doctype.communication.communication.get_convert_to
+
+ + + frappe.core.doctype.communication.communication.get_convert_to + () +
+No docs
+Public API
+ /api/method/frappe.core.doctype.communication.communication.make
+
+ + + frappe.core.doctype.communication.communication.make + (doctype=None, name=None, content=None, subject=None, sent_or_received=Sent, sender=None, recipients=None, communication_medium=Email, send_email=False, print_html=None, print_format=None, attachments=[], ignore_doctype_permissions=False, send_me_a_copy=False, cc=None) +
+Make a new communication.
+ +Parameters:
+ +doctype - Reference DocType.name - Reference Document name.content - Communication body.subject - Communication subject.sent_or_received - Sent or Received (default Sent).sender - Communcation sender (default current user).recipients - Communication recipients as list.communication_medium - Medium of communication (default Email).send_mail - Send via email (default False).print_html - HTML Print format to be sent as attachment.print_format - Print Format name of parent document to be sent as attachment.attachments - List of attachments as list of files or JSON string.send_me_a_copy - Send a copy to the sender (default False).+ + + frappe.core.doctype.communication.communication.on_doctype_update + () +
+Add index in tabCommunication for (reference_doctype, reference_name)
Table Name: tabDefaultValue
| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +defkey |
+ + Data | ++ Key + + | ++ |
| 2 | +defvalue |
+ + Text | ++ Value + + | ++ |
Table Name: tabDocField
| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +label_and_type |
+ + Section Break | ++ + + | ++ |
| 2 | +label |
+ + Data | ++ Label + + | ++ |
| 3 | +fieldtype |
+ + Select | ++ Type + + | +
+ Attach +Attach Image +Button +Check +Code +Column Break +Currency +Data +Date +Datetime +Dynamic Link +Float +Fold +Heading +HTML +Image +Int +Link +Long Text +Password +Percent +Read Only +Section Break +Select +Small Text +Table +Text +Text Editor +Time+ |
+
| 4 | +fieldname |
+ + Data | ++ Name + + | ++ |
| 5 | +reqd |
+ + Check | ++ Mandatory + + | ++ |
| 6 | +precision |
+ + Select | +
+ Precision
+ + Set non-standard precision for a Float or Currency field + |
+
+ +1 +2 +3 +4 +5 +6 +7 +8 +9+ |
+
| 7 | +length |
+ + Int | ++ Length + + | ++ |
| 8 | +search_index |
+ + Check | ++ Index + + | ++ |
| 9 | +in_list_view |
+ + Check | ++ In List View + + | ++ |
| 10 | +bold |
+ + Check | ++ Bold + + | ++ |
| 11 | +collapsible |
+ + Check | ++ Collapsible + + | ++ |
| 12 | +collapsible_depends_on |
+ + Small Text | ++ Collapsible Depends On + + | ++ |
| 13 | +column_break_6 |
+ + Column Break | ++ + + | ++ |
| 14 | +options |
+ + Text | +
+ Options
+ + For Links, enter the DocType as range. +For Select, enter list of Options, each on a new line. + |
+ + |
| 15 | +default |
+ + Small Text | ++ Default + + | ++ |
| 16 | +permissions |
+ + Section Break | ++ Permissions + + | ++ |
| 17 | +depends_on |
+ + Small Text | ++ Depends On + + | ++ |
| 18 | +hidden |
+ + Check | ++ Hidden + + | ++ |
| 19 | +read_only |
+ + Check | ++ Read Only + + | ++ |
| 20 | +unique |
+ + Check | ++ Unique + + | ++ |
| 21 | +set_only_once |
+ + Check | +
+ Set Only Once
+ + Do not allow user to change after set the first time + |
+ + |
| 22 | +column_break_13 |
+ + Column Break | ++ + + | ++ |
| 23 | +permlevel |
+ + Int | ++ Perm Level + + | ++ |
| 24 | +ignore_user_permissions |
+ + Check | +
+ Ignore User Permissions
+ + User permissions should not apply for this Link + |
+ + |
| 25 | +allow_on_submit |
+ + Check | ++ Allow on Submit + + | ++ |
| 26 | +report_hide |
+ + Check | ++ Report Hide + + | ++ |
| 27 | +display |
+ + Section Break | ++ Display + + | ++ |
| 28 | +in_filter |
+ + Check | ++ In Filter + + | ++ |
| 29 | +no_copy |
+ + Check | ++ No Copy + + | ++ |
| 30 | +print_hide |
+ + Check | ++ Print Hide + + | ++ |
| 31 | +print_width |
+ + Data | ++ Print Width + + | ++ |
| 32 | +width |
+ + Data | ++ Width + + | ++ |
| 33 | +column_break_22 |
+ + Column Break | ++ + + | ++ |
| 34 | +description |
+ + Small Text | ++ Description + + | ++ |
| 35 | +oldfieldname |
+ + Data | ++ + + | ++ |
| 36 | +oldfieldtype |
+ + Data | ++ + + | ++ |
Table Name: tabDocPerm
| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +role_and_level |
+ + Section Break | ++ Role and Level + + | ++ |
| 2 | +role |
+ + Link | ++ Role + + | ++ + + + +Role + + + + | +
| 3 | +apply_user_permissions |
+ + Check | +
+ Apply User Permissions
+ + Filter records based on User Permissions defined for a user + |
+ + |
| 4 | +if_owner |
+ + Check | +
+ If user is the owner
+ + Apply this rule if the User is the Owner + |
+ + |
| 5 | +column_break_2 |
+ + Column Break | ++ + + | ++ |
| 6 | +permlevel |
+ + Int | ++ Level + + | ++ |
| 7 | +user_permission_doctypes |
+ + Text | +
+ User Permission DocTypes
+ + JSON list of DocTypes used to apply User Permissions. If empty, all linked DocTypes will be used to apply User Permissions. + |
+ + |
| 8 | +section_break_4 |
+ + Section Break | ++ Permissions + + | ++ |
| 9 | +read |
+ + Check | ++ Read + + | ++ |
| 10 | +write |
+ + Check | ++ Write + + | ++ |
| 11 | +create |
+ + Check | ++ Create + + | ++ |
| 12 | +delete |
+ + Check | ++ Delete + + | ++ |
| 13 | +column_break_8 |
+ + Column Break | ++ + + | ++ |
| 14 | +submit |
+ + Check | ++ Submit + + | ++ |
| 15 | +cancel |
+ + Check | ++ Cancel + + | ++ |
| 16 | +amend |
+ + Check | ++ Amend + + | ++ |
| 17 | +additional_permissions |
+ + Section Break | ++ Additional Permissions + + | ++ |
| 18 | +report |
+ + Check | ++ Report + + | ++ |
| 19 | +export |
+ + Check | ++ Export + + | ++ |
| 20 | +import |
+ + Check | ++ Import + + | ++ |
| 21 | +set_user_permissions |
+ + Check | +
+ Set User Permissions
+ + This role update User Permissions for a user + |
+ + |
| 22 | +column_break_19 |
+ + Column Break | ++ + + | ++ |
| 23 | +share |
+ + Check | ++ Share + + | ++ |
| 24 | +print |
+ + Check | ++ Print + + | ++ |
| 25 | +email |
+ + Check | ++ Email + + | ++ |
Table Name: tabDocShare
| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +user |
+ + Link | ++ User + + | ++ + + + +User + + + + | +
| 2 | +share_doctype |
+ + Link | ++ Document Type + + | ++ + + + +DocType + + + + | +
| 3 | +share_name |
+ + Dynamic Link | ++ Document Name + + | +
+ share_doctype+ |
+
| 4 | +read |
+ + Check | ++ Read + + | ++ |
| 5 | +write |
+ + Check | ++ Write + + | ++ |
| 6 | +share |
+ + Check | ++ Share + + | ++ |
| 7 | +everyone |
+ + Check | ++ Everyone + + | ++ |
Inherits from frappe.model.document.Document + +
+ + + after_insert + (self) +
+No docs
++ + + cascade_permissions_downwards + (self) +
+No docs
++ + + check_share_permission + (self) +
+No docs
++ + + get_doc + (self) +
+No docs
++ + + on_trash + (self) +
+No docs
++ + + validate + (self) +
+No docs
++ + + validate_user + (self) +
+No docs
++ + + frappe.core.doctype.docshare.docshare.on_doctype_update + () +
+Add index in tabDocShare for (user, share_doctype)
Table Name: tabFile
| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +file_name |
+ + Data | ++ File Name + + | ++ |
| 2 | +preview |
+ + Section Break | ++ Preview + + | ++ |
| 3 | +preview_html |
+ + HTML | ++ Preview HTML + + | ++ |
| 4 | +section_break_5 |
+ + Section Break | ++ + + | ++ |
| 5 | +is_home_folder |
+ + Check | ++ Is Home Folder + + | ++ |
| 6 | +is_attachments_folder |
+ + Check | ++ Is Attachments Folder + + | ++ |
| 7 | +file_size |
+ + Int | ++ File Size + + | ++ |
| 8 | +column_break_5 |
+ + Column Break | ++ + + | ++ |
| 9 | +file_url |
+ + Data | ++ File URL + + | ++ |
| 10 | +thumbnail_url |
+ + Data | ++ Thumbnail URL + + | ++ |
| 11 | +folder |
+ + Link | ++ Folder + + | ++ + + + +File + + + + | +
| 12 | +is_folder |
+ + Check | ++ Is Folder + + | ++ |
| 13 | +section_break_8 |
+ + Section Break | ++ + + | ++ |
| 14 | +attached_to_doctype |
+ + Link | ++ Attached To DocType + + | ++ + + + +DocType + + + + | +
| 15 | +column_break_10 |
+ + Column Break | ++ + + | ++ |
| 16 | +attached_to_name |
+ + Data | ++ Attached To Name + + | ++ |
| 17 | +content_hash |
+ + Data | ++ Content Hash + + | ++ |
| 18 | +lft |
+ + Int | ++ lft + + | ++ |
| 19 | +rgt |
+ + Int | ++ rgt + + | ++ |
| 20 | +old_parent |
+ + Data | ++ old_parent + + | ++ |
Inherits from frappe.utils.nestedset.NestedSet + +
+ + + after_delete + (self) +
+No docs
++ + + after_insert + (self) +
+No docs
++ + + after_rename + (self, olddn, newdn, merge=False) +
+No docs
++ + + before_insert + (self) +
+No docs
++ + + check_folder_is_empty + (self) +
+Throw exception if folder is not empty
++ + + check_reference_doc_permission + (self) +
+Check if permission exists for reference document
++ + + delete_file + (self) +
+If file not attached to any other record, delete it
++ + + get_folder_size + (self, folder=None) +
+Returns folder size for current folder
++ + + get_name_based_on_parent_folder + (self) +
+No docs
++ + + get_successor + (self) +
+No docs
++ + + make_thumbnail + (self) +
+No docs
++ + + on_rollback + (self) +
+No docs
++ + + on_trash + (self) +
+No docs
++ + + set_folder_name + (self) +
+Make parent folders if not exists based on reference doctype and name
++ + + set_folder_size + (self) +
+Set folder size if folder
++ + + set_name + (self) +
+Set name for folder
++ + + update_parent_folder_size + (self) +
+Update size of parent folder
++ + + validate + (self) +
+No docs
++ + + validate_duplicate_entry + (self) +
+No docs
++ + + validate_folder + (self) +
+No docs
+Inherits from frappe.exceptions.ValidationError + +
Public API
+ /api/method/frappe.core.doctype.file.file.create_new_folder
+
+ + + frappe.core.doctype.file.file.create_new_folder + (file_name, folder) +
+create new folder under current parent folder
+Public API
+ /api/method/frappe.core.doctype.file.file.get_breadcrumbs
+
+ + + frappe.core.doctype.file.file.get_breadcrumbs + (folder) +
+returns name, file_name of parent folder
++ + + frappe.core.doctype.file.file.make_home_folder + () +
+No docs
+Public API
+ /api/method/frappe.core.doctype.file.file.move_file
+
+ + + frappe.core.doctype.file.file.move_file + (file_list, new_parent, old_parent) +
+No docs
++ + + frappe.core.doctype.file.file.on_doctype_update + () +
+No docs
++ + + frappe.core.doctype.file.file.setup_folder_path + (filename, new_parent) +
+No docs
+Table Name: tabModule Def
| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +module_name |
+ + Data | ++ Module Name + + | ++ |
| 2 | +app_name |
+ + Data | ++ App Name + + | ++ |
Inherits from frappe.model.document.Document + +
+ + + add_to_modules_txt + (self) +
+Adds to [app]/modules.txt
+ + + create_modules_folder + (self) +
+Creates a folder [app]/[module] and adds __init__.py
+ + + on_update + (self) +
+If in developer_mode, create folder for module and
+add in modules.txt of app if missing.
Table Name: tabPage
| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +page_html |
+ + Section Break | ++ Page HTML + + | ++ |
| 2 | +page_name |
+ + Data | ++ Page Name + + | ++ |
| 3 | +title |
+ + Data | ++ Title + + | ++ |
| 4 | +icon |
+ + Data | ++ icon + + | ++ |
| 5 | +column_break0 |
+ + Column Break | ++ + + | ++ |
| 6 | +module |
+ + Link | ++ Module + + | ++ + + + +Module Def + + + + | +
| 7 | +standard |
+ + Select | ++ Standard + + | +
+ +Yes +No+ |
+
| 8 | +section_break0 |
+ + Section Break | ++ + + | ++ |
| 9 | +roles |
+ + Table | ++ Roles + + | ++ + + + +Page Role + + + + | +
Inherits from frappe.model.document.Document + +
+ + + as_dict + (self, no_nulls=False) +
+No docs
++ + + autoname + (self) +
+Creates a url friendly name for this page. +Will restrict the name to 30 characters, if there exists a similar name, +it will add name-1, name-2 etc.
++ + + is_permitted + (self) +
+Returns true if Page Role is not set or the user is allowed.
++ + + load_assets + (self) +
+No docs
++ + + on_update + (self) +
+Writes the .txt for this page and if write_content is checked, +it will write out a .html file
++ + + validate + (self) +
+No docs
+Table Name: tabPage Role
| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +role |
+ + Link | ++ Role + + | ++ + + + +Role + + + + | +
Table Name: tabPatch Log
| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +patch |
+ + Small Text | ++ Patch + + | ++ |
Inherits from frappe.model.document.Document + +
Table Name: tabReport
| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +report_name |
+ + Data | ++ Report Name + + | ++ |
| 2 | +ref_doctype |
+ + Link | ++ Ref DocType + + | ++ + + + +DocType + + + + | +
| 3 | +is_standard |
+ + Select | ++ Is Standard + + | +
+ No +Yes+ |
+
| 4 | +module |
+ + Link | ++ Module + + | ++ + + + +Module Def + + + + | +
| 5 | +add_total_row |
+ + Check | ++ Add Total Row + + | ++ |
| 6 | +column_break_4 |
+ + Column Break | ++ + + | ++ |
| 7 | +report_type |
+ + Select | ++ Report Type + + | +
+ Report Builder +Query Report +Script Report+ |
+
| 8 | +disabled |
+ + Check | ++ Disabled + + | ++ |
| 9 | +apply_user_permissions |
+ + Check | ++ Apply User Permissions + + | ++ |
| 10 | +section_break_6 |
+ + Section Break | ++ + + | ++ |
| 11 | +query |
+ + Code | ++ Query + + | ++ |
| 12 | +javascript |
+ + Code | +
+ Javascript
+ + JavaScript Format: frappe.query_reports['REPORTNAME'] = {} + |
+ + |
| 13 | +json |
+ + Text | ++ JSON + + | ++ |
Inherits from frappe.model.document.Document + +
+ + + create_report_py + (self) +
+No docs
++ + + export_doc + (self) +
+No docs
++ + + on_update + (self) +
+No docs
++ + + toggle_disable + (self, disable) +
+No docs
++ + + validate + (self) +
+only administrator can save standard report
+Table Name: tabRole
| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +role_name |
+ + Data | ++ Role Name + + | ++ |
Inherits from frappe.model.document.Document + +
Table Name: tabScheduler Log
| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +seen |
+ + Check | ++ Seen + + | ++ |
| 2 | +method |
+ + Data | ++ Method + + | ++ |
| 3 | +error |
+ + Text | ++ Error + + | ++ |
Inherits from frappe.model.document.Document + +
+ + + frappe.core.doctype.scheduler_log.scheduler_log.set_old_logs_as_seen + () +
+No docs
+| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +localization |
+ + Section Break | ++ + + | ++ |
| 2 | +language |
+ + Select | ++ Language + + | +
+ Loading...+ |
+
| 3 | +column_break_3 |
+ + Column Break | ++ + + | ++ |
| 4 | +time_zone |
+ + Select | ++ Time Zone + + | ++ |
| 5 | +date_and_number_format |
+ + Section Break | ++ + + | ++ |
| 6 | +date_format |
+ + Select | ++ Date Format + + | +
+ yyyy-mm-dd +dd-mm-yyyy +dd/mm/yyyy +dd.mm.yyyy +mm/dd/yyyy +mm-dd-yyyy+ |
+
| 7 | +column_break_7 |
+ + Column Break | ++ + + | ++ |
| 8 | +number_format |
+ + Select | ++ Number Format + + | +
+ #,###.## +#.###,## +# ###.## +# ###,## +#'###.## +#, ###.## +#,##,###.## +#,###.### +#.### +#,###+ |
+
| 9 | +float_precision |
+ + Select | ++ Float Precision + + | +
+ +2 +3 +4 +5 +6+ |
+
| 10 | +security |
+ + Section Break | ++ Security + + | ++ |
| 11 | +session_expiry |
+ + Data | +
+ Session Expiry
+ + Session Expiry in Hours e.g. 06:00 + |
+ + |
| 12 | +session_expiry_mobile |
+ + Data | +
+ Session Expiry Mobile
+ + In Hours + |
+ + |
| 13 | +column_break_13 |
+ + Column Break | ++ + + | ++ |
| 14 | +enable_scheduler |
+ + Check | +
+ Enable Scheduled Jobs
+ + Run scheduled jobs only if checked + |
+ + |
| 15 | +scheduler_last_event |
+ + Data | ++ Scheduler Last Event + + | ++ |
| 16 | +ignore_user_permissions_if_missing |
+ + Check | +
+ Ignore User Permissions If Missing
+ + eg. If Apply User Permissions is checked for Report DocType but no User Permissions are defined for Report for a User, then all Reports are shown to that User + |
+ + |
| 17 | +email |
+ + Section Break | ++ EMail + + | ++ |
| 18 | +email_footer_address |
+ + Small Text | +
+ Email Footer Address
+ + Your organization name and address for the email footer. + |
+ + |
| 19 | +column_break_18 |
+ + Column Break | ++ + + | ++ |
| 20 | +disable_standard_email_footer |
+ + Check | ++ Disable Standard Email Footer + + | ++ |
Inherits from frappe.model.document.Document + +
+ + + on_update + (self) +
+No docs
++ + + validate + (self) +
+No docs
+Public API
+ /api/method/frappe.core.doctype.system_settings.system_settings.load
+
+ + + frappe.core.doctype.system_settings.system_settings.load + () +
+No docs
+Table Name: tabUser
| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +sb0_5 |
+ + Section Break | ++ + + | ++ |
| 2 | +enabled |
+ + Check | ++ Enabled + + | ++ |
| 3 | +section_break_3 |
+ + Section Break | ++ + + | ++ |
| 4 | +email |
+ + Data | ++ Email + + | +
+ |
+
| 5 | +first_name |
+ + Data | ++ First Name + + | ++ |
| 6 | +middle_name |
+ + Data | ++ Middle Name (Optional) + + | ++ |
| 7 | +last_name |
+ + Data | ++ Last Name + + | ++ |
| 8 | +send_welcome_email |
+ + Check | ++ Send Welcome Email + + | ++ |
| 9 | +unsubscribed |
+ + Check | ++ Unsubscribed + + | ++ |
| 10 | +column_break0 |
+ + Column Break | ++ + + | ++ |
| 11 | +language |
+ + Select | ++ Language + + | +
+ Loading...+ |
+
| 12 | +time_zone |
+ + Select | ++ Timezone + + | ++ |
| 13 | +change_password |
+ + Section Break | ++ + + | ++ |
| 14 | +new_password |
+ + Password | ++ Set New Password + + | ++ |
| 15 | +send_password_update_notification |
+ + Check | ++ Send Password Update Notification + + | ++ |
| 16 | +reset_password_key |
+ + Data | ++ Reset Password Key + + | ++ |
| 17 | +display_settings |
+ + Section Break | ++ + + | ++ |
| 18 | +user_image |
+ + Attach | +
+ User Image
+ + Get your globally recognized avatar from Gravatar.com + |
+ + |
| 19 | +cb21 |
+ + Column Break | ++ + + | ++ |
| 20 | +user_image_show |
+ + Image | ++ user_image_show + + | +
+ user_image+ |
+
| 21 | +email_settings |
+ + Section Break | ++ Email Settings + + | ++ |
| 22 | +thread_notify |
+ + Check | ++ Send Notifications for Transactions I Follow + + | ++ |
| 23 | +email_signature |
+ + Small Text | ++ Email Signature + + | ++ |
| 24 | +background |
+ + Section Break | ++ + + | ++ |
| 25 | +background_image |
+ + Attach | ++ Background Image + + | ++ |
| 26 | +background_style |
+ + Select | ++ Background Style + + | +
+ Fill Screen +Tile+ |
+
| 27 | +short_bio |
+ + Section Break | ++ + + | ++ |
| 28 | +gender |
+ + Select | ++ Gender + + | +
+ +Male +Female +Other+ |
+
| 29 | +birth_date |
+ + Date | ++ Birth Date + + | ++ |
| 30 | +location |
+ + Data | ++ Location + + | ++ |
| 31 | +column_break_22 |
+ + Column Break | ++ + + | ++ |
| 32 | +bio |
+ + Small Text | ++ Bio + + | ++ |
| 33 | +sb1 |
+ + Section Break | +
+ Roles
+ + Check / Uncheck roles assigned to the User. Click on the Role to find out what permissions that Role has. + |
+ + |
| 34 | +roles_html |
+ + HTML | ++ Roles HTML + + | ++ |
| 35 | +user_roles |
+ + Table | ++ Roles Assigned + + | ++ + + + +UserRole + + + + | +
| 36 | +modules_access |
+ + Section Break | +
+ Modules Access
+ + Uncheck modules to hide from user's desktop + |
+ + |
| 37 | +modules_html |
+ + HTML | ++ Modules HTML + + | ++ |
| 38 | +block_modules |
+ + Table | ++ Block Modules + + | ++ + + + +Block Module + + + + | +
| 39 | +sb2 |
+ + Section Break | +
+ Defaults
+ + These values will be automatically updated in transactions and also will be useful to restrict permissions for this user on transactions containing these values. + |
+ + |
| 40 | +defaults |
+ + Table | +
+ User Defaults
+ + Enter default value fields (keys) and values. If you add multiple values for a field, the first one will be picked. These defaults are also used to set "match" permission rules. To see list of fields, go to "Customize Form". + |
+ + + + + +DefaultValue + + + + | +
| 41 | +sb3 |
+ + Section Break | ++ Security Settings + + | ++ |
| 42 | +user_type |
+ + Select | +
+ User Type
+ + User Type "System User" can access Desktop. "Website User" can only be logged into the website and portal pages. + |
+
+ System User +Website User+ |
+
| 43 | +login_after |
+ + Int | +
+ Login After
+ + Allow user to login only after this hour (0-24) + |
+ + |
| 44 | +login_before |
+ + Int | +
+ Login Before
+ + Allow user to login only before this hour (0-24) + |
+ + |
| 45 | +restrict_ip |
+ + Data | +
+ Restrict IP
+ + Restrict user from this IP address only. Multiple IP addresses can be added by separating with commas. Also accepts partial IP addresses like (111.111.111) + |
+ + |
| 46 | +column_break1 |
+ + Column Break | ++ + + | ++ |
| 47 | +last_login |
+ + Read Only | ++ Last Login + + | ++ |
| 48 | +last_ip |
+ + Read Only | ++ Last IP + + | ++ |
| 49 | +last_known_versions |
+ + Text | +
+ Last Known Versions
+ + Stores the JSON of last known versions of various installed apps. It is used to show release notes. + |
+ + |
| 50 | +third_party_authentication |
+ + Section Break | ++ Third Party Authentication + + | ++ |
| 51 | +fb_username |
+ + Data | ++ Facebook Username + + | ++ |
| 52 | +fb_userid |
+ + Data | ++ Facebook User ID + + | ++ |
| 53 | +google_userid |
+ + Data | ++ Google User ID + + | ++ |
| 54 | +column_break_49 |
+ + Column Break | ++ + + | ++ |
| 55 | +github_userid |
+ + Data | ++ Github User ID + + | ++ |
| 56 | +github_username |
+ + Data | ++ Github Username + + | ++ |
Inherits from frappe.model.document.Document + +
+ + + a_system_manager_should_exist + (self) +
+No docs
++ + + add_roles + (self) +
+Add roles to user and save
++ + + add_system_manager_role + (self) +
+No docs
++ + + after_rename + (self, olddn, newdn, merge=False) +
+No docs
++ + + append_roles + (self) +
+Add roles to user
++ + + autoname + (self) +
+set name as email id
++ + + before_rename + (self, olddn, newdn, merge=False) +
+No docs
++ + + check_enable_disable + (self) +
+No docs
++ + + email_new_password + (self, new_password=None) +
+No docs
++ + + ensure_unique_roles + (self) +
+No docs
++ + + get_fullname + (self) +
+get firstname space lastname
++ + + get_other_system_managers + (self) +
+No docs
++ + + on_trash + (self) +
+No docs
++ + + on_update + (self) +
+No docs
++ + + password_reset_mail + (self, link) +
+No docs
++ + + password_update_mail + (self, password) +
+No docs
++ + + remove_all_roles_for_guest + (self) +
+No docs
++ + + remove_roles + (self) +
+No docs
++ + + reset_password + (self) +
+No docs
++ + + send_login_mail + (self, subject, template, add_args) +
+send mail with login details
++ + + send_password_notifcation + (self, new_password) +
+No docs
++ + + send_welcome_mail_to_user + (self) +
+No docs
++ + + share_with_self + (self) +
+No docs
++ + + update_gravatar + (self) +
+No docs
++ + + validate + (self) +
+No docs
++ + + validate_email_type + (self, email) +
+No docs
++ + + validate_rename + (self, olddn, newdn) +
+No docs
++ + + validate_share + (self, docshare) +
+No docs
++ + + validate_system_manager_user_type + (self) +
+No docs
++ + + frappe.core.doctype.user.user.get_active_users + () +
+Returns No. of system users who logged in, in the last 3 days
++ + + frappe.core.doctype.user.user.get_active_website_users + () +
+Returns No. of website users who logged in, in the last 3 days
+Public API
+ /api/method/frappe.core.doctype.user.user.get_all_roles
+
+ + + frappe.core.doctype.user.user.get_all_roles + (arg=None) +
+return all roles
+Public API
+ /api/method/frappe.core.doctype.user.user.get_languages
+
+ + + frappe.core.doctype.user.user.get_languages + () +
+No docs
+Public API
+ /api/method/frappe.core.doctype.user.user.get_perm_info
+
+ + + frappe.core.doctype.user.user.get_perm_info + (arg=None) +
+get permission info
++ + + frappe.core.doctype.user.user.get_permission_query_conditions + (user) +
+No docs
++ + + frappe.core.doctype.user.user.get_system_users + (exclude_users=None) +
+No docs
++ + + frappe.core.doctype.user.user.get_total_users + (exclude_users=None) +
+Returns total no. of system users
+Public API
+ /api/method/frappe.core.doctype.user.user.get_user_roles
+
+ + + frappe.core.doctype.user.user.get_user_roles + (arg=None) +
+get roles for a user
++ + + frappe.core.doctype.user.user.get_website_users + () +
+Returns total no. of website users
++ + + frappe.core.doctype.user.user.has_permission + (doc, user) +
+No docs
++ + + frappe.core.doctype.user.user.notifify_admin_access_to_system_manager + (login_manager=None) +
+No docs
+Public API
+ /api/method/frappe.core.doctype.user.user.reset_password
+
+ + + frappe.core.doctype.user.user.reset_password + (user) +
+No docs
+Public API
+ /api/method/frappe.core.doctype.user.user.sign_up
+
+ + + frappe.core.doctype.user.user.sign_up + (email, full_name) +
+No docs
+Public API
+ /api/method/frappe.core.doctype.user.user.update_password
+
+ + + frappe.core.doctype.user.user.update_password + (new_password, key=None, old_password=None) +
+No docs
++ + + frappe.core.doctype.user.user.user_query + (doctype, txt, searchfield, start, page_len, filters) +
+No docs
+Public API
+ /api/method/frappe.core.doctype.user.user.verify_password
+
+ + + frappe.core.doctype.user.user.verify_password + (password) +
+No docs
+Table Name: tabUserRole
| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +role |
+ + Link | ++ Role + + | ++ + + + +Role + + + + | +
Table Name: tabVersion
| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +ref_doctype |
+ + Link | ++ Ref DocType + + | ++ + + + +DocType + + + + | +
| 2 | +docname |
+ + Data | ++ Docname + + | ++ |
| 3 | +doclist_json |
+ + Code | ++ Doclist JSON + + | ++ |
Inherits from frappe.model.document.Document + +
Public API
+ /api/method/frappe.core.doctype.version.version.restore
+
+ + + frappe.core.doctype.version.version.restore + (version) +
+No docs
+Table Name: tabCustom Field
| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +dt |
+ + Link | ++ Document + + | ++ + + + +DocType + + + + | +
| 2 | +label |
+ + Data | ++ Label + + | ++ |
| 3 | +label_help |
+ + HTML | ++ Label Help + + | ++ |
| 4 | +insert_after |
+ + Select | +
+ Insert After
+ + Select the label after which you want to insert new field. + |
+ + |
| 5 | +fieldtype |
+ + Select | ++ Field Type + + | +
+ Attach +Button +Check +Code +Column Break +Currency +Data +Date +Datetime +Dynamic Link +Float +HTML +Image +Int +Link +Long Text +Password +Percent +Read Only +Section Break +Select +Small Text +Table +Text +Text Editor +Time+ |
+
| 6 | +precision |
+ + Select | +
+ Precision
+ + Set non-standard precision for a Float or Currency field + |
+
+ +1 +2 +3 +4 +5 +6 +7 +8 +9+ |
+
| 7 | +options_help |
+ + HTML | ++ Options Help + + | ++ |
| 8 | +options |
+ + Text | ++ Options + + | ++ |
| 9 | +description |
+ + Text | ++ Field Description + + | ++ |
| 10 | +fieldname |
+ + Data | ++ Fieldname + + | ++ |
| 11 | +properties |
+ + Column Break | ++ Properties + + | ++ |
| 12 | +permlevel |
+ + Int | ++ Permission Level + + | ++ |
| 13 | +reqd |
+ + Check | ++ Is Mandatory Field + + | ++ |
| 14 | +unique |
+ + Check | ++ Unique + + | ++ |
| 15 | +read_only |
+ + Check | ++ Read Only + + | ++ |
| 16 | +ignore_user_permissions |
+ + Check | ++ Ignore User Permissions + + | ++ |
| 17 | +width |
+ + Data | ++ Width + + | ++ |
| 18 | +default |
+ + Text | ++ Default Value + + | ++ |
| 19 | +hidden |
+ + Check | ++ Hidden + + | ++ |
| 20 | +depends_on |
+ + Small Text | ++ Depends On + + | ++ |
| 21 | +print_hide |
+ + Check | ++ Print Hide + + | ++ |
| 22 | +print_width |
+ + Data | ++ Print Width + + | ++ |
| 23 | +no_copy |
+ + Check | ++ No Copy + + | ++ |
| 24 | +allow_on_submit |
+ + Check | ++ Allow on Submit + + | ++ |
| 25 | +in_filter |
+ + Check | ++ In Report Filter + + | ++ |
| 26 | +in_list_view |
+ + Check | ++ In List View + + | ++ |
| 27 | +report_hide |
+ + Check | ++ Report Hide + + | ++ |
| 28 | +search_index |
+ + Check | ++ Index + + | ++ |
Inherits from frappe.model.document.Document + +
+ + + autoname + (self) +
+No docs
++ + + create_property_setter + (self) +
+No docs
++ + + on_trash + (self) +
+No docs
++ + + on_update + (self) +
+No docs
++ + + set_fieldname + (self) +
+No docs
++ + + validate + (self) +
+No docs
++ + + frappe.custom.doctype.custom_field.custom_field.create_custom_field + (doctype, df) +
+No docs
++ + + frappe.custom.doctype.custom_field.custom_field.create_custom_field_if_values_exist + (doctype, df) +
+No docs
+Public API
+ /api/method/frappe.custom.doctype.custom_field.custom_field.get_fields_label
+
+ + + frappe.custom.doctype.custom_field.custom_field.get_fields_label + (doctype=None) +
+No docs
+Table Name: tabCustom Script
| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +dt |
+ + Link | ++ DocType + + | ++ + + + +DocType + + + + | +
| 2 | +script_type |
+ + Select | ++ Script Type + + | +
+ Client+ |
+
| 3 | +script |
+ + Code | ++ Script + + | +
+ Script+ |
+
| 4 | +sample |
+ + HTML | ++ Sample + + | ++ |
Inherits from frappe.model.document.Document + +
+ + + autoname + (self) +
+No docs
++ + + on_trash + (self) +
+No docs
++ + + on_update + (self) +
+No docs
+| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +doc_type |
+ + Link | ++ Enter Form Type + + | ++ + + + +DocType + + + + | +
| 2 | +properties |
+ + Section Break | ++ + + | ++ |
| 3 | +default_print_format |
+ + Link | ++ Default Print Format + + | ++ + + + +Print Format + + + + | +
| 4 | +search_fields |
+ + Data | +
+ Search Fields
+ + Fields separated by comma (,) will be included in the "Search By" list of Search dialog box + |
+ + |
| 5 | +column_break_5 |
+ + Column Break | ++ + + | ++ |
| 6 | +max_attachments |
+ + Int | ++ Max Attachments + + | ++ |
| 7 | +allow_copy |
+ + Check | ++ Hide Copy + + | ++ |
| 8 | +section_break_8 |
+ + Section Break | ++ + + | ++ |
| 9 | +sort_field |
+ + Select | ++ Sort Field + + | ++ |
| 10 | +column_break_10 |
+ + Column Break | ++ + + | ++ |
| 11 | +sort_order |
+ + Select | ++ Sort Order + + | +
+ ASC +DESC+ |
+
| 12 | +fields_section_break |
+ + Section Break | +
+ Fields
+ + Customize Label, Print Hide, Default etc. + |
+ + |
| 13 | +fields |
+ + Table | ++ Fields + + | ++ + + + +Customize Form Field + + + + | +
Inherits from frappe.model.document.Document + +
+ + + add_custom_field + (self, df) +
+No docs
++ + + clear_existing_doc + (self) +
+No docs
++ + + delete_custom_fields + (self) +
+No docs
++ + + delete_existing_property_setter + (self, property, fieldname=None) +
+No docs
++ + + fetch_to_customize + (self) +
+No docs
++ + + get_existing_property_value + (self, property_name, fieldname=None) +
+No docs
++ + + make_property_setter + (self, property, value, property_type, fieldname=None) +
+No docs
++ + + on_update + (self) +
+No docs
++ + + reset_to_defaults + (self) +
+No docs
++ + + save_customization + (self) +
+No docs
++ + + set_idx_property_setter + (self) +
+No docs
++ + + set_property_setters + (self) +
+No docs
++ + + update_custom_fields + (self) +
+No docs
++ + + update_in_custom_field + (self, df) +
+No docs
++ + + validate_fieldtype_change + (self, df, old_value, new_value) +
+No docs
+Table Name: tabCustomize Form Field
| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +label_and_type |
+ + Section Break | ++ Label and Type + + | ++ |
| 2 | +label |
+ + Data | ++ Label + + | ++ |
| 3 | +fieldtype |
+ + Select | ++ Type + + | +
+ Attach +Attach Image +Button +Check +Code +Column Break +Currency +Data +Date +Datetime +Dynamic Link +Float +Fold +Heading +HTML +Image +Int +Link +Long Text +Password +Percent +Read Only +Section Break +Select +Small Text +Table +Text +Text Editor +Time+ |
+
| 4 | +fieldname |
+ + Data | ++ Name + + | ++ |
| 5 | +reqd |
+ + Check | ++ Mandatory + + | ++ |
| 6 | +unique |
+ + Check | ++ Unique + + | ++ |
| 7 | +in_list_view |
+ + Check | ++ In List View + + | ++ |
| 8 | +column_break_7 |
+ + Column Break | ++ + + | ++ |
| 9 | +precision |
+ + Select | +
+ Precision
+ + Set non-standard precision for a Float or Currency field + |
+
+ +1 +2 +3 +4 +5 +6 +7 +8 +9+ |
+
| 10 | +length |
+ + Int | ++ Length + + | ++ |
| 11 | +options |
+ + Text | +
+ Options
+ + For Links, enter the DocType as range. +For Select, enter list of Options, each on a new line. + |
+ + |
| 12 | +permissions |
+ + Section Break | ++ Permissions + + | ++ |
| 13 | +depends_on |
+ + Data | +
+ Depends On
+ + This field will appear only if the fieldname defined here has value OR the rules are true (examples): +myfield +eval:doc.myfield=='My Value' +eval:doc.age>18 + |
+ + |
| 14 | +permlevel |
+ + Int | ++ Perm Level + + | ++ |
| 15 | +hidden |
+ + Check | ++ Hidden + + | ++ |
| 16 | +read_only |
+ + Check | ++ Read Only + + | ++ |
| 17 | +collapsible |
+ + Check | ++ Collapsible + + | ++ |
| 18 | +collapsible_depends_on |
+ + Data | ++ Collapsible Depends On + + | ++ |
| 19 | +column_break_14 |
+ + Column Break | ++ + + | ++ |
| 20 | +ignore_user_permissions |
+ + Check | ++ Ignore User Permissions + + | ++ |
| 21 | +allow_on_submit |
+ + Check | ++ Allow on Submit + + | ++ |
| 22 | +report_hide |
+ + Check | ++ Report Hide + + | ++ |
| 23 | +display |
+ + Section Break | ++ Display + + | ++ |
| 24 | +default |
+ + Text | ++ Default + + | ++ |
| 25 | +in_filter |
+ + Check | ++ In Filter + + | ++ |
| 26 | +column_break_21 |
+ + Column Break | ++ + + | ++ |
| 27 | +description |
+ + Text | ++ Description + + | ++ |
| 28 | +print_hide |
+ + Check | ++ Print Hide + + | ++ |
| 29 | +print_width |
+ + Data | +
+ Print Width
+ + Print Width of the field, if the field is a column in a table + |
+ + |
| 30 | +width |
+ + Data | ++ Width + + | ++ |
| 31 | +is_custom_field |
+ + Check | ++ Is Custom Field + + | ++ |
Table Name: tabProperty Setter
| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +help |
+ + HTML | ++ Help + + | ++ |
| 2 | +sb0 |
+ + Section Break | ++ + + | ++ |
| 3 | +doctype_or_field |
+ + Select | ++ DocType or Field + + | +
+ +DocField +DocType+ |
+
| 4 | +value |
+ + Text | +
+ Set Value
+ + New value to be set + |
+ + |
| 5 | +column_break0 |
+ + Column Break | ++ + + | ++ |
| 6 | +doc_type |
+ + Link | ++ DocType + + | ++ + + + +DocType + + + + | +
| 7 | +field_name |
+ + Data | +
+ Field Name
+ + ID (name) of the entity whose property is to be set + |
+ + |
| 8 | +property |
+ + Data | ++ Property + + | ++ |
| 9 | +property_type |
+ + Data | ++ Property Type + + | ++ |
| 10 | +default_value |
+ + Data | ++ Default Value + + | ++ |
Inherits from frappe.model.document.Document + +
+ + + autoname + (self) +
+No docs
++ + + get_defaults + (self) +
+No docs
++ + + get_field_ids + (self) +
+No docs
++ + + get_property_list + (self, dt) +
+No docs
++ + + get_setup_data + (self) +
+No docs
++ + + on_update + (self) +
+No docs
++ + + validate + (self) +
+delete other property setters on this, if this is new
++ + + frappe.custom.doctype.property_setter.property_setter.make_property_setter + (doctype, fieldname, property, value, property_type, for_doctype=False, validate_fields_for_doctype=True) +
+No docs
+Table Name: tabEvent
| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +details |
+ + Section Break | ++ + + | ++ |
| 2 | +subject |
+ + Data | ++ Subject + + | ++ |
| 3 | +event_type |
+ + Select | ++ Event Type + + | +
+ Private +Public +Cancel+ |
+
| 4 | +send_reminder |
+ + Check | ++ Send an email reminder in the morning + + | ++ |
| 5 | +column_break_4 |
+ + Column Break | ++ + + | ++ |
| 6 | +starts_on |
+ + Datetime | ++ Starts on + + | ++ |
| 7 | +ends_on |
+ + Datetime | ++ Ends on + + | ++ |
| 8 | +all_day |
+ + Check | ++ All Day + + | ++ |
| 9 | +section_break_8 |
+ + Section Break | ++ + + | ++ |
| 10 | +repeat_this_event |
+ + Check | ++ Repeat this Event + + | ++ |
| 11 | +section_break_11 |
+ + Section Break | ++ + + | ++ |
| 12 | +repeat_on |
+ + Select | ++ Repeat On + + | +
+ +Every Day +Every Week +Every Month +Every Year+ |
+
| 13 | +repeat_till |
+ + Date | +
+ Repeat Till
+ + Leave blank to repeat always + |
+ + |
| 14 | +column_break_11 |
+ + Column Break | ++ + + | ++ |
| 15 | +monday |
+ + Check | ++ Monday + + | ++ |
| 16 | +tuesday |
+ + Check | ++ Tuesday + + | ++ |
| 17 | +wednesday |
+ + Check | ++ Wednesday + + | ++ |
| 18 | +thursday |
+ + Check | ++ Thursday + + | ++ |
| 19 | +friday |
+ + Check | ++ Friday + + | ++ |
| 20 | +saturday |
+ + Check | ++ Saturday + + | ++ |
| 21 | +sunday |
+ + Check | ++ Sunday + + | ++ |
| 22 | +section_break_6 |
+ + Section Break | ++ + + | ++ |
| 23 | +description |
+ + Text Editor | ++ Description + + | ++ |
| 24 | +participants |
+ + Section Break | ++ Participants + + | ++ |
| 25 | +groups |
+ + Column Break | ++ Groups + + | ++ |
| 26 | +roles |
+ + Table | ++ Roles + + | ++ + + + +Event Role + + + + | +
| 27 | +ref_type |
+ + Link | ++ Ref Type + + | ++ + + + +DocType + + + + | +
| 28 | +ref_name |
+ + Dynamic Link | ++ Ref Name + + | +
+ ref_type+ |
+
Inherits from frappe.model.document.Document + +
+ + + get_route + (self) +
+for test-case
++ + + validate + (self) +
+No docs
+Public API
+ /api/method/frappe.desk.doctype.event.event.get_events
+
+ + + frappe.desk.doctype.event.event.get_events + (start, end, user=None, for_reminder=False) +
+No docs
++ + + frappe.desk.doctype.event.event.get_permission_query_conditions + (user) +
+No docs
++ + + frappe.desk.doctype.event.event.has_permission + (doc, user) +
+No docs
++ + + frappe.desk.doctype.event.event.send_event_digest + () +
+No docs
+Table Name: tabEvent Role
| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +role |
+ + Link | ++ Role + + | ++ + + + +Role + + + + | +
Table Name: tabFeed
| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +feed_type |
+ + Select | ++ Feed Type + + | +
+ +Comment +Login +Label +Info+ |
+
| 2 | +doc_type |
+ + Data | ++ Doc Type + + | ++ |
| 3 | +doc_name |
+ + Data | ++ Doc Name + + | ++ |
| 4 | +subject |
+ + Small Text | ++ Subject + + | ++ |
| 5 | +color |
+ + Data | ++ Color + + | ++ |
| 6 | +full_name |
+ + Data | ++ Full Name + + | ++ |
Inherits from frappe.model.document.Document + +
+ + + frappe.desk.doctype.feed.feed.get_permission_query_conditions + (user) +
+No docs
++ + + frappe.desk.doctype.feed.feed.has_permission + (doc, user) +
+No docs
++ + + frappe.desk.doctype.feed.feed.login_feed + (login_manager) +
+No docs
++ + + frappe.desk.doctype.feed.feed.on_doctype_update + () +
+No docs
++ + + frappe.desk.doctype.feed.feed.update_feed + (doc, method=None) +
+adds a new feed
+Table Name: tabNote
| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +title |
+ + Data | ++ Title + + | ++ |
| 2 | +public |
+ + Check | +
+ Public
+ + Everyone can read + |
+ + |
| 3 | +content |
+ + Text Editor | +
+ Content
+ + Help: To link to another record in the system, use "#Form/Note/[Note Name]" as the Link URL. (don't use "http://") + |
+ + |
Inherits from frappe.model.document.Document + +
+ + + autoname + (self) +
+No docs
++ + + before_print + (self) +
+No docs
++ + + frappe.desk.doctype.note.note.get_permission_query_conditions + (user) +
+No docs
++ + + frappe.desk.doctype.note.note.has_permission + (doc, ptype, user) +
+No docs
+Table Name: tabToDo
| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +description_and_status |
+ + Section Break | ++ Description and Status + + | ++ |
| 2 | +description |
+ + Text | ++ Description + + | ++ |
| 3 | +column_break_2 |
+ + Column Break | ++ + + | ++ |
| 4 | +status |
+ + Select | ++ Status + + | +
+ Open +Closed+ |
+
| 5 | +priority |
+ + Select | ++ Priority + + | +
+ High +Medium +Low+ |
+
| 6 | +date |
+ + Date | ++ Due Date + + | ++ |
| 7 | +owner |
+ + Link | ++ Allocated To + + | ++ + + + +User + + + + | +
| 8 | +section_break_6 |
+ + Section Break | ++ Reference + + | ++ |
| 9 | +reference_type |
+ + Link | ++ Reference Type + + | ++ + + + +DocType + + + + | +
| 10 | +reference_name |
+ + Dynamic Link | ++ Reference Name + + | +
+ reference_type+ |
+
| 11 | +column_break_10 |
+ + Column Break | ++ + + | ++ |
| 12 | +role |
+ + Link | ++ Role + + | ++ + + + +Role + + + + | +
| 13 | +assigned_by |
+ + Link | ++ Assigned By + + | ++ + + + +User + + + + | +
| 14 | +sender |
+ + Data | ++ Sender + + | ++ |
Inherits from frappe.model.document.Document + +
+ + + add_assign_comment + (self, text, comment_type) +
+No docs
++ + + on_trash + (self) +
+No docs
++ + + on_update + (self) +
+No docs
++ + + update_in_reference + (self) +
+No docs
++ + + validate + (self) +
+No docs
++ + + frappe.desk.doctype.todo.todo.get_permission_query_conditions + (user) +
+No docs
++ + + frappe.desk.doctype.todo.todo.has_permission + (doc, user) +
+No docs
++ + + frappe.desk.doctype.todo.todo.on_doctype_update + () +
+No docs
+Table Name: tabBulk Email
| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +sender |
+ + Data | ++ Sender + + | ++ |
| 2 | +recipient |
+ + Data | ++ Recipient + + | ++ |
| 3 | +message |
+ + Code | ++ Message + + | ++ |
| 4 | +status |
+ + Select | ++ Status + + | +
+ +Not Sent +Sending +Sent +Error+ |
+
| 5 | +error |
+ + Text | ++ Error + + | ++ |
| 6 | +reference_doctype |
+ + Link | ++ Reference DocType + + | ++ + + + +DocType + + + + | +
| 7 | +reference_name |
+ + Data | ++ Reference DocName + + | ++ |
| 8 | +send_after |
+ + Datetime | ++ Send After + + | ++ |
| 9 | +priority |
+ + Int | ++ Priority + + | ++ |
Inherits from frappe.model.document.Document + +
Public API
+ /api/method/frappe.email.doctype.bulk_email.bulk_email.retry_sending
+
+ + + frappe.email.doctype.bulk_email.bulk_email.retry_sending + (name) +
+No docs
+Table Name: tabEmail Account
| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +email_settings |
+ + Section Break | ++ + + | ++ |
| 2 | +service |
+ + Select | ++ Service + + | +
+ +GMail +Yahoo Mail +Outlook.com+ |
+
| 3 | +email_id |
+ + Data | ++ Email Id + + | +
+ |
+
| 4 | +login_id_is_different |
+ + Check | ++ Login Id is Different + + | ++ |
| 5 | +login_id |
+ + Data | ++ Login Id + + | ++ |
| 6 | +password |
+ + Password | ++ Password + + | ++ |
| 7 | +email_account_name |
+ + Data | +
+ Email Account Name
+ + e.g. "Support", "Sales", "Jerry Yang" + |
+ + |
| 8 | +mailbox_settings |
+ + Section Break | ++ + + | ++ |
| 9 | +enable_incoming |
+ + Check | +
+ Enable Incoming
+ + Check this to pull emails from your mailbox + |
+ + |
| 10 | +pop3_server |
+ + Data | +
+ POP3 Server
+ + e.g. pop.gmail.com + |
+ + |
| 11 | +use_ssl |
+ + Check | ++ Use SSL + + | ++ |
| 12 | +attachment_limit |
+ + Int | +
+ Attachment Limit (MB)
+ + Ignore attachments over this size + |
+ + |
| 13 | +append_to |
+ + Link | +
+ Append To
+ + Append as communication against this DocType (must have fields, "Status", "Subject") + |
+ + + + + +DocType + + + + | +
| 14 | +default_incoming |
+ + Check | +
+ Default Incoming
+ + e.g. replies@yourcomany.com. All replies will come to this inbox. + |
+ + |
| 15 | +section_break_13 |
+ + Section Break | ++ + + | ++ |
| 16 | +notify_if_unreplied |
+ + Check | ++ Notify if unreplied + + | ++ |
| 17 | +unreplied_for_mins |
+ + Int | ++ Notify if unreplied for (in mins) + + | ++ |
| 18 | +send_notification_to |
+ + Small Text | +
+ Send Notification to
+ + Email Ids + |
+ + |
| 19 | +outgoing_mail_settings |
+ + Section Break | ++ + + | ++ |
| 20 | +enable_outgoing |
+ + Check | +
+ Enable Outgoing
+ + SMTP Settings for outgoing emails + |
+ + |
| 21 | +smtp_server |
+ + Data | +
+ SMTP Server
+ + e.g. smtp.gmail.com + |
+ + |
| 22 | +use_tls |
+ + Check | ++ Use TLS + + | ++ |
| 23 | +smtp_port |
+ + Data | +
+ Port
+ + If non standard port (e.g. 587) + |
+ + |
| 24 | +default_outgoing |
+ + Check | +
+ Default Outgoing
+ + Notifications and bulk mails will be sent from this outgoing server. + |
+ + |
| 25 | +always_use_account_email_id_as_sender |
+ + Check | +
+ Always use Account's Email ID as Sender
+ + Uses the Email ID mentioned in this Account as the Sender for all emails sent using this Account. + |
+ + |
| 26 | +signature_section |
+ + Section Break | ++ + + | ++ |
| 27 | +add_signature |
+ + Check | ++ Add Signature + + | ++ |
| 28 | +signature |
+ + Text Editor | ++ Signature + + | ++ |
| 29 | +auto_reply |
+ + Section Break | ++ + + | ++ |
| 30 | +enable_auto_reply |
+ + Check | ++ Enable Auto Reply + + | ++ |
| 31 | +auto_reply_message |
+ + Text Editor | +
+ Auto Reply Message
+
+ ProTip: Add |
+ + |
| 32 | +set_footer |
+ + Section Break | ++ + + | ++ |
| 33 | +footer |
+ + Text Editor | ++ Footer + + | ++ |
Inherits from frappe.model.document.Document + +
+ + + autoname + (self) +
+Set name as email_account_name or make title from email id.
+ + + check_smtp + (self) +
+Checks SMTP settings.
++ + + get_pop3 + (self) +
+Returns logged in POP3 connection object.
++ + + get_unreplied_notification_emails + (self) +
+Return list of emails listed
++ + + insert_communication + (self, raw) +
+No docs
++ + + on_trash + (self) +
+Clear communications where email account is linked
++ + + on_update + (self) +
+Check there is only one default of each type.
++ + + receive + (self, test_mails=None) +
+Called by scheduler to receive emails from this EMail account using POP3.
++ + + send_auto_reply + (self, communication, email) +
+Send auto reply if set.
++ + + set_thread + (self, communication, email) +
+Appends communication to parent based on thread ID. Will extract +parent communication and will link the communication to the reference of that +communication. Also set the status of parent transaction to Open or Replied.
+ +If no thread id is found and append_to is set for the email account,
+it will create a new parent transaction (e.g. Issue)
+ + + there_must_be_only_one_default + (self) +
+If current Email Account is default, un-default all other accounts.
++ + + validate + (self) +
+Validate email id and check POP3 and SMTP connections is enabled.
+Inherits from exceptions.Exception + +
Public API
+ /api/method/frappe.email.doctype.email_account.email_account.get_append_to
+
+ + + frappe.email.doctype.email_account.email_account.get_append_to + (doctype=None, txt=None, searchfield=None, start=None, page_len=None, filters=None) +
+No docs
++ + + frappe.email.doctype.email_account.email_account.notify_unreplied + () +
+Sends email notifications if there are unreplied Communications
+and notify_if_unreplied is set as true.
+ + + frappe.email.doctype.email_account.email_account.pull + (now=False) +
+Will be called via scheduler, pull emails from all enabled POP3 email accounts.
+Table Name: tabEmail Alert
| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +enabled |
+ + Check | ++ Enabled + + | ++ |
| 2 | +filters |
+ + Section Break | ++ Filters + + | ++ |
| 3 | +subject |
+ + Data | +
+ Subject
+ + To add dynamic subject, use jinja tags like + + |
+ + |
| 4 | +document_type |
+ + Link | ++ Document Type + + | ++ + + + +DocType + + + + | +
| 5 | +event |
+ + Select | ++ Send Alert On + + | +
+ +New +Save +Submit +Cancel +Days After +Days Before +Value Change+ |
+
| 6 | +date_changed |
+ + Select | +
+ Reference Date
+ + Send alert if date matches this field's value + |
+ + |
| 7 | +days_in_advance |
+ + Int | +
+ Days Before or After
+ + Send days before or after the reference date + |
+ + |
| 8 | +value_changed |
+ + Select | +
+ Value Changed
+ + Send alert if this field's value changes + |
+ + |
| 9 | +condition |
+ + Data | +
+ Condition
+ + Optional: The alert will be sent if this expression is true + |
+ + |
| 10 | +column_break_6 |
+ + Column Break | ++ + + | ++ |
| 11 | +html_7 |
+ + HTML | ++ + + | ++ |
| 12 | +column_break_5 |
+ + Section Break | ++ Recipients + + | ++ |
| 13 | +recipients |
+ + Table | ++ Recipients + + | ++ + + + +Email Alert Recipient + + + + | +
| 14 | +message_sb |
+ + Section Break | ++ Message + + | ++ |
| 15 | +message |
+ + Text | ++ Message + + | ++ |
| 16 | +attach_print |
+ + Check | ++ Attach Print + + | ++ |
| 17 | +message_examples |
+ + HTML | ++ Message Examples + + | ++ |
| 18 | +view_properties |
+ + Button | ++ View Properties (via Customize Form) + + | ++ |
Inherits from frappe.model.document.Document + +
+ + + frappe.email.doctype.email_alert.email_alert.evaluate_alert + (doc, alert, event) +
+No docs
++ + + frappe.email.doctype.email_alert.email_alert.trigger_daily_alerts + () +
+No docs
++ + + frappe.email.doctype.email_alert.email_alert.trigger_email_alerts + (doc, method=None) +
+No docs
+Table Name: tabEmail Alert Recipient
| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +email_by_document_field |
+ + Select | +
+ Email By Document Field
+ + Optional: Alert will only be sent if value is a valid email id. + |
+ + |
| 2 | +cc |
+ + Text | +
+ CC
+ + Optional: Always send to these ids. Each email id on a new row + |
+ + |
| 3 | +condition |
+ + Data | +
+ Condition
+ + Expression, Optional + |
+ + |
Table Name: tabEmail Unsubscribe
| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +email |
+ + Data | ++ Email + + | ++ |
| 2 | +reference_doctype |
+ + Link | ++ Reference DocType + + | ++ + + + +DocType + + + + | +
| 3 | +reference_name |
+ + Dynamic Link | ++ Reference Name + + | +
+ reference_doctype+ |
+
| 4 | +global_unsubscribe |
+ + Check | ++ Global Unsubscribe + + | ++ |
Inherits from frappe.model.document.Document + +
+ + + on_update + (self) +
+No docs
++ + + validate + (self) +
+No docs
+Table Name: tabStandard Reply
| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +subject |
+ + Data | ++ Subject + + | ++ |
| 2 | +response |
+ + Text Editor | ++ Response + + | ++ |
| 3 | +owner |
+ + Link | ++ Owner + + | ++ + + + +User + + + + | +
Inherits from frappe.model.document.Document + +
Table Name: tabCountry
| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +country_name |
+ + Data | ++ Country Name + + | ++ |
| 2 | +date_format |
+ + Data | ++ Date Format + + | ++ |
| 3 | +time_zones |
+ + Text | ++ Time Zones + + | ++ |
| 4 | +code |
+ + Data | ++ Code + + | ++ |
Inherits from frappe.model.document.Document + +
Table Name: tabCurrency
| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +currency_name |
+ + Data | ++ Currency Name + + | ++ |
| 2 | +enabled |
+ + Check | ++ Enabled + + | ++ |
| 3 | +fraction |
+ + Data | +
+ Fraction
+ + Sub-currency. For e.g. "Cent" + |
+ + |
| 4 | +fraction_units |
+ + Int | +
+ Fraction Units
+ + 1 Currency = [?] Fraction +For e.g. 1 USD = 100 Cent + |
+ + |
| 5 | +symbol |
+ + Data | +
+ Symbol
+ + A symbol for this currency. For e.g. $ + |
+ + |
| 6 | +number_format |
+ + Select | +
+ Number Format
+ + How should this currency be formatted? If not set, will use system defaults + |
+
+ +#,###.## +#.###,## +# ###.## +# ###,## +#'###.## +#, ###.## +#,##,###.## +#,###.### +#.### +#,###+ |
+
Inherits from frappe.model.document.Document + +
Browse DocTypes by Module
+ +| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +send_backups_to_dropbox |
+ + Check | ++ Send Backups to Dropbox + + | ++ |
| 2 | +upload_backups_to_dropbox |
+ + Select | ++ Upload Frequency + + | +
+ Daily +Weekly+ |
+
| 3 | +send_notifications_to |
+ + Data | ++ Send Notifications To + + | ++ |
| 4 | +dropbox_access_key |
+ + Data | ++ Dropbox Access Key + + | ++ |
| 5 | +dropbox_access_secret |
+ + Data | ++ Dropbox Access Secret + + | ++ |
| 6 | +dropbox_access_allowed |
+ + Data | ++ Dropbox Access Allowed + + | ++ |
| 7 | +allow_dropbox_access |
+ + Button | ++ Allow Dropbox Access + + | ++ |
Inherits from frappe.model.document.Document + +
+ + + frappe.integrations.doctype.dropbox_backup.dropbox_backup.backup_to_dropbox + () +
+No docs
+Public API
+ /api/method/frappe.integrations.doctype.dropbox_backup.dropbox_backup.dropbox_callback
+
+ + + frappe.integrations.doctype.dropbox_backup.dropbox_backup.dropbox_callback + (oauth_token=None, not_approved=False) +
+No docs
+Public API
+ /api/method/frappe.integrations.doctype.dropbox_backup.dropbox_backup.get_dropbox_authorize_url
+
+ + + frappe.integrations.doctype.dropbox_backup.dropbox_backup.get_dropbox_authorize_url + () +
+No docs
++ + + frappe.integrations.doctype.dropbox_backup.dropbox_backup.get_dropbox_session + () +
+No docs
++ + + frappe.integrations.doctype.dropbox_backup.dropbox_backup.send_email + (success, service_name, error_status=None) +
+No docs
++ + + frappe.integrations.doctype.dropbox_backup.dropbox_backup.take_backups_daily + () +
+No docs
+Public API
+ /api/method/frappe.integrations.doctype.dropbox_backup.dropbox_backup.take_backups_dropbox
+
+ + + frappe.integrations.doctype.dropbox_backup.dropbox_backup.take_backups_dropbox + () +
+No docs
++ + + frappe.integrations.doctype.dropbox_backup.dropbox_backup.take_backups_if + (freq) +
+No docs
++ + + frappe.integrations.doctype.dropbox_backup.dropbox_backup.take_backups_weekly + () +
+No docs
++ + + frappe.integrations.doctype.dropbox_backup.dropbox_backup.upload_file_to_dropbox + (filename, folder, dropbox_client) +
+No docs
+| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +facebook |
+ + Section Break | ++ Facebook + + | ++ |
| 2 | +facebook_client_id |
+ + Data | ++ Facebook Client ID + + | ++ |
| 3 | +facebook_client_secret |
+ + Data | ++ Facebook Client Secret + + | ++ |
| 4 | +google |
+ + Section Break | ++ Google + + | ++ |
| 5 | +google_client_id |
+ + Data | ++ Google Client ID + + | ++ |
| 6 | +google_client_secret |
+ + Data | ++ Google Client Secret + + | ++ |
| 7 | +github |
+ + Section Break | ++ GitHub + + | ++ |
| 8 | +github_client_id |
+ + Data | ++ GitHub Client ID + + | ++ |
| 9 | +github_client_secret |
+ + Data | ++ GitHub Client Secret + + | ++ |
Inherits from frappe.model.document.Document + +
Table Name: tabLetter Head
| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +letter_head_name |
+ + Data | ++ Letter Head Name + + | ++ |
| 2 | +disabled |
+ + Check | ++ Disabled + + | ++ |
| 3 | +is_default |
+ + Check | +
+ Is Default
+ + Check this to make this the default letter head in all prints + |
+ + |
| 4 | +content |
+ + Text Editor | +
+ Content
+ + Letter Head in HTML + |
+ + |
Inherits from frappe.model.document.Document + +
+ + + on_update + (self) +
+No docs
++ + + set_as_default + (self) +
+No docs
++ + + validate + (self) +
+No docs
+Table Name: tabPrint Format
| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +doc_type |
+ + Link | ++ DocType + + | ++ + + + +DocType + + + + | +
| 2 | +disabled |
+ + Check | ++ Disabled + + | ++ |
| 3 | +column_break_3 |
+ + Column Break | ++ + + | ++ |
| 4 | +standard |
+ + Select | ++ Standard + + | +
+ No +Yes+ |
+
| 5 | +custom_format |
+ + Check | ++ Custom Format + + | ++ |
| 6 | +section_break_6 |
+ + Section Break | ++ + + | ++ |
| 7 | +print_format_type |
+ + Select | ++ Print Format Type + + | +
+ Server +Client+ |
+
| 8 | +html |
+ + Code | ++ HTML + + | +
+ HTML+ |
+
| 9 | +section_break_9 |
+ + Section Break | ++ + + | ++ |
| 10 | +edit_format |
+ + Button | ++ Edit Format + + | ++ |
| 11 | +column_break_11 |
+ + Column Break | ++ + + | ++ |
| 12 | +font |
+ + Select | ++ Font + + | +
+ Default +Arial +Helvetica +Verdana +Monospace+ |
+
| 13 | +css_section |
+ + Section Break | ++ + + | ++ |
| 14 | +css |
+ + Code | ++ Custom CSS + + | ++ |
| 15 | +custom_html_help |
+ + HTML | ++ Custom HTML Help + + | ++ |
| 16 | +section_break_13 |
+ + Section Break | ++ + + | ++ |
| 17 | +print_format_help |
+ + HTML | ++ Print Format Help + + | ++ |
| 18 | +format_data |
+ + Code | ++ Format Data + + | ++ |
| 19 | +print_format_builder |
+ + Check | ++ Print Format Builder + + | ++ |
Inherits from frappe.model.document.Document + +
+ + + export_doc + (self) +
+No docs
++ + + extract_images + (self) +
+No docs
++ + + on_trash + (self) +
+No docs
++ + + on_update + (self) +
+No docs
++ + + validate + (self) +
+No docs
+| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +pdf_settings |
+ + Section Break | ++ PDF Settings + + | ++ |
| 2 | +send_print_as_pdf |
+ + Check | +
+ Send Print as PDF
+ + Send Email Print Attachments as PDF (Recommended) + |
+ + |
| 3 | +pdf_page_size |
+ + Select | ++ PDF Page Size + + | +
+ A4 +Letter+ |
+
| 4 | +print_style_section |
+ + Section Break | ++ Print Style + + | ++ |
| 5 | +print_style |
+ + Select | ++ Print Style + + | +
+ Modern +Classic +Standard +Monochrome+ |
+
| 6 | +font |
+ + Select | ++ Font + + | +
+ Default +Arial +Helvetica +Verdana +Monospace+ |
+
| 7 | +font_size |
+ + Float | +
+ Font Size
+ + In points. Default is 9. + |
+ + |
| 8 | +column_break_6 |
+ + Column Break | ++ + + | ++ |
| 9 | +with_letterhead |
+ + Check | +
+ With Letterhead
+ + Print with Letterhead, unless unchecked in a particular Document + |
+ + |
| 10 | +section_break_8 |
+ + Section Break | ++ + + | ++ |
| 11 | +print_style_preview |
+ + HTML | ++ Print Style Preview + + | ++ |
Inherits from frappe.model.document.Document + +
| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +help |
+ + HTML | ++ Help + + | ++ |
| 2 | +company_introduction |
+ + Text Editor | +
+ Company Introduction
+ + Introduce your company to the website visitor. + |
+ + |
| 3 | +sb0 |
+ + Section Break | ++ Org History + + | ++ |
| 4 | +company_history_heading |
+ + Data | +
+ Org History Heading
+ + "Company History" + |
+ + |
| 5 | +company_history |
+ + Table | ++ Org History + + | ++ + + + +Company History + + + + | +
| 6 | +sb1 |
+ + Section Break | ++ Team Members + + | ++ |
| 7 | +team_members_heading |
+ + Data | +
+ Team Members Heading
+ + "Team Members" or "Management" + |
+ + |
| 8 | +team_members |
+ + Table | ++ Team Members + + | ++ + + + +About Us Team Member + + + + | +
| 9 | +footer |
+ + Text Editor | +
+ Footer
+ + More content for the bottom of the page. + |
+ + |
Inherits from frappe.model.document.Document + +
+ + + frappe.website.doctype.about_us_settings.about_us_settings.get_args + () +
+No docs
+Table Name: tabAbout Us Team Member
| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +full_name |
+ + Data | ++ Full Name + + | ++ |
| 2 | +image_link |
+ + Attach | ++ Image Link + + | ++ |
| 3 | +bio |
+ + Small Text | ++ Bio + + | ++ |
Table Name: tabBlog Category
| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +category_name |
+ + Data | ++ Category Name + + | ++ |
| 2 | +title |
+ + Data | ++ Title + + | ++ |
| 3 | +published |
+ + Check | ++ Published + + | ++ |
| 4 | +parent_website_route |
+ + Read Only | ++ Parent Website Route + + | ++ |
| 5 | +page_name |
+ + Data | ++ Page Name + + | ++ |
Inherits from frappe.website.website_generator.WebsiteGenerator + +
+ + + autoname + (self) +
+No docs
++ + + on_update + (self) +
+No docs
++ + + validate + (self) +
+No docs
+Table Name: tabBlog Post
| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +title |
+ + Data | ++ Title + + | ++ |
| 2 | +published_on |
+ + Date | ++ Published On + + | ++ |
| 3 | +published |
+ + Check | ++ Published + + | ++ |
| 4 | +column_break_3 |
+ + Column Break | ++ + + | ++ |
| 5 | +blog_category |
+ + Link | ++ Blog Category + + | ++ + + + +Blog Category + + + + | +
| 6 | +blogger |
+ + Link | ++ Blogger + + | ++ + + + +Blogger + + + + | +
| 7 | +parent_website_route |
+ + Read Only | ++ Parent Website Route + + | ++ |
| 8 | +section_break_5 |
+ + Section Break | ++ + + | ++ |
| 9 | +blog_intro |
+ + Small Text | +
+ Blog Intro
+ + Description for listing page, in plain text, only a couple of lines. (max 140 characters) + |
+ + |
| 10 | +content |
+ + Text Editor | ++ Content + + | ++ |
| 11 | +page_name |
+ + Data | ++ Page Name + + | ++ |
| 12 | +email_sent |
+ + Check | ++ Email Sent + + | ++ |
Inherits from frappe.website.website_generator.WebsiteGenerator + +
+ + + get_context + (self, context) +
+No docs
++ + + get_feed + (self) +
+No docs
++ + + on_update + (self) +
+No docs
++ + + validate + (self) +
+No docs
++ + + frappe.website.doctype.blog_post.blog_post.clear_blog_cache + () +
+No docs
++ + + frappe.website.doctype.blog_post.blog_post.get_blog_category + (page_name) +
+No docs
++ + + frappe.website.doctype.blog_post.blog_post.get_blog_list + (doctype, txt=None, filters=None, limit_start=0, limit_page_length=20) +
+No docs
++ + + frappe.website.doctype.blog_post.blog_post.get_children + () +
+No docs
++ + + frappe.website.doctype.blog_post.blog_post.get_list_context + (context=None) +
+No docs
+| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +blog_title |
+ + Data | ++ Blog Title + + | ++ |
| 2 | +blog_introduction |
+ + Small Text | ++ Blog Introduction + + | ++ |
| 3 | +writers_introduction |
+ + Small Text | ++ Writers Introduction + + | ++ |
Inherits from frappe.model.document.Document + +
Table Name: tabBlogger
| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +disabled |
+ + Check | ++ Disabled + + | ++ |
| 2 | +short_name |
+ + Data | +
+ Short Name
+ + Will be used in url (usually first name). + |
+ + |
| 3 | +full_name |
+ + Data | ++ Full Name + + | ++ |
| 4 | +user |
+ + Link | ++ User + + | ++ + + + +User + + + + | +
| 5 | +bio |
+ + Small Text | ++ Bio + + | ++ |
| 6 | +avatar |
+ + Attach | ++ Avatar + + | ++ |
| 7 | +posts |
+ + Int | ++ Posts + + | ++ |
Inherits from frappe.model.document.Document + +
+ + + on_update + (self) +
+if user is set, then update all older blogs
++ + + validate + (self) +
+No docs
+Table Name: tabCompany History
| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +year |
+ + Data | ++ Year + + | ++ |
| 2 | +highlight |
+ + Text | ++ Highlight + + | ++ |
| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +introduction_section |
+ + Section Break | ++ Introduction + + | ++ |
| 2 | +forward_to_email |
+ + Data | +
+ Forward To Email Address
+ + Send enquiries to this email address + |
+ + |
| 3 | +heading |
+ + Data | +
+ Heading
+ + Default: "Contact Us" + |
+ + |
| 4 | +introduction |
+ + Text Editor | +
+ Introduction
+ + Introductory information for the Contact Us Page + |
+ + |
| 5 | +query_options |
+ + Small Text | +
+ Query Options
+ + Contact options, like "Sales Query, Support Query" etc each on a new line or separated by commas. + |
+ + |
| 6 | +address |
+ + Section Break | ++ Address + + | ++ |
| 7 | +address_title |
+ + Data | ++ Address Title + + | ++ |
| 8 | +address_line1 |
+ + Data | ++ Address Line 1 + + | ++ |
| 9 | +address_line2 |
+ + Data | ++ Address Line 2 + + | ++ |
| 10 | +city |
+ + Data | ++ City + + | ++ |
| 11 | +state |
+ + Data | ++ State + + | ++ |
| 12 | +pincode |
+ + Data | ++ Pincode + + | ++ |
| 13 | +country |
+ + Data | ++ Country + + | ++ |
Inherits from frappe.model.document.Document + +
Table Name: tabTop Bar Item
| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +label |
+ + Data | ++ Label + + | ++ |
| 2 | +parent_label |
+ + Select | +
+ Parent Label
+ + If you set this, this Item will come in a drop-down under the selected parent. + |
+ + |
| 3 | +url |
+ + Data | +
+ URL
+ + Link to the page you want to open. Leave blank if you want to make it a group parent. + |
+ + |
| 4 | +target |
+ + Select | +
+ Target
+ + Select target = "_blank" to open in a new page. + |
+
+ +target = "_blank"+ |
+
| 5 | +right |
+ + Check | +
+ Right
+ + For top bar + |
+ + |
Table Name: tabWeb Form
| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +title |
+ + Data | ++ Title + + | ++ |
| 2 | +page_name |
+ + Data | +
+ Page Name
+ + Website URL + |
+ + |
| 3 | +doc_type |
+ + Link | ++ Select DocType + + | ++ + + + +DocType + + + + | +
| 4 | +column_break_4 |
+ + Column Break | ++ + + | ++ |
| 5 | +published |
+ + Check | ++ Published + + | ++ |
| 6 | +login_required |
+ + Check | ++ Login Required + + | ++ |
| 7 | +allow_edit |
+ + Check | ++ Allow Edit + + | ++ |
| 8 | +allow_multiple |
+ + Check | ++ Allow Multiple + + | ++ |
| 9 | +allow_delete |
+ + Check | ++ Allow Delete + + | ++ |
| 10 | +allow_comments |
+ + Check | ++ Allow Comments + + | ++ |
| 11 | +fields |
+ + Section Break | ++ Fields + + | ++ |
| 12 | +introduction_text |
+ + Text | ++ Introduction + + | ++ |
| 13 | +web_form_fields |
+ + Table | ++ Web Form Fields + + | ++ + + + +Web Form Field + + + + | +
| 14 | +actions |
+ + Section Break | ++ Actions + + | ++ |
| 15 | +success_message |
+ + Text | +
+ Success Message
+ + Message to be displayed on successful completion + |
+ + |
| 16 | +success_url |
+ + Data | +
+ Success URL
+ + Go to this url after completing the form. + |
+ + |
| 17 | +advanced |
+ + Section Break | ++ Advanced + + | ++ |
| 18 | +web_page_link_text |
+ + Data | +
+ Web Page Link Text
+ + Text to be displayed for Link to Web Page if this form has a web page. Link route will be automatically generated based on `page_name` and `parent_website_route` + |
+ + |
| 19 | +breadcrumbs |
+ + Small Text | +
+ Breadcrumbs
+ + In JSON as [{"title":"Jobs", "name":"jobs"}] + |
+ + |
Inherits from frappe.website.website_generator.WebsiteGenerator + +
+ + + get_context + (self, context) +
+No docs
++ + + get_layout + (self) +
+No docs
++ + + get_parents + (self, context) +
+No docs
+Public API
+ /api/method/frappe.website.doctype.web_form.web_form.accept
+
+ + + frappe.website.doctype.web_form.web_form.accept + () +
+No docs
+Public API
+ /api/method/frappe.website.doctype.web_form.web_form.delete
+
+ + + frappe.website.doctype.web_form.web_form.delete + (web_form, name) +
+No docs
++ + + frappe.website.doctype.web_form.web_form.get_web_form_list + (doctype, txt, filters, limit_start, limit_page_length=20) +
+No docs
++ + + frappe.website.doctype.web_form.web_form.has_web_form_permission + (doctype, name, ptype=read) +
+No docs
+Table Name: tabWeb Form Field
| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +fieldname |
+ + Select | ++ Fieldname + + | ++ |
| 2 | +fieldtype |
+ + Select | ++ Fieldtype + + | +
+ Attach +Check +Data +Date +Datetime +HTML +Select +Text +Section Break +Column Break+ |
+
| 3 | +label |
+ + Data | ++ Label + + | ++ |
| 4 | +reqd |
+ + Check | ++ Mandatory + + | ++ |
| 5 | +read_only |
+ + Check | ++ Read Only + + | ++ |
| 6 | +hidden |
+ + Check | ++ Hidden + + | ++ |
| 7 | +column_break_4 |
+ + Column Break | ++ + + | ++ |
| 8 | +options |
+ + Text | ++ Options + + | ++ |
| 9 | +section_break_6 |
+ + Section Break | ++ + + | ++ |
| 10 | +description |
+ + Text | ++ Description + + | ++ |
| 11 | +column_break_8 |
+ + Column Break | ++ + + | ++ |
| 12 | +default |
+ + Data | ++ Default + + | ++ |
Table Name: tabWeb Page
| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +section_title |
+ + Section Break | ++ Title + + | ++ |
| 2 | +title |
+ + Data | +
+ Title
+ + Title / headline of your page + |
+ + |
| 3 | +show_title |
+ + Check | ++ Show Title + + | ++ |
| 4 | +slideshow |
+ + Link | +
+ Slideshow
+ + Begin this page with a slideshow of images + |
+ + + + + +Website Slideshow + + + + | +
| 5 | +cb1 |
+ + Column Break | ++ + + | ++ |
| 6 | +page_name |
+ + Data | +
+ Page Name
+ + Page url name (auto-generated) + |
+ + |
| 7 | +published |
+ + Check | ++ Published + + | ++ |
| 8 | +sb1 |
+ + Section Break | +
+ Content
+ + Page content + |
+ + |
| 9 | +main_section |
+ + Text Editor | +
+ Main Section
+ + Content in markdown format that appears on the main side of your page + |
+ + |
| 10 | +fold_10 |
+ + Fold | ++ + + | ++ |
| 11 | +custom_javascript |
+ + Section Break | ++ Custom Javascript + + | ++ |
| 12 | +insert_code |
+ + Check | +
+ Insert Code
+ + Add code as <script> + |
+ + |
| 13 | +javascript |
+ + Code | ++ Javascript + + | +
+ Javascript+ |
+
| 14 | +custom_css |
+ + Section Break | ++ Custom CSS + + | ++ |
| 15 | +insert_style |
+ + Check | ++ Insert Style + + | ++ |
| 16 | +css |
+ + Code | ++ CSS + + | +
+ CSS+ |
+
| 17 | +section_break_17 |
+ + Section Break | ++ + + | ++ |
| 18 | +enable_comments |
+ + Check | ++ Enable Comments + + | ++ |
| 19 | +text_align |
+ + Select | ++ Text Align + + | +
+ Left +Center +Right+ |
+
| 20 | +column_break_20 |
+ + Column Break | ++ + + | ++ |
| 21 | +parent_web_page |
+ + Link | ++ Parent Web Page + + | ++ + + + +Web Page + + + + | +
| 22 | +parent_website_route |
+ + Read Only | ++ Parent Website Route + + | ++ |
| 23 | +idx |
+ + Int | +
+ Priority
+ + 0 is highest + |
+ + |
| 24 | +template_path |
+ + Data | ++ Template Path + + | ++ |
| 25 | +sb2 |
+ + Section Break | ++ + + | ++ |
| 26 | +description |
+ + Small Text | +
+ Description
+ + Description for search engine optimization. + |
+ + |
| 27 | +header |
+ + Text | +
+ Header
+ + HTML for header section. Optional + |
+ + |
Inherits from frappe.website.website_generator.WebsiteGenerator + +
+ + + check_for_redirect + (self, context) +
+No docs
++ + + get_context + (self, context) +
+No docs
++ + + get_dynamic_context + (self, context) +
+update context from .py and load sidebar from _sidebar.json if either exists
+ + + get_feed + (self) +
+No docs
++ + + get_static_content + (self, context) +
+No docs
++ + + render_dynamic + (self, context) +
+No docs
++ + + set_metatags + (self, context) +
+No docs
++ + + validate + (self) +
+No docs
++ + + frappe.website.doctype.web_page.web_page.check_broken_links + () +
+No docs
+| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +javascript |
+ + Code | ++ Javascript + + | +
+ Javascript+ |
+
Inherits from frappe.model.document.Document + +
| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +sb0 |
+ + Section Break | ++ Landing Page + + | ++ |
| 2 | +home_page |
+ + Data | +
+ Home Page
+ + Link that is the website home page. Standard Links (index, login, products, blog, about, contact) + |
+ + |
| 3 | +home_page_is_products |
+ + Check | +
+ Home Page is Products
+ + If checked, the Home page will be the default Item Group for the website. + |
+ + |
| 4 | +cb4 |
+ + Column Break | ++ + + | ++ |
| 5 | +title_prefix |
+ + Data | +
+ Title Prefix
+ + Show title in browser window as "Prefix - title" + |
+ + |
| 6 | +section_break_6 |
+ + Section Break | ++ + + | ++ |
| 7 | +website_theme |
+ + Link | ++ Website Theme + + | ++ + + + +Website Theme + + + + | +
| 8 | +website_theme_image |
+ + Image | ++ Website Theme Image + + | +
+ website_theme_image_link+ |
+
| 9 | +website_theme_image_link |
+ + Small Text | ++ Website Theme Image Link + + | ++ |
| 10 | +banner |
+ + Section Break | +
+ Banner
+ + Add a banner to the site. (small banners are usually good) + |
+ + |
| 11 | +banner_image |
+ + Attach Image | +
+ Banner Image
+ + Select an image of approx width 150px with a transparent background for best results. + |
+ + |
| 12 | +set_banner_from_image |
+ + Button | ++ Set Banner from Image + + | ++ |
| 13 | +column_break_14 |
+ + Column Break | ++ + + | ++ |
| 14 | +banner_html |
+ + Small Text | +
+ Banner HTML
+ + Banner is above the Top Menu Bar. + |
+ + |
| 15 | +top_bar |
+ + Section Break | +
+ Top Bar
+ + Menu items in the Top Bar. For setting the color of the Top Bar, go to selected Website Theme. + |
+ + |
| 16 | +brand_html |
+ + Small Text | +
+ Brand HTML
+ + Brand is what appears on the top-left of the toolbar. If it is an image, make sure it +has a transparent background and use the <img /> tag. Keep size as 200px x 30px + |
+ + |
| 17 | +top_bar_items |
+ + Table | ++ Top Bar Items + + | ++ + + + +Top Bar Item + + + + | +
| 18 | +sidebar |
+ + Section Break | +
+ Sidebar
+ + Sidebar Links for Home Page only + |
+ + |
| 19 | +sidebar_items |
+ + Table | ++ Sidebar Items + + | ++ + + + +Top Bar Item + + + + | +
| 20 | +footer |
+ + Section Break | ++ Footer + + | ++ |
| 21 | +copyright |
+ + Data | ++ Copyright + + | ++ |
| 22 | +address |
+ + Text Editor | +
+ Address
+ + Address and other legal information you may want to put in the footer. + |
+ + |
| 23 | +footer_items |
+ + Table | ++ Footer Items + + | ++ + + + +Top Bar Item + + + + | +
| 24 | +hide_footer_signup |
+ + Check | ++ Hide Footer Signup + + | ++ |
| 25 | +integrations |
+ + Section Break | ++ Integrations + + | ++ |
| 26 | +google_analytics_id |
+ + Data | +
+ Google Analytics ID
+ + Add Google Analytics ID: eg. UA-89XXX57-1. Please search help on Google Analytics for more information. + |
+ + |
| 27 | +column_break_17 |
+ + Column Break | ++ + + | ++ |
| 28 | +google_plus_one |
+ + Check | ++ Google Plus One + + | ++ |
| 29 | +facebook_share |
+ + Check | ++ Facebook Share + + | ++ |
| 30 | +linked_in_share |
+ + Check | ++ Linked In Share + + | ++ |
| 31 | +twitter_share |
+ + Check | ++ Twitter Share + + | ++ |
| 32 | +twitter_share_via |
+ + Data | +
+ Twitter Share via
+ + Tweet will be shared via your user account (if specified) + |
+ + |
| 33 | +misc_section |
+ + Section Break | ++ More Information + + | ++ |
| 34 | +favicon |
+ + Attach | +
+ FavIcon
+ + An icon file with .ico extension. Should be 16 x 16 px. Generated using a favicon generator. [favicon-generator.org] + |
+ + |
| 35 | +subdomain |
+ + Text | +
+ Subdomain
+ + Sub-domain provided by erpnext.com + |
+ + |
| 36 | +column_break_28 |
+ + Column Break | ++ + + | ++ |
| 37 | +disable_signup |
+ + Check | +
+ Disable Signup
+ + Disable Customer Signup link in Login page + |
+ + |
| 38 | +section_break_38 |
+ + Section Break | ++ + + | ++ |
| 39 | +head_html |
+ + Code | +
+ <head> HTML
+ + Added HTML in the <head> section of the web page, primarily used for website verification and SEO + |
+
+ HTML+ |
+
Inherits from frappe.model.document.Document + +
+ + + clear_cache + (self) +
+No docs
++ + + on_update + (self) +
+No docs
++ + + validate + (self) +
+No docs
++ + + validate_footer_items + (self) +
+clear parent label in footer
++ + + validate_home_page + (self) +
+No docs
++ + + validate_top_bar_items + (self) +
+validate url in top bar items
++ + + frappe.website.doctype.website_settings.website_settings.get_website_settings + () +
+No docs
+Table Name: tabWebsite Slideshow
| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +slideshow_name |
+ + Data | ++ Slideshow Name + + | ++ |
| 2 | +sb0 |
+ + Section Break | +
+
+ + Note: For best results, images must be of the same size and width must be greater than height. + |
+ + |
| 3 | +slideshow_items |
+ + Table | ++ Slideshow Items + + | ++ + + + +Website Slideshow Item + + + + | +
| 4 | +header |
+ + Text Editor | +
+ Header
+ + This goes above the slideshow. + |
+ + |
Inherits from frappe.model.document.Document + +
+ + + frappe.website.doctype.website_slideshow.website_slideshow.get_slideshow + (doc) +
+No docs
+Table Name: tabWebsite Slideshow Item
| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +image |
+ + Attach | ++ Image + + | ++ |
| 2 | +heading |
+ + Data | ++ Heading + + | ++ |
| 3 | +description |
+ + Text | ++ Description + + | ++ |
Table Name: tabWebsite Theme
| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +theme |
+ + Data | ++ Theme + + | ++ |
| 2 | +module |
+ + Link | ++ Module + + | ++ + + + +Module Def + + + + | +
| 3 | +apply_style |
+ + Check | +
+ Apply Style
+ + This must be checked if the below style settings are applicable + |
+ + |
| 4 | +custom |
+ + Check | ++ Custom? + + | ++ |
| 5 | +column_break_2 |
+ + Column Break | ++ + + | ++ |
| 6 | +bootstrap |
+ + Small Text | +
+ Link to Bootstrap CSS
+ + Link to your Bootstrap theme + |
+ + |
| 7 | +section_break_14 |
+ + Section Break | ++ + + | ++ |
| 8 | +font_size |
+ + Select | ++ Font Size + + | +
+ +12px +13px +14px +15px +16px +17px +18px+ |
+
| 9 | +text_webfont |
+ + Data | +
+ Google Font (Text)
+ + Add the name of a "Google Web Font" e.g. "Open Sans" + |
+ + |
| 10 | +heading_webfont |
+ + Data | +
+ Google Font (Heading)
+ + Add the name of a "Google Web Font" e.g. "Open Sans" + |
+ + |
| 11 | +column_break_18 |
+ + Column Break | ++ + + | ++ |
| 12 | +text_color |
+ + Data | ++ Text Color + + | ++ |
| 13 | +link_color |
+ + Data | ++ Link Color + + | ++ |
| 14 | +heading_style |
+ + Select | ++ Heading Style + + | +
+ +UPPERCASE +Title Case +lowercase+ |
+
| 15 | +section_break_8 |
+ + Section Break | ++ + + | ++ |
| 16 | +top_bar_color |
+ + Data | ++ Top Bar Color + + | ++ |
| 17 | +top_bar_text_color |
+ + Data | ++ Top Bar Text Color + + | ++ |
| 18 | +no_sidebar |
+ + Check | ++ Hide Sidebar + + | ++ |
| 19 | +column_break_11 |
+ + Column Break | ++ + + | ++ |
| 20 | +footer_color |
+ + Data | ++ Footer Color + + | ++ |
| 21 | +footer_text_color |
+ + Data | ++ Footer Text Color + + | ++ |
| 22 | +section_break_4 |
+ + Section Break | ++ + + | ++ |
| 23 | +background_color |
+ + Data | ++ Background Color + + | ++ |
| 24 | +column_break_6 |
+ + Column Break | ++ + + | ++ |
| 25 | +background_image |
+ + Attach Image | +
+ Background Image
+ + If image is selected, color will be ignored. + |
+ + |
| 26 | +section_break_21 |
+ + Section Break | ++ + + | ++ |
| 27 | +css |
+ + Code | ++ Style using CSS + + | ++ |
| 28 | +js |
+ + Code | ++ JavaScript + + | ++ |
Inherits from frappe.model.document.Document + +
+ + + clear_cache_if_current_theme + (self) +
+No docs
++ + + export_doc + (self) +
+Export to standard folder [module]/website_theme/[name]/[name].json.
+ + + is_standard_and_not_valid_user + (self) +
+No docs
++ + + on_trash + (self) +
+No docs
++ + + on_update + (self) +
+No docs
++ + + use_theme + (self) +
+No docs
++ + + validate + (self) +
+No docs
++ + + validate_colors + (self) +
+No docs
++ + + validate_if_customizable + (self) +
+No docs
++ + + frappe.website.doctype.website_theme.website_theme.add_website_theme + (context) +
+No docs
++ + + frappe.website.doctype.website_theme.website_theme.get_active_theme + () +
+No docs
+Public API
+ /api/method/frappe.website.doctype.website_theme.website_theme.use_theme
+
+ + + frappe.website.doctype.website_theme.website_theme.use_theme + (theme) +
+No docs
+Table Name: tabWorkflow
| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +workflow_name |
+ + Data | ++ Workflow Name + + | ++ |
| 2 | +document_type |
+ + Link | +
+ Document Type
+ + DocType on which this Workflow is applicable. + |
+ + + + + +DocType + + + + | +
| 3 | +is_active |
+ + Check | +
+ Is Active
+ + If checked, all other workflows become inactive. + |
+ + |
| 4 | +states_head |
+ + Section Break | +
+ States
+ + Different "States" this document can exist in. Like "Open", "Pending Approval" etc. + |
+ + |
| 5 | +states |
+ + Table | +
+ Document States
+ + All possible Workflow States and roles of the workflow. +Docstatus Options: 0 is"Saved", 1 is "Submitted" and 2 is "Cancelled" + |
+ + + + + +Workflow Document State + + + + | +
| 6 | +transition_rules |
+ + Section Break | +
+ Transition Rules
+ + Rules for how states are transitions, like next state and which role is allowed to change state etc. + |
+ + |
| 7 | +transitions |
+ + Table | +
+ Transitions
+ + Rules defining transition of state in the workflow. + |
+ + + + + +Workflow Transition + + + + | +
| 8 | +workflow_state_field |
+ + Data | +
+ Workflow State Field
+ + Field that represents the Workflow State of the transaction (if field is not present, a new hidden Custom Field will be created) + |
+ + |
Inherits from frappe.model.document.Document + +
+ + + create_custom_field_for_workflow_state + (self) +
+No docs
++ + + on_update + (self) +
+No docs
++ + + set_active + (self) +
+No docs
++ + + update_default_workflow_status + (self) +
+No docs
++ + + validate + (self) +
+No docs
++ + + validate_docstatus + (self) +
+No docs
+Table Name: tabWorkflow Action
| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +workflow_action_name |
+ + Data | ++ Workflow Action Name + + | ++ |
Inherits from frappe.model.document.Document + +
Table Name: tabWorkflow Document State
| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +state |
+ + Link | ++ State + + | ++ + + + +Workflow State + + + + | +
| 2 | +doc_status |
+ + Select | +
+ Doc Status
+ + 0 - Draft; 1 - Submitted; 2 - Cancelled + |
+
+ 0 +1 +2+ |
+
| 3 | +update_field |
+ + Select | ++ Update Field + + | ++ |
| 4 | +update_value |
+ + Data | ++ Update Value + + | ++ |
| 5 | +allow_edit |
+ + Link | ++ Only Allow Edit For + + | ++ + + + +Role + + + + | +
| 6 | +message |
+ + Text | ++ Message + + | ++ |
Table Name: tabWorkflow State
| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +workflow_state_name |
+ + Data | ++ State + + | ++ |
| 2 | +icon |
+ + Select | +
+ Icon
+ + Icon will appear on the button + |
+
+ +glass +music +search +envelope +heart +star +star-empty +user +film +th-large +th +th-list +ok +remove +zoom-in +zoom-out +off +signal +cog +trash +home +file +time +road +download-alt +download +upload +inbox +play-circle +repeat +refresh +list-alt +lock +flag +headphones +volume-off +volume-down +volume-up +qrcode +barcode +tag +tags +book +bookmark +print +camera +font +bold +italic +text-height +text-width +align-left +align-center +align-right +align-justify +list +indent-left +indent-right +facetime-video +picture +pencil +map-marker +adjust +tint +edit +share +check +move +step-backward +fast-backward +backward +play +pause +stop +forward +fast-forward +step-forward +eject +chevron-left +chevron-right +plus-sign +minus-sign +remove-sign +ok-sign +question-sign +info-sign +screenshot +remove-circle +ok-circle +ban-circle +arrow-left +arrow-right +arrow-up +arrow-down +share-alt +resize-full +resize-small +plus +minus +asterisk +exclamation-sign +gift +leaf +fire +eye-open +eye-close +warning-sign +plane +calendar +random +comment +magnet +chevron-up +chevron-down +retweet +shopping-cart +folder-close +folder-open +resize-vertical +resize-horizontal +hdd +bullhorn +bell +certificate +thumbs-up +thumbs-down +hand-right +hand-left +hand-up +hand-down +circle-arrow-right +circle-arrow-left +circle-arrow-up +circle-arrow-down +globe +wrench +tasks +filter +briefcase +fullscreen+ |
+
| 3 | +style |
+ + Select | +
+ Style
+ + Style represents the button color: Success - Green, Danger - Red, Inverse - Black, Primary - Dark Blue, Info - Light Blue, Warning - Orange + |
+
+ +Primary +Info +Success +Warning +Danger +Inverse+ |
+
Inherits from frappe.model.document.Document + +
Table Name: tabWorkflow Transition
| Sr | +Fieldname | +Type | +Label | +Options | +
|---|---|---|---|---|
| 1 | +state |
+ + Link | ++ State + + | ++ + + + +Workflow State + + + + | +
| 2 | +action |
+ + Link | ++ Action + + | ++ + + + +Workflow Action + + + + | +
| 3 | +next_state |
+ + Link | ++ Next State + + | ++ + + + +Workflow State + + + + | +
| 4 | +allowed |
+ + Link | ++ Allowed + + | ++ + + + +Role + + + + | +
Build extensions to ERPNext or make your own database driven app
+
+ The Frappe Framework is a server side and client side +framework and is built with the philosophy make it "battries included". +It has libraries and API for authentication, MVC, permissions, REST API, +templating, admin interface, forms, reports and much more.
+ +Frappe Framework was designed to build ERPNext, open source +ERP for managing small and medium sized businesses.
+ +The MIT License (MIT)
+ +Copyright (c) 2015 Frappe Technologies Pvt. Ltd.
+ +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+ +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ + + \ No newline at end of file diff --git a/frappe/docs/user/guides/adding-module-icons-on-desktop.md b/frappe/docs/user/guides/adding-module-icons-on-desktop.md new file mode 100644 index 0000000000..e6e0156bf6 --- /dev/null +++ b/frappe/docs/user/guides/adding-module-icons-on-desktop.md @@ -0,0 +1,34 @@ +To create a module icon for a Page, List or Module, you will have to edit the `config/desktop.py` file in your app. + +In this file you will have to write the `get_data` method that will return a dict object with the module icon parameters + +### Example 1: Module Icon + + def get_data(): + return { + "Accounts": { + "color": "#3498db", + "icon": "octicon octicon-repo", + "type": "module" + }, + } + +### Example 2: List Icon + + def get_data(): + return { + "To Do": { + "color": "#f1c40f", + "icon": "icon-check", + "icon": "octicon octicon-check", + "label": _("To Do"), + "link": "List/ToDo", + "doctype": "ToDo", + "type": "list" + }, + } + + +Note: Module views are visible based on permissions. + + \ No newline at end of file diff --git a/frappe/docs/user/guides/apps.md b/frappe/docs/user/guides/apps.md new file mode 100644 index 0000000000..9f89df75c8 --- /dev/null +++ b/frappe/docs/user/guides/apps.md @@ -0,0 +1,116 @@ +# Frappe Apps + +Frappe Apps are Python packages which use the Frappe platform. They can live +anywhere on the [Python +path](https://docs.python.org/2/tutorial/modules.html#the-module-search-path) +and must have an entry in the `apps.txt` file. + + +### Creating an app + +Frappe ships with a boiler plate for a new app. The command `bench make-app +app-name` helps you start a new app by starting an interactive shell. + + + % bench make-app sample_app + App Name: sample_app + App Title: Sample App + App Description: This is a sample app. + App Publisher: Acme Inc. + App Icon: icon-linux + App Color: #6DAFC9 + App Email: info@example.com + App URL: http://example.com + App License: MIT + +The above command would create an app with the following directory structure. + + sample_app + ├── license.txt + ├── MANIFEST.in + ├── README.md + ├── sample_app + │ ├── __init__.py + │ ├── sample_app + │ │ └── __init__.py + │ ├── config + │ │ ├── desktop.py + │ │ └── __init__.py + │ ├── hooks.py + │ ├── modules.txt + │ ├── patches.txt + │ └── templates + │ ├── generators + │ │ └── __init__.py + │ ├── __init__.py + │ ├── pages + │ │ └── __init__.py + │ └── statics + └── setup.py + +Here, "App Icon" is a font awesome class that you can select from +[http://fortawesome.github.io/Font-Awesome/icons/](http://fortawesome.github.io/Font-Awesome/icons/). + +The boiler plate contains just enough files to show your app icon on the [Desk]. + +### Files in the app + +#### `hooks.py` + +The `hooks.py` file defines the metadata of your app and integration points +with other parts of Frappe or Frappe apps. Examples of such parts include task +scheduling or listening to updates to different documents in the system. For +now, it just contains the details you entered during app creation. + + + app_name = "sample-app" + app_title = "Sample App" + app_publisher = "Acme Inc." + app_description = "This is a sample app." + app_icon = "fa-linux" + app_color = "black" + app_email = "info@example.com" + app_url = "http://example.com" + app_version = 0.0.1 + +#### `modules.txt` + +Modules in Frappe help you organize Documents in Frappe and they are defined in +the `modules.txt` file in your app. It is necessary for every [DocType] to be +attached to a module. By default a module by the name of your app is added. +Also, each module gets an icon on the [Desk]. For example, the [ERPNext] app is +organized in the following modules. + + accounts + buying + home + hr + manufacturing + projects + selling + setup + stock + support + utilities + contacts + +### Adding app to a site + +Once you have an app, whether it's the one you just created or any other you +downloaded, you are required to do the following things. + +1. Add to Python path. It is recommend to do this using a package manager called + [pip]. `pip install -e src/sample_app` would add the `sample_app` in editable + mode ie. it will be linked to the source from wherefyou install and + reinstalling everytime you make a change is not required. This method is + highly recommended if you are developing the app yourself. + + If you just want to use pip can install packages in a variety of other ways. + TODO: add link + +2. Add line with your app name to apps.txt (in your sites directory) as + explained in [sites](/help/sites) + + +TODO: Add screenshot + diff --git a/frappe/docs/user/guides/checking-problems-in-bench.md b/frappe/docs/user/guides/checking-problems-in-bench.md new file mode 100644 index 0000000000..60edb8d5b4 --- /dev/null +++ b/frappe/docs/user/guides/checking-problems-in-bench.md @@ -0,0 +1,15 @@ + + +If you're experiencing delays in scheduled jobs or they don't seem to run, you run run the following command to diagnose the issue. + +`bench frappe --doctor` + +A desirable output is like below + + + Workers online: True + Pending tasks 0 + Timed out locks: + + +We'll be adding more health checks soon. \ No newline at end of file diff --git a/frappe/docs/user/guides/configuring-https.md b/frappe/docs/user/guides/configuring-https.md new file mode 100644 index 0000000000..4fb90be226 --- /dev/null +++ b/frappe/docs/user/guides/configuring-https.md @@ -0,0 +1,43 @@ + +### Get the required files + +You can buy a SSL certificate from a trusted Certificate Authority or generate your own. For self signed certificates the browser will show a warning that the certificate is not trusted. + +The files required are + +* Certificate (usually with extension .crt) +* Decrypted private key + +If you have multiple certificates (primary and intermediate), you will have to concatenate them. For example, + + cat your_certificate.crt CA.crt >> certificate_bundle.crt + +Also make sure that your private key is not world readable. Generally, it is owned and readable only by root + + chown root private.key + chmod 600 private.key + +### Move the two files to an appropriate location + + mkdir /etc/nginx/conf.d/ssl + mv private.key /etc/nginx/conf.d/ssl/private.key + mv certificate_bundle.crt /etc/nginx/conf.d/ssl/certificate_bundle.crt + +### Setup nginx config + +Set the paths to the certificate and private key for your site + + bench set-ssl-certificate site1.local /etc/nginx/ssl/certificate_bundle.crt + bench set-ssl-key site1.local /etc/nginx/ssl/private.key + +### Generate nginx config + + bench setup nginx + +### Reload nginx + + service nginx reload + +or + + systemctl reload nginx # for CentOS 7 \ No newline at end of file diff --git a/frappe/docs/user/guides/custom-module-icon.md b/frappe/docs/user/guides/custom-module-icon.md new file mode 100644 index 0000000000..609f7f3803 --- /dev/null +++ b/frappe/docs/user/guides/custom-module-icon.md @@ -0,0 +1,21 @@ +If you want to create a custom icon for your module, you will have to create an SVG file for your module and set the path to this file in the `desktop/config.py` of your app.Frappe handles failure of jobs in the following way,
1) If a job fails, (raises exception), it's logged in Scheduler Log and logs/worker.error.log.
2) Keeps a lock file and would not run anymore if lock file is there.
3) Raises LockTimeoutError in case the lock file is more than 10 minutes old.
You can configure email notification for scheduler errors. By writing a file, sites/common_site_config.json with content
{
+ "celery_error_emails": {
+ "ADMINS": [
+ [
+ "Person 1",
+ "person1@example.com"
+ ],
+ [
+ "Person2 ",
+ "person2@example.com"
+ ]
+ ],
+ "SERVER_EMAIL": "exceptions@example.com"
+ }
+}
+
+One limitation is that it'll use local mailserver on port 25 to send the emails.
\ No newline at end of file diff --git a/frappe/docs/user/guides/executing-code-on-doctype-events.md b/frappe/docs/user/guides/executing-code-on-doctype-events.md new file mode 100644 index 0000000000..a5b57e0920 --- /dev/null +++ b/frappe/docs/user/guides/executing-code-on-doctype-events.md @@ -0,0 +1,29 @@ +To execute code when a DocType is inserted, validated (before saving), updated, submitted, cancelled, deleted, you must write in the DocType's controller module. + +#### 1. Controller Module + +The controller module exists in the `doctype` folder in the Module of the `DocType`. For example, the controller for **ToDo** exists in `frappe/desk/doctype/todo/todo.py` (version 5). A controller template is created when the DocType is created. which looks like + + from __future__ import unicode_literals + + import frappe + from frappe.model.document import Document + + class CustomType(Document): + pass + +#### 2. Document Properties + +All the fields and child tables are available to the class as attributes. For example the **name** property is `self.name` + +#### 3. Adding Methods + +In this module, you can add standard methods to the class that are called when a document of that type is created. Standard Handlers are: + +1. `autoname`: Called while naming. You can set the `self.name` property in the method. +1. `before_insert`: Called before a document is inserted. +1. `validate`: Called before document is saved. You can throw an exception if you don't want the document to be saved +1. `on_update`: Called after the document is inserted or updated in the database. +1. `on_submit`: Called after submission. +1. `on_cancel`: Called after cancellation. +1. `on_trash`: Called after document is deleted. diff --git a/frappe/docs/user/guides/fetch-custom-field-value-from-master-to-all-related-transactions.md b/frappe/docs/user/guides/fetch-custom-field-value-from-master-to-all-related-transactions.md new file mode 100644 index 0000000000..bbf1c863c7 --- /dev/null +++ b/frappe/docs/user/guides/fetch-custom-field-value-from-master-to-all-related-transactions.md @@ -0,0 +1,20 @@ +Let's say, there is a custom field "VAT Number" in Supplier master, which should be fetched in Purchase Order document. +

If field type of "VAT Number" in Purchase Order is other than `Read Only`, then to fetch the value, a small piece of Custom Script need to be written. +\ No newline at end of file diff --git a/frappe/docs/user/guides/form-architecture.md b/frappe/docs/user/guides/form-architecture.md new file mode 100644 index 0000000000..30b59da7f4 --- /dev/null +++ b/frappe/docs/user/guides/form-architecture.md @@ -0,0 +1,171 @@ + +ERPNext is built on top of framework called **Frappe**. In this framework, each form is created as a table called 'Doctype'. Each Doctype has fields listed as a row, with properties define for them assigned like [field type](https://erpnext.com/kb/setup/field-types), print show/hide, Mandatory etc. + +For an instance, Sales order is a table, in which sales order fields are defined as a rows. + +Doctype - Sales Order + +
i. Go to Setup -> Customize -> Custom Script. +
ii. Select DocType as `Purchase Order`. +
iii. Add Script `cur_frm.add_fetch('supplier', 'vat_number', 'vat_number')` +
iv. Save the Custom Script. +
v. Clear cache before testing. +
+
| Field ID | +Field Type | +Print Hide | +Mandatory | +Hidden | +
| Series | +Select | +1 (checked) | +1 | +0 (unchecked) | +
| Customer | +Link | +0 | +1 | +0 | +
| Item | +Table | +0 | +1 | +0 | +
| Transaction | +Table | +Doctype Name | +
| Quotation | +Quotation | +Quotation | +
| Quotation Item table | +Quotation Item | +|
| Quotation Taxes | +Sales Taxes and Charges | +|
| Sales Order | +Sales Order | +Sales Order | +
| Sales Order Item table | +Sales Order Item | +|
| Sales Order Taxes | +Sales Taxes and Charges | +|
| Delivery Note | +Delivery note | +Delivery Note | +
| Delivery Note Item table | +Delivery Note Item | +|
| Delivery Note Taxes | +Sales Taxes and Charges | +|
| Sales Invoice | +sales invoice | +Sales Invoice | +
| + | Sales Invoice Item table | +Sales Invoice Item | +
| + | Sales Invoice Tax table | +Sales Taxes and Charges | +
| Purchase Order | +Purchase Order | +Purchase Order | +
| + | Purchase Order Item table | +Purchase Order Item | +
| Purchase Receipt | +Purchase Receipt | +Purchase Receipt | +
| + | Purchase Receipt Item table | +Purchase Receipt Item | +
| Purchase Invoice | +Purchase Invoice | +Purchase Invoice | +
| + | Purchase Invoice Item table | +Purchase Invoice Item | +
| + | Purchase Invoice Tax table | +Purchase Taxes and Charges | +
| Journal Voucher | +Journal Voucher | +Journal Voucher | +
| + | Journal Voucher Accounts table | +Journal Voucher Detail | +
+ Recalculate totals when a Journal Entry row has been added
+ + frappe.ui.form.on("Journal Entry Account", "accounts_add", function(frm){ + cur_frm.cscript.update_totals(frm.doc); + }); + + + +Recalculate totals when a Journal Entry row has been deleted
+ + frappe.ui.form.on("Journal Entry Account", "accounts_remove", function(frm){ + cur_frm.cscript.update_totals(frm.doc); + }); + + \ No newline at end of file diff --git a/frappe/docs/user/guides/using-html-templates-in-javascript.md b/frappe/docs/user/guides/using-html-templates-in-javascript.md new file mode 100644 index 0000000000..db0cd90b4c --- /dev/null +++ b/frappe/docs/user/guides/using-html-templates-in-javascript.md @@ -0,0 +1,42 @@ +Often while building javascript interfaces, there is a need to render DOM as an HTML template. Frappe Framework uses John Resig's Microtemplate script to render HTML templates in the Desk application. + +> Note 1: In Frappe we use the Jinja-like `{%` tags to embed code rather than the standard `<%` + +> Note 2: Never use single quotes `'` inside the HTML template. + +To render a template, + +1. Create a template `html` file in your app. e.g. `address_list.html` +1. Add it to `build.json` for your app (you can include it in `frappe.min.js` or your own javascript file). +1. To render it in your app, use `frappe.render(frappe.templates.address_list, {[context]})` + +#### Example Template: + +From `erpnext/public/js/templates/address_list.js` + + + + {% for(var i=0, l=addr_list.length; i{%= addr_list[i].display %}
+{%= __("No address added yet.") %}
+ {% } %} + + + + + \ No newline at end of file diff --git a/frappe/docs/user/guides/where-do-i-find-standard-print-formats.md b/frappe/docs/user/guides/where-do-i-find-standard-print-formats.md new file mode 100644 index 0000000000..00e351c615 --- /dev/null +++ b/frappe/docs/user/guides/where-do-i-find-standard-print-formats.md @@ -0,0 +1,40 @@ +Standard Print formats are auto generated from the layout of the DocType. You can customize the standard format by +As there are not templates that are generated for standard Print Formats, you will have to create new templates from scratch using the Jinja Templating Language via
+Setup > Printing and Branding > Print Format + +
+Tip: You can import Standard Template macros for building your print formats. + +
+Example, adding the standard header:
+
+
{% raw %}{%- from "templates/print_formats/standard_macros.html" import add_header -%}
+{{ add_header() }}{% endraw %}
+
diff --git a/frappe/docs/user/guides/writing-tests.md b/frappe/docs/user/guides/writing-tests.md
new file mode 100644
index 0000000000..f151416ccd
--- /dev/null
+++ b/frappe/docs/user/guides/writing-tests.md
@@ -0,0 +1,109 @@
+# Writing Tests
+
+### Introduction
+
+Frappe provides some basic tooling to quickly write automated tests. There are some basic rules:
+
+1. Test can be anywhere in your repository but must begin with `test_` and should be a `.py` file.
+1. Tests must run on a site that starts with `test_`. This is to prevent accidental loss of data.
+1. Test stubs are automatically generated for new DocTypes.
+1. Frappe test runner will automatically build test records for dependant DocTypes identified by the `Link` type field (Foreign Key)
+1. Tests can be executed using `bench run-tests`
+1. For non-DocType tests, you can write simple unittests and prefix your file names with `test_`.
+
+### Tests for a DocType
+
+#### Writing DocType Tests:
+
+1. Records that are used for testing are stored in a file `test_records.json` in the doctype folder. [For example see the Event Tests](https://github.com/frappe/frappe/blob/develop/frappe/core/doctype/event/test_records.json).
+1. Test cases are in a file named `test_[doctype].py`
+1. To provide the test records (and dependencies) call `test_records = frappe.get_test_records('Event')` in your test case file.
+
+#### Example (for `test_records.json`):
+
+ [
+ {
+ "doctype": "Event",
+ "subject":"_Test Event 1",
+ "starts_on": "2014-01-01",
+ "event_type": "Public"
+ },
+ {
+ "doctype": "Event",
+ "starts_on": "2014-01-01",
+ "subject":"_Test Event 2",
+ "event_type": "Private"
+ },
+ {
+ "doctype": "Event",
+ "starts_on": "2014-01-01",
+ "subject":"_Test Event 3",
+ "event_type": "Private",
+ "event_individuals": [{
+ "person": "test1@example.com"
+ }]
+ }
+ ]
+
+
+#### Example (for `test_event.py`):
+
+ # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
+ # MIT License. See license.txt
+
+ import frappe
+ import frappe.defaults
+ import unittest
+
+ # load test records and dependencies
+ test_records = frappe.get_test_records('Event')
+
+ class TestEvent(unittest.TestCase):
+ def tearDown(self):
+ frappe.set_user("Administrator")
+
+ def test_allowed_public(self):
+ frappe.set_user("test1@example.com")
+ doc = frappe.get_doc("Event", frappe.db.get_value("Event", {"subject":"_Test Event 1"}))
+ self.assertTrue(frappe.has_permission("Event", doc=doc))
+
+ def test_not_allowed_private(self):
+ frappe.set_user("test1@example.com")
+ doc = frappe.get_doc("Event", frappe.db.get_value("Event", {"subject":"_Test Event 2"}))
+ self.assertFalse(frappe.has_permission("Event", doc=doc))
+
+ def test_allowed_private_if_in_event_user(self):
+ frappe.set_user("test1@example.com")
+ doc = frappe.get_doc("Event", frappe.db.get_value("Event", {"subject":"_Test Event 3"}))
+ self.assertTrue(frappe.has_permission("Event", doc=doc))
+
+ def test_event_list(self):
+ frappe.set_user("test1@example.com")
+ res = frappe.get_list("Event", filters=[["Event", "subject", "like", "_Test Event%"]], fields=["name", "subject"])
+ self.assertEquals(len(res), 2)
+ subjects = [r.subject for r in res]
+ self.assertTrue("_Test Event 1" in subjects)
+ self.assertTrue("_Test Event 3" in subjects)
+ self.assertFalse("_Test Event 2" in subjects)
+
+#### Running Tests
+
+To run a test for a doctype
+
+ bench run-tests --doctype [doctype]
+
+This function will build all the test dependencies and run your tests.
+
+### Running All Tests
+
+To run all tests:
+
+ bench run-tests
+
+---
+
+## Client Side Testing (Using Selenium)
+
+> This feature is still under development.
+
+For an example see, [https://github.com/frappe/erpnext/blob/develop/erpnext/tests/sel_tests.py](https://github.com/frappe/erpnext/blob/develop/erpnext/tests/sel_tests.py)
diff --git a/frappe/docs/user/index.md b/frappe/docs/user/index.md
new file mode 100644
index 0000000000..a25785e59e
--- /dev/null
+++ b/frappe/docs/user/index.md
@@ -0,0 +1,3 @@
+# Develop Apps with Frappe
+
+{index}
diff --git a/frappe/docs/user/index.txt b/frappe/docs/user/index.txt
new file mode 100644
index 0000000000..dfc33261aa
--- /dev/null
+++ b/frappe/docs/user/index.txt
@@ -0,0 +1,2 @@
+tutorial
+guides
diff --git a/frappe/docs/user/tutorial/app.md b/frappe/docs/user/tutorial/app.md
new file mode 100644
index 0000000000..4352ddee88
--- /dev/null
+++ b/frappe/docs/user/tutorial/app.md
@@ -0,0 +1,9 @@
+# What is an Application
+
+An Application in Frappe in just a standard Python application. You can structure a Frappe Application the same way you structure a standard Python Application. For deployment, Frappe uses the standard Python Setuptools, so you can easily port and install the application on any machine.
+
+Frappe Framework provides a WSGI interface and for development you can use the built-in Werkzeug server. For implementing in production, we recommend using nginx and gunicorn.
+
+Frappe also has a multi-tenant architecture, grounds up. This means that you can run multiple "sites" in your setup, each could be serving a different set of applications and users. The database for each site is separate.
+
+{next}
diff --git a/frappe/docs/user/tutorial/before.md b/frappe/docs/user/tutorial/before.md
new file mode 100644
index 0000000000..71df8823de
--- /dev/null
+++ b/frappe/docs/user/tutorial/before.md
@@ -0,0 +1,48 @@
+# Before You Start
+
+A list of tools, technologies that will be very helpful for building apps in Frappe.
+ +There are a number of good tutorials online and we found [CodeAcademy](http://www.codecademy.com/) to be the most beautiful ones out there here bunch of lessons you can learn from CodeAcademy + +--- + +#### 1. Python + +Server side Frappe is written in Python and its a good idea to [quickly learn Python](http://www.codecademy.com/tracks/python) before you started digging into Frappe. Another good place to learn Python is the [tutorial on docs.python.org](https://docs.python.org/2.7/tutorial/index.html). Note that Frappe uses Python 2.7 + +To write quality server side code, you must include automatic tests. You can learn the [basics of test driven development here](http://code.tutsplus.com/tutorials/beginning-test-driven-development-in-python--net-30137). + +--- + +#### 2. Databases MariaDB / MySQL + +You need to understand the basics of databases, like how to install, login, create new databases, and basic SQL queries. Here is a [very quick introduction to MySQL](https://www.digitalocean.com/community/tutorials/a-basic-mysql-tutorial) or head to [the MariaDB site for a more detailed understanding](https://mariadb.com/kb/en/mariadb/documentation/getting-started/) + +--- + +#### 3. HTML / CSS + +If you are building user interfaces, you will need to [learn basic HTML / CSS](http://www.codecademy.com/tracks/web) and the [Boostrap CSS Framework](http://getbootstrap.com) + +--- + +#### 4. Building UI with Javascript and JQuery + +To customize forms and create new rich user interfaces, it is best to [learn Javacsript](http://www.codecademy.com/tracks/javascript) and the [popular library JQuery](http://www.codecademy.com/tracks/jquery). + +--- + +#### 5. Customizing Prints and Web pages with Jinja Templating + +If you are customizing Print templates, you need to learn the [Jinja Templating language](http://jinja.pocoo.org/). It is an easy way to create dynamic web pages (HTML). + +--- + +#### 6. Git and GitHub + +[Learn how to contribute back to an open source project usign Git and GitHub](https://guides.github.com/activities/contributing-to-open-source/), two great tools to help you manage your code and share it with others. + +--- + +When you are ready, [try building a sample application on Frappe](/tutorial/app) + diff --git a/frappe/docs/user/tutorial/bench.md b/frappe/docs/user/tutorial/bench.md new file mode 100644 index 0000000000..e720d9dc98 --- /dev/null +++ b/frappe/docs/user/tutorial/bench.md @@ -0,0 +1,11 @@ +# Installing the Frappe Bench + +Easiest way to setup frappe on a Unix Like system is to use frappe-bench. Read the detailed instructions on how to install using Frappe Bench. + +> [https://github.com/frappe/bench](https://github.com/frappe/bench) + +With Frappe Bench you will be able to setup and host multiple applications and sites and it will also setup a Python Virtualenv so that you can have an isolated environment to run your applications (and will not have version conflict with other development environments). + +The `bench` command line tool will also be installed that will help you in development and management of the installation. + +{next} diff --git a/frappe/docs/user/tutorial/conclusion.md b/frappe/docs/user/tutorial/conclusion.md new file mode 100644 index 0000000000..f45b64ba23 --- /dev/null +++ b/frappe/docs/user/tutorial/conclusion.md @@ -0,0 +1,7 @@ +# Conclusion + + +We hope this will give you an overview of how applications are developed in Frappe. The objective was to briefly touch on the various aspects of application development and give a broad overview. To get help on specific issues, look at the API. + +For help, join the community at the [chat channel on Gitter](https://gitter.im/frappe/erpnext) or the [developer forum](https://discuss.erpnext.com) + diff --git a/frappe/docs/user/tutorial/controllers.md b/frappe/docs/user/tutorial/controllers.md new file mode 100644 index 0000000000..5397268941 --- /dev/null +++ b/frappe/docs/user/tutorial/controllers.md @@ -0,0 +1,59 @@ +# Controllers + +Next step would be adding methods and event handlers to models. In your app, we sould like to ensure that if a Library Tranasction is made, the Artilce in question must be in stock and the member loaning the Article must have a valid membership. + +For this, we can write a validation just before the Library Transaction object is saved. To do this, open the `library_management/doctype/library_transaction/library_transaction.py` template. + +This file is the controller for the Library Transaction object. In this you can write methods for: + +1. `before_insert` +1. `validate` (before inserting or updating) +1. `on_update` (after saving) +1. `on_submit` (when document is set as submitted) +1. `on_cancel` +1. `on_trash` (before it is about to be deleted) + +You can write methods for these events and they will be called by the framework when the document is saved etc. + +Here is the finished controller: + + from __future__ import unicode_literals + import frappe + from frappe import _ + from frappe.model.document import Document + + class LibraryTransaction(Document): + def validate(self): + last_transaction = frappe.get_list("Library Transaction", + fields=["transaction_type", "transaction_date"], + filters = { + "article": self.article, + "transaction_date": ("<=", self.transaction_date), + "name": ("!=", self.name) + }) + if self.transaction_type=="Issue": + msg = _("Article {0} {1} has not been recorded as returned since {2}") + if last_transaction and last_transaction[0].transaction_type=="Issue": + frappe.throw(msg.format(self.article, self.article_name, + last_transaction[0].transaction_date)) + else: + if not last_transaction or last_transaction[0].transaction_type!="Issue": + frappe.throw(_("Cannot return article not issued")) + +In this script: + +1. We get the last trasaction before the current transaction date using the query function `frappe.get_list` +1. If the last transaction is something we don't like we throw an exception using `frappe.throw` +1. We use `_("text")` method to identify translatable strings. + +Check if your validations work by creating new records + +
+
+#### Debugging
+
+To Debug, always keep your JS Console open. Lookout for both Javascript and server tracebacks.
+
+Also check your terminal window for exceptions. Any **500 Internal Server Errors** will get printed in your terminal where on which your server is running.
+
+{next}
diff --git a/frappe/docs/user/tutorial/doctype-directory-structure.md b/frappe/docs/user/tutorial/doctype-directory-structure.md
new file mode 100644
index 0000000000..bcb53d9541
--- /dev/null
+++ b/frappe/docs/user/tutorial/doctype-directory-structure.md
@@ -0,0 +1,31 @@
+# DocType Directory Structure
+
+After saving the DocTypes, check that the model `.json` and `.py` files are created in the `library_management/library_management` module. The directory structure after creating the models should look like this:
+
+ .
+ ├── MANIFEST.in
+ ├── README.md
+ ├── library_management
+ ..
+ │ ├── library_management
+ │ │ ├── __init__.py
+ │ │ └── doctype
+ │ │ ├── __init__.py
+ │ │ ├── article
+ │ │ │ ├── __init__.py
+ │ │ │ ├── article.json
+ │ │ │ └── article.py
+ │ │ ├── library_member
+ │ │ │ ├── __init__.py
+ │ │ │ ├── library_member.json
+ │ │ │ └── library_member.py
+ │ │ ├── library_membership
+ │ │ │ ├── __init__.py
+ │ │ │ ├── library_membership.json
+ │ │ │ └── library_membership.py
+ │ │ └── library_transaction
+ │ │ ├── __init__.py
+ │ │ ├── library_transaction.json
+ │ │ └── library_transaction.py
+
+{next}
diff --git a/frappe/docs/user/tutorial/doctypes.md b/frappe/docs/user/tutorial/doctypes.md
new file mode 100644
index 0000000000..7cf2aa5ce4
--- /dev/null
+++ b/frappe/docs/user/tutorial/doctypes.md
@@ -0,0 +1,94 @@
+# DocType
+
+After creating the Roles, let us create the **DocTypes**
+
+To create a new **DocType**, go to:
+
+> Core > Documents > Doctype > New
+
+
+
+In the DocType, first the Module, which in our case is **Library Managment**
+
+#### Adding Fields
+
+In the Fields Table, you can add the fields (properties) of the DocType (Article).
+
+Fields are much more than database columns, they can be:
+
+1. Columns in the database
+1. For Layout (section / column breaks)
+1. Child tables (Table type field)
+1. HTML
+1. Actions (button)
+1. Attachments or Images
+
+Let us add the fields of the Article.
+
+
+
+When you add fields, you need to enter the **Type**. **Label** is optional for Section Break and Column Break. **Name** (`fieldname`) is the name of the database table column and also the property of the controller. This has to be *code friendly*, i.e. it has to have small cases are _ instead of " ". If you leave the Fieldname blank, it will be automatically set when you save it.
+
+You can also set other properties of the field like whether it is mandatory, read only etc.
+
+We can add the following fields:
+
+1. Article Name (Data)
+1. Author (Data)
+1. Status (Select): For Select fields, you will enter the Options. Enter **Issued** and **Available** each on a new line in the Options box. See diagram below
+1. Publisher (Data)
+1. Language (Data)
+1. Image (Attach)
+1. Image View (Image)
+
+#### Add Permissions
+
+After adding the fields, add Permissions. For now, let us give Read, Write, Create, Delete and Report access to **Librarian**. Frappe has a finely grained Role based permission model. You can also change permissions later using the **Role Permissions Manager** from **Setup**.
+
+
+
+#### Saving
+
+Click on the **Save** button. When the button is clicked, a popup will ask you for the name. Enter it and save the DocType.
+
+Now login into mysql and check the database table created:
+
+ $ bench mysql
+ Welcome to the MariaDB monitor. Commands end with ; or \g.
+ Your MariaDB connection id is 3931
+ Server version: 5.5.36-MariaDB-log Homebrew
+
+ Copyright (c) 2000, 2014, Oracle, Monty Program Ab and others.
+
+ Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
+
+ MariaDB [library]> desc `tabArticle`;
+ +--------------+--------------+------+-----+---------+-------+
+ | Field | Type | Null | Key | Default | Extra |
+ +--------------+--------------+------+-----+---------+-------+
+ | name | varchar(255) | NO | PRI | NULL | |
+ | creation | datetime(6) | YES | | NULL | |
+ | modified | datetime(6) | YES | | NULL | |
+ | modified_by | varchar(40) | YES | | NULL | |
+ | owner | varchar(60) | YES | | NULL | |
+ | docstatus | int(1) | YES | | 0 | |
+ | parent | varchar(255) | YES | MUL | NULL | |
+ | parentfield | varchar(255) | YES | | NULL | |
+ | parenttype | varchar(255) | YES | | NULL | |
+ | idx | int(8) | YES | | NULL | |
+ | article_name | varchar(255) | YES | | NULL | |
+ | status | varchar(255) | YES | | NULL | |
+ | description | text | YES | | NULL | |
+ | image | varchar(255) | YES | | NULL | |
+ | publisher | varchar(255) | YES | | NULL | |
+ | isbn | varchar(255) | YES | | NULL | |
+ | language | varchar(255) | YES | | NULL | |
+ | author | varchar(255) | YES | | NULL | |
+ +--------------+--------------+------+-----+---------+-------+
+ 18 rows in set (0.00 sec)
+
+
+As you can see, along with the DocFields, a bunch of standard columns have also been added to the table. Important to note here are, the primary key, `name`, `onwer` is the user who has created the record, `creation` and `modified` are timestamps for creation and last modification.
+
+{next}
+
diff --git a/frappe/docs/user/tutorial/form-client-scripting.md b/frappe/docs/user/tutorial/form-client-scripting.md
new file mode 100644
index 0000000000..a2afd1033c
--- /dev/null
+++ b/frappe/docs/user/tutorial/form-client-scripting.md
@@ -0,0 +1,37 @@
+## Scripting Forms
+
+Now we have created a basic system that works out of the box without us having to write any code. Let us now write some scripts to make the application richer and add validations so that the user does not enter wrong data.
+
+### Client Side Scripting
+
+In the **Library Transaction** DocType, we have only field for Member Name. We have not made two fields. Now this could well be two fields (and probably should), but for the sake of example, let us consider we have to implement this. To do this we would have to write a event handler for the event when the user selects the `library_member` field and then access the member resource from the server using REST API and set the values in the form.
+
+To start the script, in the `library_management/doctype/library_transaction` folder, create a new file `library_transaction.js`. This file will be automatically executed when the first Library Transaction is opened by the user. So in this file, we can bind events and write other functions.
+
+#### library_transaction.js
+
+ frappe.ui.form.on("Library Transaction", "library_member",
+ function(frm) {
+ frappe.call({
+ "method": "frappe.client.get",
+ args: {
+ doctype: "Library Member",
+ name: frm.doc.library_member
+ },
+ callback: function (data) {
+ frappe.model.set_value(frm.doctype,
+ frm.docname, "member_name",
+ data.message.first_name
+ + (data.message.last_name ?
+ (" " + data.message.last_name) : ""))
+ }
+ })
+ });
+
+1. **frappe.ui.form.on(*doctype*, *fieldname*, *handler*)** is used to bind a handler to the event when the property library_member is set.
+1. In the handler, we trigger an AJAX call to `frappe.client.get`. In response we get the requested object as JSON. [Learn more about the API](/help/rest_api).
+1. Using **frappe.model.set_value(*doctype*, *name*, *fieldname*, *value*)** we set the value in the form.
+
+**Note:** To check if your script works, remember to 'reload' the page before testing your script. Client script changes are not automatically picked up when you are in developer mode.
+
+{next}
diff --git a/frappe/docs/user/tutorial/index.md b/frappe/docs/user/tutorial/index.md
new file mode 100644
index 0000000000..13015b7b9e
--- /dev/null
+++ b/frappe/docs/user/tutorial/index.md
@@ -0,0 +1,33 @@
+# Frappe Tutorial
+
+In this guide we will show you how to create an application from scratch using **Frappe**. Using the example of a Library Management System, we will cover:
+
+1. Installation
+1. Making a New App
+1. Making Models
+1. Creating Users and Records
+1. Creating Controllers
+1. Creating Web Views
+1. Setting Hooks and Tasks
+
+## Who is This For?
+
+This guide is intended for software developers who are familiar with how the web applications are built and served. Frappe Framework is built on Python and uses MariaDB database and for creating web views, HTML/CSS/Javascript is used. So it would be great if you are familiar with all these techonlogies. At minimum if you have never used Python before, you should take a quick tutorial before your use this Guide.
+
+Frappe uses the git version control system on GitHub. It is also important that you are familiar with basic git and have an account on GitHub to manage your applications.
+
+## Example
+
+For this guide book, we will build a simple **Library Management** application. In this application we will have models:
+
+1. Article (Book or any other item that can be loaned)
+1. Library Member
+1. Library Transaction (Issue or Return of an article)
+1. Library Membership (A period in which a member is allowed to transact)
+1. Library Management Setting (Global settings like period of loan)
+
+The user interface (UI) for the librarian will be the **Frappe Desk**, a built-in browser based UI enviornment where forms are automatically generated from the models and roles and permissions are also applied.
+
+We will also create web views for library where users can browser articles from a website.
+
+{index}
diff --git a/frappe/docs/user/tutorial/index.txt b/frappe/docs/user/tutorial/index.txt
new file mode 100644
index 0000000000..1fed6aed93
--- /dev/null
+++ b/frappe/docs/user/tutorial/index.txt
@@ -0,0 +1,19 @@
+before
+app
+bench
+new-app
+setting-up-the-site
+start
+models
+roles
+doctypes
+naming-and-linking
+doctype-directory-structure
+users-and-records
+form-client-scripting
+controllers
+reports
+web-views
+single-doctypes
+task-runner
+conclusion
diff --git a/frappe/docs/user/tutorial/models.md b/frappe/docs/user/tutorial/models.md
new file mode 100644
index 0000000000..63acac9bde
--- /dev/null
+++ b/frappe/docs/user/tutorial/models.md
@@ -0,0 +1,19 @@
+# Making Models
+
+The next step is to create the models as we discussed in the introduction. In Frappe, models are called **DocType**. You can create new DocTypes from the Desk UI. **DocTypes** are made of fields called **DocField** and role based permissions are integrated into the models, these are called **DocPerms**.
+
+When a DocType is saved, a new table is created in the database. This table is named as `tab[doctype]`.
+
+When you create a **DocType** a new folder is created in the **Module** and a model JSON file and a controller template in Python are automatically created. When you update the DocType, the JSON model file is updated and whenever `bench migrate` is executed, it is synced with the database. This makes it easy to propagate schema changes and migrate.
+
+### Developer Mode
+
+To create models, you must set `developer_mode` as 1 in the `site_config.json` file.
+
+ {
+ "db_name": "library",
+ "db_password": "v3qHDeVKvWVi7s97",
+ "developer_mode": 1
+ }
+
+{next}
diff --git a/frappe/docs/user/tutorial/naming-and-linking.md b/frappe/docs/user/tutorial/naming-and-linking.md
new file mode 100644
index 0000000000..9cfacfe7f1
--- /dev/null
+++ b/frappe/docs/user/tutorial/naming-and-linking.md
@@ -0,0 +1,71 @@
+# DocType Naming and Linking
+
+Then let us create the other DocType and save it too:
+
+1. Library Member (First Name, Last Name, Email ID)
+
+
+
+
+#### Naming of DocTypes
+
+DocTypes can be named in different ways:
+
+1. Based on a field
+1. Based on a series
+1. By controller (code)
+1. Prompt
+
+This can be set by entering the **Autoname** field. For controller, leave blank.
+
+> **Search Fields**: A DocType may be named on a series but it still needs to be searched by name. In our case, the Article will be searched by the title or the author name. So this can be entered in search field.
+
+
+
+#### Link and Select Fields
+
+Foreign keys are specified in Frappe as **Link** type fields. The target DocType must be mentioned in the Options table.
+
+In our example, in the Library Transaction DocType, we have to link both the Library Member and the Article.
+
+**Note:** Remeber that Link fields are not automatically set as Foreign Keys in the MariaDB database, because that will implicitly index the column. This may not be optimum hence the Foreign Key validation is done by the Framework.
+
+
+
+For select fields, as we mentioned earlier, add the various options in the **Options** input box, each option on a new row.
+
+
+
+Similary complete making the other models.
+
+#### Linked Values
+
+A standard pattern is when you select an ID, say **Library Member** in **Library Membership**, then the Member's first and last names should be copied into relevant fields in the Library Membership Transaction.
+
+To do this, we can use Read Only fields and in options, we can set the the name of the link and the fieldname of the property we want to fetch. For this example in **Member First Name** we can set `library_member.first_name`
+
+
+
+### Complete the Models
+
+In the same way, you can complete all the models so that the final fields look like this:
+
+#### Article
+
+
+
+#### Library Member
+
+
+
+#### Library Membership
+
+
+
+#### Library Transaction
+
+
+
+> Make sure to give permissions to **Librarian** on each DocType
+
+{next}
diff --git a/frappe/docs/user/tutorial/new-app.md b/frappe/docs/user/tutorial/new-app.md
new file mode 100644
index 0000000000..63f4b63a08
--- /dev/null
+++ b/frappe/docs/user/tutorial/new-app.md
@@ -0,0 +1,54 @@
+# Make a New App
+
+After the bench is installed, there are two main folders, `apps` and `sites`. All the applications will be installed in apps.
+
+To make a new application, go to your bench folder and run, `bench new-app {app_name}` and fill in details about the application. This will create a boilerplate application for your.
+
+ $ bench new-app library_management
+ App Title (defaut: Lib Mgt): Liblary Management
+ App Description: App for managing Articles, Members, Memberships and Transactions for Libraries
+ App Publisher: Frappe
+ App Email: info@frappe.io
+ App Icon (default 'octicon octicon-file-directory'): octicon octicon-book
+ App Color (default 'grey'): #589494
+ App License (default 'MIT'): GNU General Public License
+
+### App Structure
+
+The application will be created in a folder called `library_management` and will have the following structure:
+
+ .
+ ├── MANIFEST.in
+ ├── README.md
+ ├── library_management
+ │ ├── __init__.py
+ │ ├── config
+ │ │ ├── __init__.py
+ │ │ └── desktop.py
+ │ ├── hooks.py
+ │ ├── library_management
+ │ │ └── __init__.py
+ │ ├── modules.txt
+ │ ├── patches.txt
+ │ └── templates
+ │ ├── __init__.py
+ │ ├── generators
+ │ │ └── __init__.py
+ │ ├── pages
+ │ │ └── __init__.py
+ │ └── statics
+ ├── license.txt
+ ├── requirements.txt
+ └── setup.py
+
+1. `config` folder contains application configuration info
+1. `desktop.py` is where desktop icons can be added to the Desk
+1. `hooks.py` is where integrations with the environment and other applications is mentioned.
+1. `library_management` (inner) is a **module** that is bootstrapped. In Frappe, a **module** is where model and controller files reside.
+1. `modules.txt` contains list of **modules** in the app. When you create a new module, it is required that you update it in this file.
+1. `patches.txt` is where migration patches are written. They are python module references using the dot notation.
+1. `templates` is the folder where web view templates are maintained. Templates for **Login** and other standard pages are bootstrapped in frappe.
+1. `generators` are where templates for models are maintained, where each model instance has a separte web route, for example a **Blog Post** where each post has its unique web url. In Frappe, the templating engine used is Jinja2
+1. `pages` is where single route templates are maintained. For example for a "/blog" type of page.
+
+{next}
diff --git a/frappe/docs/user/tutorial/reports.md b/frappe/docs/user/tutorial/reports.md
new file mode 100644
index 0000000000..383058e9e3
--- /dev/null
+++ b/frappe/docs/user/tutorial/reports.md
@@ -0,0 +1,7 @@
+# Reports
+
+You can also click on the Reports Icon on the toolbar (right) to see tabulated records
+
+
+
+{next}
diff --git a/frappe/docs/user/tutorial/roles.md b/frappe/docs/user/tutorial/roles.md
new file mode 100644
index 0000000000..060f220bbe
--- /dev/null
+++ b/frappe/docs/user/tutorial/roles.md
@@ -0,0 +1,14 @@
+# Creating Roles
+
+Before creating Models, we must create Roles so that we can set permissions on the Model. There are two Roles we will create:
+
+1. Librarian
+1. Library Member
+
+To create a new Role, go to:
+
+> Core > Documents > Role > New
+
+
+
+{next}
diff --git a/frappe/docs/user/tutorial/setting-up-the-site.md b/frappe/docs/user/tutorial/setting-up-the-site.md
new file mode 100644
index 0000000000..acc13cc8dc
--- /dev/null
+++ b/frappe/docs/user/tutorial/setting-up-the-site.md
@@ -0,0 +1,53 @@
+# Setting up the Site
+
+Let us create a new site and call it `library`.
+
+You can install a new site, by the command `bench new-site library`
+
+This will create a new database and site folder and install `frappe` (which is also an application!) in the new site. The `frappe` application has two built-in modules **Core** and **Website**. The Core module contains the basic models for the application. Frappe is a batteries included framework and comes with a lot of built-in models. These models are called **DocTypes**. More on that later.
+
+ $ bench new-site library
+ MySQL root password:
+ Installing frappe...
+ Updating frappe : [========================================]
+ Updating country info : [========================================]
+ Set Administrator password:
+ Re-enter Administrator password:
+ Installing fixtures...
+ *** Scheduler is disabled ***
+
+### Site Structure
+
+A new folder called `library` will be created in the `sites` folder. Here is the standard folder structure for a site.
+
+ .
+ ├── locks
+ ├── private
+ │ └── backups
+ ├── public
+ │ └── files
+ └── site_config.json
+
+1. `public/files` is where user uploaded files are stored.
+1. `private/backups` is where backups are dumped
+1. `site_config.json` is where site level configurations are maintained.
+
+### Setting Default Site
+
+In case you have multiple sites on you bench use `bench use [site_name]` to set the default site.
+
+Example:
+
+ $ bench use library
+
+### Install App
+
+Now let us install our app `library_management` in our site `library`
+
+1. Install library_management in library with: `bench --site [site_name] install_app [app_name]`
+
+Example:
+
+ $ bench install-app library_management
+
+{next}
diff --git a/frappe/docs/user/tutorial/single-doctypes.md b/frappe/docs/user/tutorial/single-doctypes.md
new file mode 100644
index 0000000000..53c37cd1d8
--- /dev/null
+++ b/frappe/docs/user/tutorial/single-doctypes.md
@@ -0,0 +1,9 @@
+# Single DocTypes
+
+A application will usually have a Settings page. In our application, we can define a page where we can set the loan period. We also need to save this property. In Frappe, this can be done using a **Single** type DocType. A Single DocType is like the Singleton pattern in Java. It is an object with only one instance. Let us call this as **Library Managment Settings**.
+
+To create an new Single DocType, mark the **Is Single** property as checked.
+
+
+
+{next}
diff --git a/frappe/docs/user/tutorial/start.md b/frappe/docs/user/tutorial/start.md
new file mode 100644
index 0000000000..1294c35f8c
--- /dev/null
+++ b/frappe/docs/user/tutorial/start.md
@@ -0,0 +1,30 @@
+# Starting the Bench
+
+Now we can login and check if everything works.
+
+To start the development server, run `bench start`
+
+ $ bench start
+ 13:58:51 web.1 | started with pid 22135
+ 13:58:51 worker.1 | started with pid 22136
+ 13:58:51 workerbeat.1 | started with pid 22137
+ 13:58:52 web.1 | * Running on http://0.0.0.0:8000/
+ 13:58:52 web.1 | * Restarting with reloader
+ 13:58:52 workerbeat.1 | [2014-09-17 13:58:52,343: INFO/MainProcess] beat: Starting...
+
+You can now open your browser and go to `http://localhost:8000`. You should see this login page if all goes well:
+
+
+
+Now login as the default user "Administrator"
+
+Login ID: **Administrator**
+Password: **admin**
+
+When you login, you should see the "Desk" home page
+
+
+
+As you can see, the Frappe basic system comes with a bunch of pre-loaded applications and screens like To Do, Calendar etc. These apps can integrated in your app workflow as we progress.
+
+{next}
diff --git a/frappe/docs/user/tutorial/task-runner.md b/frappe/docs/user/tutorial/task-runner.md
new file mode 100644
index 0000000000..cb704c12bd
--- /dev/null
+++ b/frappe/docs/user/tutorial/task-runner.md
@@ -0,0 +1,77 @@
+# Scheduled Tasks
+
+Finally, an application also has to send email notifications and do other kind of scheduled tasks. In Frappe, if you have setup the bench, the task / scheduler is setup via Celery using Redis Queue.
+
+To add a new task handler, go to `hooks.py` and add a new handler. Default handlers are `all`, `daily`, `weekly`, `monthly`. The `all` handler is called every 3 minutes by default.
+
+ # Scheduled Tasks
+ # ---------------
+
+ scheduler_events = {
+ "daily": [
+ "library_management.tasks.daily"
+ ],
+ }
+
+Here we can point to a Python function and that function will be executed every day. Let us look what this function looks like:
+
+ # Copyright (c) 2013, Frappe
+ # For license information, please see license.txt
+
+ from __future__ import unicode_literals
+ import frappe
+ from frappe.utils import datediff, nowdate, format_date, add_days
+
+ def daily():
+ loan_period = frappe.db.get_value("Library Management Settings",
+ None, "loan_period")
+
+ overdue = get_overdue(loan_period)
+
+ for member, items in overdue.iteritems():
+ content = """Please return them as soon as possible
+
+Now logout and login using the new user id and password.
+
+### 4.2 Creating Records
+
+You will now see an icon for the Library Management module. Click on that icon and you will see the Module page:
+
+
+
+Here you can see the DocTypes that we have created for the application. List us start creating a few records.
+
+First let us create a new Article:
+
+
+
+Here you will see that the the DocType you had created has been rendered as a form. The validations and other rules will also apply as designed. Let us fill out one Article.
+
+
+
+You can also add an image.
+
+
+
+Now let us create a new member:
+
+
+
+After this, let us create a new membership record for the member.
+
+Here if you remember we had set the values of Member First Name and Member Last Name to be directly fetched from the Member records and as soon as you will select the member id, the names will be updated.
+
+
+
+As you can see that the date is formatted as year-month-day which is a system format. To set / change date, time and number formats, go to
+
+> Setup > System Settings
+
+
+
+{next}
diff --git a/frappe/docs/user/tutorial/web-views.md b/frappe/docs/user/tutorial/web-views.md
new file mode 100644
index 0000000000..a9794bae88
--- /dev/null
+++ b/frappe/docs/user/tutorial/web-views.md
@@ -0,0 +1,64 @@
+# Web Views
+
+Frappe has two main user environments, the Desk and Web. Desk is a controlled UI environment with a rich AJAX application and the web is more traditional HTML templates served for public consumption. Web views can also be generated to create more controlled views for users who may login but still do not have access to the Desk.
+
+In Frappe, Web Views are managed by templates and they are usually in the `templates` folder. There are 2 main types of templates.
+
+1. Pages: These are Jinja templates where a single view exists for a single web route e.g. `/blog`.
+2. Generators: These are templates where each instance of a DocType has a separate web route `/blog/a-blog`, `blog/b-blog` etc.
+3. Lists and Views: These are standard lists and views with the route `[doctype]/[name]` and are rendered based on permission.
+
+### Standard Web Views
+
+> This features is still under development.
+
+Let us look at the standard Web Views:
+
+If you are logged in as the test user, go to `/article` and you should see the list of articles:
+
+
+
+Click on one article and you will see the default web view
+
+
+
+Now if you want to make a better list view for the article, drop a file called `list_item.html` in the `library_management/doctype/article` folder. Here is an example file:
+
+ {{ doc.author }}
+{{ (doc.description[:200] + "...") + if doc.description|length > 200 else doc.description }}
+Publisher: {{ doc.publisher }}
+{{ app.description }}
+{{ app.sub_heading }}
{{ app.publisher }} ({{ app.email }})