blob: 95a836fe6527351ae29ee28060ba0b0be2ff7d61 [file] [log] [blame]
Anand Doshid57e7932015-02-24 12:24:53 +05301from __future__ import unicode_literals
Rushabh Mehta156ce602015-09-11 18:49:59 +05302from frappe import _
3
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +05304app_name = "erpnext"
5app_title = "ERPNext"
Rushabh Mehtaba02ce62015-07-22 15:07:25 +05306app_publisher = "Frappe Technologies Pvt. Ltd."
Rushabh Mehtaedc8ab02015-11-18 16:48:19 +05307app_description = """ERP made simple"""
Rushabh Mehta2167ff52016-12-07 11:08:48 +05308app_icon = "fa fa-th"
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +05309app_color = "#e74c3c"
Nabin Hait7ba4d022015-11-05 16:55:10 +053010app_email = "info@erpnext.com"
11app_license = "GNU General Public License (v3)"
Rushabh Mehta7d23e422015-11-02 10:45:18 +053012source_link = "https://github.com/frappe/erpnext"
Faris Ansari4a1c7dd2019-06-19 19:15:37 +053013app_logo_url = '/assets/erpnext/images/erp-icon.svg'
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +053014
scmmishra734d3e02018-11-03 18:03:35 +053015
Sahil Khanad4eb642020-06-30 17:54:41 +053016develop_version = '13.x.x-develop'
Rushabh Mehtadb206f22017-03-10 09:38:58 +053017
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +053018app_include_js = "assets/js/erpnext.min.js"
19app_include_css = "assets/css/erpnext.css"
20web_include_js = "assets/js/erpnext-web.min.js"
Solufyin3be899c2018-08-07 18:28:39 +053021web_include_css = "assets/css/erpnext-web.css"
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +053022
mbauskarf54b1042017-03-13 16:32:46 +053023doctype_js = {
24 "Communication": "public/js/communication.js",
Faris Ansari5f8b3582019-03-19 11:48:32 +053025 "Event": "public/js/event.js",
Faris Ansari1e55c2e2019-04-30 10:18:09 +053026 "Website Theme": "public/js/website_theme.js",
27 "Newsletter": "public/js/newsletter.js"
mbauskarf54b1042017-03-13 16:32:46 +053028}
29
Neil Trini Lasrado771fbb82018-08-24 15:15:56 +053030welcome_email = "erpnext.setup.utils.welcome_email"
31
Rushabh Mehta37b4d752015-11-09 16:53:11 +053032# setup wizard
33setup_wizard_requires = "assets/erpnext/js/setup_wizard.js"
Prateeksha Singh8b0b56d2017-12-21 11:55:58 +053034setup_wizard_stages = "erpnext.setup.setup_wizard.setup_wizard.get_setup_stages"
Prateeksha Singh95d8fd32017-09-04 11:14:04 +053035setup_wizard_test = "erpnext.setup.setup_wizard.test_setup_wizard.run_setup_wizard_test"
Rushabh Mehta37b4d752015-11-09 16:53:11 +053036
Rushabh Mehtad55bdcf2015-12-31 11:12:48 +053037before_install = "erpnext.setup.install.check_setup_wizard_not_completed"
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +053038after_install = "erpnext.setup.install.after_install"
39
40boot_session = "erpnext.startup.boot.boot_session"
41notification_config = "erpnext.startup.notifications.get_notification_config"
Rushabh Mehta05ce7ec2017-02-22 16:15:43 +053042get_help_messages = "erpnext.utilities.activation.get_help_messages"
prssanna3f1444e2019-09-24 13:04:53 +053043leaderboards = "erpnext.startup.leaderboard.get_leaderboards"
Prssanna Desai82ddef52020-06-18 18:18:41 +053044filters_config = "erpnext.startup.filters.get_filters_config"
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +053045
Faris Ansari38ac7f72019-10-09 11:41:33 +053046on_session_creation = [
47 "erpnext.portal.utils.create_customer_or_supplier",
48 "erpnext.shopping_cart.utils.set_cart_count"
49]
Rushabh Mehta3daa49a2014-10-21 16:16:30 +053050on_logout = "erpnext.shopping_cart.utils.clear_cart_count"
Anand Doshif9fc04c2015-02-23 22:14:12 +053051
Mangesh-Khairnar07aae762019-06-26 11:03:57 +053052treeviews = ['Account', 'Cost Center', 'Warehouse', 'Item Group', 'Customer Group', 'Sales Person', 'Territory', 'Assessment Group', 'Department']
Rushabh Mehta764aa922016-05-02 13:28:46 +053053
Anand Doshif9fc04c2015-02-23 22:14:12 +053054# website
Shivam Mishra51b6fe22019-05-14 10:22:15 +053055update_website_context = ["erpnext.shopping_cart.utils.update_website_context", "erpnext.education.doctype.education_settings.education_settings.update_website_context"]
Anand Doshif9fc04c2015-02-23 22:14:12 +053056my_account_context = "erpnext.shopping_cart.utils.update_my_account_context"
Rushabh Mehta621d6ea2015-07-08 12:39:27 +053057
Zarrar13ddc7e2018-03-20 12:38:43 +053058calendars = ["Task", "Work Order", "Leave Application", "Sales Order", "Holiday List", "Course Schedule"]
Rushabh Mehta621d6ea2015-07-08 12:39:27 +053059
Rushabh Mehtabc4e2cd2017-10-17 12:30:34 +053060domains = {
Ameya Shenoy5c623682017-12-06 18:36:27 +053061 'Agriculture': 'erpnext.domains.agriculture',
Rushabh Mehtabc4e2cd2017-10-17 12:30:34 +053062 'Distribution': 'erpnext.domains.distribution',
63 'Education': 'erpnext.domains.education',
64 'Healthcare': 'erpnext.domains.healthcare',
65 'Hospitality': 'erpnext.domains.hospitality',
66 'Manufacturing': 'erpnext.domains.manufacturing',
Zarrarde8f6122017-12-13 18:36:08 +053067 'Non Profit': 'erpnext.domains.non_profit',
Rushabh Mehtabc4e2cd2017-10-17 12:30:34 +053068 'Retail': 'erpnext.domains.retail',
69 'Services': 'erpnext.domains.services',
70}
71
Rushabh Mehtadbb51542017-08-10 21:06:09 +053072website_generators = ["Item Group", "Item", "BOM", "Sales Partner",
73 "Job Opening", "Student Admission"]
Rushabh Mehta621d6ea2015-07-08 12:39:27 +053074
Rushabh Mehta2e7c36e2015-04-16 12:41:42 +053075website_context = {
Rushabh Mehta5674c4f2015-04-16 15:09:42 +053076 "favicon": "/assets/erpnext/images/favicon.png",
Rushabh Mehtad40e6612017-01-10 14:46:45 +053077 "splash_image": "/assets/erpnext/images/erp-icon.svg"
Rushabh Mehta2e7c36e2015-04-16 12:41:42 +053078}
79
Anand Doshif9fc04c2015-02-23 22:14:12 +053080website_route_rules = [
81 {"from_route": "/orders", "to_route": "Sales Order"},
Rushabh Mehta156ce602015-09-11 18:49:59 +053082 {"from_route": "/orders/<path:name>", "to_route": "order",
83 "defaults": {
84 "doctype": "Sales Order",
Britlog4c7709e2017-07-28 15:24:22 +020085 "parents": [{"label": _("Orders"), "route": "orders"}]
Rushabh Mehta156ce602015-09-11 18:49:59 +053086 }
87 },
Anand Doshif9fc04c2015-02-23 22:14:12 +053088 {"from_route": "/invoices", "to_route": "Sales Invoice"},
Rushabh Mehta156ce602015-09-11 18:49:59 +053089 {"from_route": "/invoices/<path:name>", "to_route": "order",
90 "defaults": {
91 "doctype": "Sales Invoice",
Britlog4c7709e2017-07-28 15:24:22 +020092 "parents": [{"label": _("Invoices"), "route": "invoices"}]
Rushabh Mehta156ce602015-09-11 18:49:59 +053093 }
94 },
Makarand Bauskar9306aff2017-07-21 15:19:47 +053095 {"from_route": "/supplier-quotations", "to_route": "Supplier Quotation"},
96 {"from_route": "/supplier-quotations/<path:name>", "to_route": "order",
Rohit Waghchaure21499e82016-09-21 16:49:58 +053097 "defaults": {
98 "doctype": "Supplier Quotation",
Brown-Harry Bomad3fa1912017-09-27 08:23:38 +010099 "parents": [{"label": _("Supplier Quotation"), "route": "supplier-quotations"}]
Rohit Waghchaure21499e82016-09-21 16:49:58 +0530100 }
101 },
Faris Ansari38ac7f72019-10-09 11:41:33 +0530102 {"from_route": "/purchase-orders", "to_route": "Purchase Order"},
103 {"from_route": "/purchase-orders/<path:name>", "to_route": "order",
104 "defaults": {
105 "doctype": "Purchase Order",
106 "parents": [{"label": _("Purchase Order"), "route": "purchase-orders"}]
107 }
108 },
109 {"from_route": "/purchase-invoices", "to_route": "Purchase Invoice"},
110 {"from_route": "/purchase-invoices/<path:name>", "to_route": "order",
111 "defaults": {
112 "doctype": "Purchase Invoice",
113 "parents": [{"label": _("Purchase Invoice"), "route": "purchase-invoices"}]
114 }
115 },
Makarand Bauskar9306aff2017-07-21 15:19:47 +0530116 {"from_route": "/quotations", "to_route": "Quotation"},
117 {"from_route": "/quotations/<path:name>", "to_route": "order",
118 "defaults": {
119 "doctype": "Quotation",
Rushabh Mehtadbb51542017-08-10 21:06:09 +0530120 "parents": [{"label": _("Quotations"), "route": "quotations"}]
Makarand Bauskar9306aff2017-07-21 15:19:47 +0530121 }
122 },
Anand Doshif9fc04c2015-02-23 22:14:12 +0530123 {"from_route": "/shipments", "to_route": "Delivery Note"},
Rushabh Mehta156ce602015-09-11 18:49:59 +0530124 {"from_route": "/shipments/<path:name>", "to_route": "order",
125 "defaults": {
Anand Doshi4b127402015-11-26 18:22:03 +0530126 "doctype": "Delivery Note",
Britlog4c7709e2017-07-28 15:24:22 +0200127 "parents": [{"label": _("Shipments"), "route": "shipments"}]
Rushabh Mehta156ce602015-09-11 18:49:59 +0530128 }
Kanchan Chauhan2e8cc892016-02-19 17:27:23 +0530129 },
rohitwaghchaurea1064a62016-03-03 14:00:35 +0530130 {"from_route": "/rfq", "to_route": "Request for Quotation"},
131 {"from_route": "/rfq/<path:name>", "to_route": "rfq",
132 "defaults": {
133 "doctype": "Request for Quotation",
Britlog4c7709e2017-07-28 15:24:22 +0200134 "parents": [{"label": _("Request for Quotation"), "route": "rfq"}]
rohitwaghchaurea1064a62016-03-03 14:00:35 +0530135 }
136 },
Kanchan Chauhan1605ff02016-07-04 14:28:09 +0530137 {"from_route": "/addresses", "to_route": "Address"},
138 {"from_route": "/addresses/<path:name>", "to_route": "addresses",
139 "defaults": {
140 "doctype": "Address",
Britlog4c7709e2017-07-28 15:24:22 +0200141 "parents": [{"label": _("Addresses"), "route": "addresses"}]
Kanchan Chauhan1605ff02016-07-04 14:28:09 +0530142 }
143 },
Kanchan Chauhan2e8cc892016-02-19 17:27:23 +0530144 {"from_route": "/jobs", "to_route": "Job Opening"},
Neil Trini Lasrado83d81202016-09-15 14:48:13 +0530145 {"from_route": "/admissions", "to_route": "Student Admission"},
Vishal Dhayagudeedb27492017-07-25 10:53:12 +0530146 {"from_route": "/boms", "to_route": "BOM"},
147 {"from_route": "/timesheets", "to_route": "Timesheet"},
Doridel Cahanap2b14d6a2018-11-13 14:37:16 +0800148 {"from_route": "/material-requests", "to_route": "Material Request"},
149 {"from_route": "/material-requests/<path:name>", "to_route": "material_request_info",
150 "defaults": {
151 "doctype": "Material Request",
152 "parents": [{"label": _("Material Request"), "route": "material-requests"}]
153 }
154 },
Anand Doshif9fc04c2015-02-23 22:14:12 +0530155]
156
Rushabh Mehtab9cdb052017-03-08 12:33:43 +0530157standard_portal_menu_items = [
Jamsheerf9269112018-07-16 18:08:53 +0530158 {"title": _("Personal Details"), "route": "/personal-details", "reference_doctype": "Patient", "role": "Patient"},
Rushabh Mehta0c76f212016-04-01 11:53:50 +0530159 {"title": _("Projects"), "route": "/project", "reference_doctype": "Project"},
Rushabh Mehtafc800b32016-09-23 21:51:51 +0530160 {"title": _("Request for Quotations"), "route": "/rfq", "reference_doctype": "Request for Quotation", "role": "Supplier"},
Makarand Bauskar9306aff2017-07-21 15:19:47 +0530161 {"title": _("Supplier Quotation"), "route": "/supplier-quotations", "reference_doctype": "Supplier Quotation", "role": "Supplier"},
Faris Ansari38ac7f72019-10-09 11:41:33 +0530162 {"title": _("Purchase Orders"), "route": "/purchase-orders", "reference_doctype": "Purchase Order", "role": "Supplier"},
163 {"title": _("Purchase Invoices"), "route": "/purchase-invoices", "reference_doctype": "Purchase Invoice", "role": "Supplier"},
Makarand Bauskar9306aff2017-07-21 15:19:47 +0530164 {"title": _("Quotations"), "route": "/quotations", "reference_doctype": "Quotation", "role":"Customer"},
Rushabh Mehtafc800b32016-09-23 21:51:51 +0530165 {"title": _("Orders"), "route": "/orders", "reference_doctype": "Sales Order", "role":"Customer"},
166 {"title": _("Invoices"), "route": "/invoices", "reference_doctype": "Sales Invoice", "role":"Customer"},
167 {"title": _("Shipments"), "route": "/shipments", "reference_doctype": "Delivery Note", "role":"Customer"},
168 {"title": _("Issues"), "route": "/issues", "reference_doctype": "Issue", "role":"Customer"},
Neil Trini Lasrado3f0a5812016-07-19 14:17:33 +0530169 {"title": _("Addresses"), "route": "/addresses", "reference_doctype": "Address"},
Manas Solankie716da02017-09-18 16:00:34 +0530170 {"title": _("Timesheets"), "route": "/timesheets", "reference_doctype": "Timesheet", "role":"Customer"},
Rushabh Mehtaf0569742017-09-13 12:52:30 +0530171 {"title": _("Lab Test"), "route": "/lab-test", "reference_doctype": "Lab Test", "role":"Patient"},
Jamsheerf9269112018-07-16 18:08:53 +0530172 {"title": _("Prescription"), "route": "/prescription", "reference_doctype": "Patient Encounter", "role":"Patient"},
Manas Solankie716da02017-09-18 16:00:34 +0530173 {"title": _("Patient Appointment"), "route": "/patient-appointments", "reference_doctype": "Patient Appointment", "role":"Patient"},
174 {"title": _("Fees"), "route": "/fees", "reference_doctype": "Fees", "role":"Student"},
Manas Solanki05180012017-10-05 14:31:31 +0530175 {"title": _("Newsletter"), "route": "/newsletters", "reference_doctype": "Newsletter"},
Faris Ansari38ac7f72019-10-09 11:41:33 +0530176 {"title": _("Admission"), "route": "/admissions", "reference_doctype": "Student Admission", "role": "Student"},
177 {"title": _("Certification"), "route": "/certification", "reference_doctype": "Certification Application", "role": "Non Profit Portal User"},
Doridel Cahanap2b14d6a2018-11-13 14:37:16 +0800178 {"title": _("Material Request"), "route": "/material-requests", "reference_doctype": "Material Request", "role": "Customer"},
0Pranav5f5c7252019-12-18 16:21:50 +0530179 {"title": _("Appointment Booking"), "route": "/book_appointment"},
Rushabh Mehtafc800b32016-09-23 21:51:51 +0530180]
181
182default_roles = [
Rushabh Mehta95439db2017-01-14 00:25:22 +0530183 {'role': 'Customer', 'doctype':'Contact', 'email_field': 'email_id'},
184 {'role': 'Supplier', 'doctype':'Contact', 'email_field': 'email_id'},
Vishal Dhayagudeedb27492017-07-25 10:53:12 +0530185 {'role': 'Student', 'doctype':'Student', 'email_field': 'student_email_id'},
Rushabh Mehtac78b3112016-03-30 12:29:48 +0530186]
187
Suraj Shettyf1ffdb32019-06-07 12:48:13 +0530188sounds = [
189 {"name": "incoming-call", "src": "/assets/erpnext/sounds/incoming-call.mp3", "volume": 0.2},
190 {"name": "call-disconnect", "src": "/assets/erpnext/sounds/call-disconnect.mp3", "volume": 0.2},
191]
192
Anand Doshif9fc04c2015-02-23 22:14:12 +0530193has_website_permission = {
194 "Sales Order": "erpnext.controllers.website_list_for_contact.has_website_permission",
Makarand Bauskar9306aff2017-07-21 15:19:47 +0530195 "Quotation": "erpnext.controllers.website_list_for_contact.has_website_permission",
Anand Doshif9fc04c2015-02-23 22:14:12 +0530196 "Sales Invoice": "erpnext.controllers.website_list_for_contact.has_website_permission",
Rohit Waghchaure21499e82016-09-21 16:49:58 +0530197 "Supplier Quotation": "erpnext.controllers.website_list_for_contact.has_website_permission",
Faris Ansari38ac7f72019-10-09 11:41:33 +0530198 "Purchase Order": "erpnext.controllers.website_list_for_contact.has_website_permission",
199 "Purchase Invoice": "erpnext.controllers.website_list_for_contact.has_website_permission",
Doridel Cahanap2b14d6a2018-11-13 14:37:16 +0800200 "Material Request": "erpnext.controllers.website_list_for_contact.has_website_permission",
Rushabh Mehtaa33d4682015-06-01 17:15:42 +0530201 "Delivery Note": "erpnext.controllers.website_list_for_contact.has_website_permission",
Vishal Dhayagudeedb27492017-07-25 10:53:12 +0530202 "Issue": "erpnext.support.doctype.issue.issue.has_website_permission",
Rushabh Mehtaf0569742017-09-13 12:52:30 +0530203 "Timesheet": "erpnext.controllers.website_list_for_contact.has_website_permission",
204 "Lab Test": "erpnext.healthcare.web_form.lab_test.lab_test.has_website_permission",
Jamsheerf9269112018-07-16 18:08:53 +0530205 "Patient Encounter": "erpnext.healthcare.web_form.prescription.prescription.has_website_permission",
206 "Patient Appointment": "erpnext.healthcare.web_form.patient_appointments.patient_appointments.has_website_permission",
207 "Patient": "erpnext.healthcare.web_form.personal_details.personal_details.has_website_permission"
Anand Doshif9fc04c2015-02-23 22:14:12 +0530208}
Rushabh Mehta3daa49a2014-10-21 16:16:30 +0530209
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +0530210dump_report_map = "erpnext.startup.report_data_map.data_map"
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +0530211
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +0530212before_tests = "erpnext.setup.utils.before_tests"
213
Rushabh Mehta308e6ea2015-03-24 17:34:58 +0530214standard_queries = {
Jamsheerc0097ad2018-11-23 11:37:58 +0530215 "Customer": "erpnext.selling.doctype.customer.customer.get_customer_list",
216 "Healthcare Practitioner": "erpnext.healthcare.doctype.healthcare_practitioner.healthcare_practitioner.get_practitioner_list"
Rushabh Mehta308e6ea2015-03-24 17:34:58 +0530217}
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +0530218
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +0530219doc_events = {
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +0530220 "Stock Entry": {
Nabin Hait4acd4312014-11-04 15:32:31 +0530221 "on_submit": "erpnext.stock.doctype.material_request.material_request.update_completed_and_requested_qty",
222 "on_cancel": "erpnext.stock.doctype.material_request.material_request.update_completed_and_requested_qty"
Anand Doshi648062d2014-05-05 16:46:14 +0530223 },
224 "User": {
KanchanChauhan1dc26b12017-06-13 15:26:35 +0530225 "after_insert": "frappe.contacts.doctype.contact.contact.update_contact",
Anand Doshi49856912014-05-28 18:49:13 +0530226 "validate": "erpnext.hr.doctype.employee.employee.validate_employee_role",
Rushabh Mehta0d6db6c2017-03-31 23:01:45 +0530227 "on_update": ["erpnext.hr.doctype.employee.employee.update_user_permissions",
228 "erpnext.portal.utils.set_default_role"]
Rushabh Mehta3daa49a2014-10-21 16:16:30 +0530229 },
Rushabh Mehtaf16f9c52016-04-08 17:20:50 +0530230 ("Sales Taxes and Charges Template", 'Price List'): {
Rushabh Mehta3daa49a2014-10-21 16:16:30 +0530231 "on_update": "erpnext.shopping_cart.doctype.shopping_cart_settings.shopping_cart_settings.validate_cart_settings"
232 },
Anand Doshie3bd78e2016-04-22 18:53:21 +0530233 "Website Settings": {
234 "validate": "erpnext.portal.doctype.products_settings.products_settings.home_page_is_products"
Saurabhe4e89542016-07-21 20:26:46 +0530235 },
Charles-Henri Decultotb8c088e2018-02-21 06:37:33 +0100236 "Sales Invoice": {
vishdhad3ec1c12020-03-24 11:31:41 +0530237 "on_submit": [
238 "erpnext.regional.create_transaction_log",
239 "erpnext.regional.italy.utils.sales_invoice_on_submit",
240 "erpnext.erpnext_integrations.taxjar_integration.create_transaction"
241 ],
242 "on_cancel": [
243 "erpnext.regional.italy.utils.sales_invoice_on_cancel",
244 "erpnext.erpnext_integrations.taxjar_integration.delete_transaction"
245 ],
Nabin Hait0357fbc2018-03-09 13:19:52 +0530246 "on_trash": "erpnext.regional.check_deletion_permission"
Charles-Henri Decultotb8c088e2018-02-21 06:37:33 +0100247 },
Deepesh Garg24f9a802020-06-03 10:59:37 +0530248 "Purchase Invoice": {
Deepesh Garg3c004ad2020-07-02 21:18:29 +0530249 "validate": "erpnext.regional.india.utils.update_grand_total_for_rcm"
Deepesh Garg24f9a802020-06-03 10:59:37 +0530250 },
Saurabhe4e89542016-07-21 20:26:46 +0530251 "Payment Entry": {
KanchanChauhan2826fd32020-07-23 15:45:03 +0530252 "on_submit": ["erpnext.regional.create_transaction_log", "erpnext.accounts.doctype.payment_request.payment_request.update_payment_req_status", "erpnext.accounts.doctype.dunning.dunning.resolve_dunning"],
Nabin Hait0357fbc2018-03-09 13:19:52 +0530253 "on_trash": "erpnext.regional.check_deletion_permission"
Rushabh Mehtab3c8f442017-06-21 17:22:38 +0530254 },
255 'Address': {
Deepesh Garg6e2c13f2019-12-10 15:55:05 +0530256 'validate': ['erpnext.regional.india.utils.validate_gstin_for_india', 'erpnext.regional.italy.utils.set_state_code', 'erpnext.regional.india.utils.update_gst_category']
Nabin Hait619c42b2018-01-10 17:48:03 +0530257 },
Deepesh Garg6e2c13f2019-12-10 15:55:05 +0530258 ('Sales Invoice', 'Sales Order', 'Delivery Note', 'Purchase Invoice', 'Purchase Order', 'Purchase Receipt'): {
259 'validate': ['erpnext.regional.india.utils.set_place_of_supply']
Shridhar Patil4987c4e2018-07-03 10:10:04 +0530260 },
Suraj Shettyd4edd282019-08-09 19:23:04 +0530261 "Contact": {
262 "on_trash": "erpnext.support.doctype.issue.issue.update_issue",
Rohan Bansal76825ab2020-04-28 16:08:52 +0530263 "after_insert": "erpnext.communication.doctype.call_log.call_log.set_caller_information",
264 "validate": "erpnext.crm.utils.update_lead_phone_numbers"
Suraj Shettyd4edd282019-08-09 19:23:04 +0530265 },
266 "Lead": {
267 "after_insert": "erpnext.communication.doctype.call_log.call_log.set_caller_information"
Rucha Mahabal9e35bff2019-07-12 13:56:36 +0530268 },
269 "Email Unsubscribe": {
270 "after_insert": "erpnext.crm.doctype.email_campaign.email_campaign.unsubscribe_recipient"
vishdhad3ec1c12020-03-24 11:31:41 +0530271 },
272 ('Quotation', 'Sales Order', 'Sales Invoice'): {
273 'validate': ["erpnext.erpnext_integrations.taxjar_integration.set_sales_tax"]
Anand Doshie3bd78e2016-04-22 18:53:21 +0530274 }
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +0530275}
276
vishaldcef7982020-01-13 12:59:52 +0530277# On cancel event Payment Entry will be exempted and all linked submittable doctype will get cancelled.
278# to maintain data integrity we exempted payment entry. it will un-link when sales invoice get cancelled.
279# if payment entry not in auto cancel exempted doctypes it will cancel payment entry.
280auto_cancel_exempted_doctypes= [
281 "Payment Entry"
282]
vishal70148a62019-12-02 17:37:46 +0530283
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +0530284scheduler_events = {
Rohit Waghchaure425dff92019-01-17 12:49:45 +0530285 "all": [
Rucha Mahabal5100e112020-02-24 22:08:45 +0530286 "erpnext.projects.doctype.project.project.project_status_update_reminder",
rohitwaghchaure77403ab2020-04-25 17:37:24 +0530287 "erpnext.healthcare.doctype.patient_appointment.patient_appointment.send_appointment_reminder",
Anupam K22318b22020-04-18 00:45:18 +0530288 "erpnext.crm.doctype.social_media_post.social_media_post.process_scheduled_social_media_posts"
Rohit Waghchaure425dff92019-01-17 12:49:45 +0530289 ],
Nabin Hait75807232015-07-02 14:41:27 +0530290 "hourly": [
tundebabzy0ec44522018-03-01 11:33:03 +0100291 'erpnext.hr.doctype.daily_work_summary_group.daily_work_summary_group.trigger_emails',
Pawan Mehta6010a102018-09-05 17:16:57 +0530292 "erpnext.accounts.doctype.subscription.subscription.process_all",
Aditya Hase7bc692d2019-01-07 19:01:47 +0530293 "erpnext.erpnext_integrations.doctype.amazon_mws_settings.amazon_mws_settings.schedule_get_order_details",
294 "erpnext.accounts.doctype.gl_entry.gl_entry.rename_gle_sle_docs",
Nabin Hait34c551d2019-07-03 10:34:31 +0530295 "erpnext.erpnext_integrations.doctype.plaid_settings.plaid_settings.automatic_synchronization",
Rohit Waghchaure425dff92019-01-17 12:49:45 +0530296 "erpnext.projects.doctype.project.project.hourly_reminder",
Himanshu Warekar6e6148b2019-05-10 23:49:42 +0530297 "erpnext.projects.doctype.project.project.collect_project_status",
Himanshu Warekar2373c092019-06-25 16:27:06 +0530298 "erpnext.hr.doctype.shift_type.shift_type.process_auto_attendance_for_all_shifts",
Himanshu Warekar6931ea62019-06-25 16:27:58 +0530299 "erpnext.support.doctype.issue.issue.set_service_level_agreement_variance",
Nabin Hait75807232015-07-02 14:41:27 +0530300 ],
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +0530301 "daily": [
Rushabh Mehtaf8509872014-10-08 12:03:19 +0530302 "erpnext.stock.reorder_item.reorder_item",
Nabin Hait606af962014-12-15 11:57:03 +0530303 "erpnext.support.doctype.issue.issue.auto_close_tickets",
mbauskare1e25a02017-02-16 19:36:59 +0530304 "erpnext.crm.doctype.opportunity.opportunity.auto_close_opportunity",
Rohit Waghchaure2f1db572016-11-08 12:39:33 +0530305 "erpnext.controllers.accounts_controller.update_invoice_status",
Rushabh Mehta5bceebc2015-01-23 15:22:13 +0530306 "erpnext.accounts.doctype.fiscal_year.fiscal_year.auto_create_fiscal_year",
Rushabh Mehta13ec41a2015-12-10 12:31:36 +0530307 "erpnext.hr.doctype.employee.employee.send_birthday_reminders",
Nabin Hait4fdb0522016-03-09 12:40:56 +0530308 "erpnext.projects.doctype.task.task.set_tasks_as_overdue",
Kanchan Chauhane58a41a2017-10-17 15:17:24 +0530309 "erpnext.assets.doctype.asset.depreciation.post_depreciation_entries",
Suraj Shettyd3069fe2018-02-21 15:15:43 +0530310 "erpnext.hr.doctype.daily_work_summary_group.daily_work_summary_group.send_summary",
Prateeksha Singhe012e242017-07-18 10:35:12 +0530311 "erpnext.stock.doctype.serial_no.serial_no.update_maintenance_status",
bcornwellmott96381da2017-07-24 10:12:30 -0700312 "erpnext.buying.doctype.supplier_scorecard.supplier_scorecard.refresh_scorecards",
Nabin Haitadbf8ad2017-07-31 20:45:36 +0530313 "erpnext.setup.doctype.company.company.cache_companies_monthly_sales_history",
Manas Solanki2f4e5ee2018-05-15 15:25:14 +0530314 "erpnext.assets.doctype.asset.asset.update_maintenance_status",
Rohan Bansalbf0f0aa2018-05-23 15:06:45 +0530315 "erpnext.assets.doctype.asset.asset.make_post_gl_entry",
Himanshu Mishra7aabef22018-06-28 23:43:23 +0530316 "erpnext.crm.doctype.contract.contract.update_status_for_contracts",
Himanshu0209ef02018-12-25 17:42:31 +0530317 "erpnext.projects.doctype.project.project.update_project_sales_billing",
Sagar Vora4d1a9b12019-01-22 15:56:39 +0530318 "erpnext.projects.doctype.project.project.send_project_status_email_to_users",
Himanshuf3e52132019-03-19 16:47:56 +0530319 "erpnext.quality_management.doctype.quality_review.quality_review.review",
Himanshu Warekarcf37e402019-05-07 10:27:01 +0530320 "erpnext.support.doctype.service_level_agreement.service_level_agreement.check_agreement_status",
Rucha Mahabalb54459e2019-07-22 03:23:40 +0530321 "erpnext.crm.doctype.email_campaign.email_campaign.send_email_to_leads_or_contacts",
0Pranav53b65ab2019-11-15 16:42:32 +0530322 "erpnext.crm.doctype.email_campaign.email_campaign.set_email_campaign_status",
marination81798042020-04-14 23:05:11 +0530323 "erpnext.selling.doctype.quotation.quotation.set_expired_status",
marination1bab1532020-04-15 12:16:31 +0530324 "erpnext.healthcare.doctype.patient_appointment.patient_appointment.update_appointment_status",
marination81798042020-04-14 23:05:11 +0530325 "erpnext.buying.doctype.supplier_quotation.supplier_quotation.set_expired_status"
KanchanChauhan73bd3cb2018-09-05 11:01:35 +0530326 ],
327 "daily_long": [
Gavin D'souzad38f5372019-10-30 14:43:58 +0530328 "erpnext.setup.doctype.email_digest.email_digest.send",
Mangesh-Khairnarf281f002019-08-05 14:47:02 +0530329 "erpnext.manufacturing.doctype.bom_update_tool.bom_update_tool.update_latest_price_in_all_boms",
330 "erpnext.hr.doctype.leave_ledger_entry.leave_ledger_entry.process_expired_allocation",
Deepesh Gargd1d0a502020-02-26 10:44:24 +0530331 "erpnext.hr.utils.generate_leave_encashment",
Deepesh Gargaf27d612020-04-13 12:29:00 +0530332 "erpnext.loan_management.doctype.loan_security_shortfall.loan_security_shortfall.create_process_loan_security_shortfall",
Deepesh Gargf7e216e2020-04-10 20:03:11 +0530333 "erpnext.loan_management.doctype.loan_interest_accrual.loan_interest_accrual.process_loan_interest_accrual_for_term_loans"
KanchanChauhan73bd3cb2018-09-05 11:01:35 +0530334 ],
Nabin Haitb9b2a062019-05-01 12:49:44 +0530335 "monthly_long": [
Deepesh Gargde03d2c2020-06-01 11:30:34 +0530336 "erpnext.accounts.deferred_revenue.process_deferred_accounting",
Deepesh Gargd1d0a502020-02-26 10:44:24 +0530337 "erpnext.hr.utils.allocate_earned_leaves",
Deepesh Gargf7e216e2020-04-10 20:03:11 +0530338 "erpnext.loan_management.doctype.loan_interest_accrual.loan_interest_accrual.process_loan_interest_accrual_for_demand_loans"
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +0530339 ]
340}
Anand Doshi7f41ff22014-06-26 12:02:55 +0530341
Faris Ansari2c5b3e82017-07-13 18:37:18 +0530342email_brand_image = "assets/erpnext/images/erpnext-logo.jpg"
343
Faris Ansari40d3ad22017-07-31 16:16:22 +0530344default_mail_footer = """
345 <span>
346 Sent via
347 <a class="text-muted" href="https://erpnext.com?source=via_email_footer" target="_blank">
348 ERPNext
349 </a>
350 </span>
351"""
Anand Doshic82331b2015-02-12 18:58:28 +0530352
353get_translated_dict = {
Anand Doshic82331b2015-02-12 18:58:28 +0530354 ("doctype", "Global Defaults"): "frappe.geo.country_info.get_translated_dict"
355}
Rushabh Mehtafe027b32016-03-28 13:21:43 +0530356
357bot_parsers = [
358 'erpnext.utilities.bot.FindItemBot',
Rushabh Mehta0c76f212016-04-01 11:53:50 +0530359]
Anand Doshif576f3b2016-06-25 19:51:48 +0530360
361get_site_info = 'erpnext.utilities.get_site_info'
Saurabh94c666a2016-11-08 20:35:50 +0530362
Saurabh0d47d512017-03-14 14:46:05 +0530363payment_gateway_enabled = "erpnext.accounts.utils.create_payment_gateway_account"
Rushabh Mehta7231f292017-07-13 15:00:56 +0530364
Himanshub84333f2020-04-14 13:02:03 +0530365communication_doctypes = ["Customer", "Supplier"]
366
Rushabh Mehta7231f292017-07-13 15:00:56 +0530367regional_overrides = {
Charles-Henri Decultotb8c088e2018-02-21 06:37:33 +0100368 'France': {
369 'erpnext.tests.test_regional.test_method': 'erpnext.regional.france.utils.test_method'
370 },
Rushabh Mehta7231f292017-07-13 15:00:56 +0530371 'India': {
Nabin Haitb962fc12017-07-17 18:02:31 +0530372 'erpnext.tests.test_regional.test_method': 'erpnext.regional.india.utils.test_method',
373 'erpnext.controllers.taxes_and_totals.get_itemised_tax_breakup_header': 'erpnext.regional.india.utils.get_itemised_tax_breakup_header',
Shreya Shah4fa600a2018-06-05 11:27:53 +0530374 'erpnext.controllers.taxes_and_totals.get_itemised_tax_breakup_data': 'erpnext.regional.india.utils.get_itemised_tax_breakup_data',
Ranjith Kurungadama8e047a2018-06-14 17:56:16 +0530375 'erpnext.accounts.party.get_regional_address_details': 'erpnext.regional.india.utils.get_regional_address_details',
376 'erpnext.hr.utils.calculate_annual_eligible_hra_exemption': 'erpnext.regional.india.utils.calculate_annual_eligible_hra_exemption',
Deepesh Garg3c004ad2020-07-02 21:18:29 +0530377 'erpnext.hr.utils.calculate_hra_exemption_for_period': 'erpnext.regional.india.utils.calculate_hra_exemption_for_period',
378 'erpnext.accounts.doctype.purchase_invoice.purchase_invoice.make_regional_gl_entries': 'erpnext.regional.india.utils.make_regional_gl_entries'
rohitwaghchaured4526682017-12-28 14:20:13 +0530379 },
380 'United Arab Emirates': {
381 'erpnext.controllers.taxes_and_totals.update_itemised_tax_data': 'erpnext.regional.united_arab_emirates.utils.update_itemised_tax_data'
382 },
383 'Saudi Arabia': {
384 'erpnext.controllers.taxes_and_totals.update_itemised_tax_data': 'erpnext.regional.united_arab_emirates.utils.update_itemised_tax_data'
scmmishra14d70ce2019-03-14 12:31:25 +0530385 },
386 'Italy': {
387 'erpnext.controllers.taxes_and_totals.update_itemised_tax_data': 'erpnext.regional.italy.utils.update_itemised_tax_data',
388 'erpnext.controllers.accounts_controller.validate_regional': 'erpnext.regional.italy.utils.sales_invoice_validate',
Rushabh Mehta7231f292017-07-13 15:00:56 +0530389 }
Manas Solanki2f4e5ee2018-05-15 15:25:14 +0530390}
Mangesh-Khairnar2ffa87e2019-03-20 13:25:48 +0530391user_privacy_documents = [
392 {
393 'doctype': 'Lead',
394 'match_field': 'email_id',
395 'personal_fields': ['phone', 'mobile_no', 'fax', 'website', 'lead_name'],
396 },
397 {
398 'doctype': 'Opportunity',
399 'match_field': 'contact_email',
400 'personal_fields': ['contact_mobile', 'contact_display', 'customer_name'],
401 }
John Clarkeb7339842019-04-04 23:32:25 -0600402]
Himanshu83b0b2a2019-09-27 00:59:48 +0530403
Himanshu Warekar21abc3a2019-09-30 13:40:02 +0530404# ERPNext doctypes for Global Search
Himanshu Warekar23c916c2019-10-02 16:32:53 +0530405global_search_doctypes = {
406 "Default": [
407 {"doctype": "Customer", "index": 0},
408 {"doctype": "Supplier", "index": 1},
409 {"doctype": "Item", "index": 2},
410 {"doctype": "Warehouse", "index": 3},
411 {"doctype": "Account", "index": 4},
412 {"doctype": "Employee", "index": 5},
413 {"doctype": "BOM", "index": 6},
414 {"doctype": "Sales Invoice", "index": 7},
415 {"doctype": "Sales Order", "index": 8},
416 {"doctype": "Quotation", "index": 9},
417 {"doctype": "Work Order", "index": 10},
418 {"doctype": "Purchase Receipt", "index": 11},
419 {"doctype": "Purchase Invoice", "index": 12},
420 {"doctype": "Delivery Note", "index": 13},
421 {"doctype": "Stock Entry", "index": 14},
422 {"doctype": "Material Request", "index": 15},
423 {"doctype": "Delivery Trip", "index": 16},
424 {"doctype": "Pick List", "index": 17},
425 {"doctype": "Salary Slip", "index": 18},
426 {"doctype": "Leave Application", "index": 19},
427 {"doctype": "Expense Claim", "index": 20},
428 {"doctype": "Payment Entry", "index": 21},
429 {"doctype": "Lead", "index": 22},
430 {"doctype": "Opportunity", "index": 23},
431 {"doctype": "Item Price", "index": 24},
432 {"doctype": "Purchase Taxes and Charges Template", "index": 25},
433 {"doctype": "Sales Taxes and Charges", "index": 26},
434 {"doctype": "Asset", "index": 27},
435 {"doctype": "Project", "index": 28},
436 {"doctype": "Task", "index": 29},
437 {"doctype": "Timesheet", "index": 30},
438 {"doctype": "Issue", "index": 31},
439 {"doctype": "Serial No", "index": 32},
440 {"doctype": "Batch", "index": 33},
441 {"doctype": "Branch", "index": 34},
442 {"doctype": "Department", "index": 35},
443 {"doctype": "Employee Grade", "index": 36},
444 {"doctype": "Designation", "index": 37},
445 {"doctype": "Job Opening", "index": 38},
446 {"doctype": "Job Applicant", "index": 39},
447 {"doctype": "Job Offer", "index": 40},
448 {"doctype": "Salary Structure Assignment", "index": 41},
449 {"doctype": "Appraisal", "index": 42},
450 {"doctype": "Loan", "index": 43},
451 {"doctype": "Maintenance Schedule", "index": 44},
452 {"doctype": "Maintenance Visit", "index": 45},
453 {"doctype": "Warranty Claim", "index": 46},
454 ],
455 "Healthcare": [
456 {'doctype': 'Patient', 'index': 1},
457 {'doctype': 'Medical Department', 'index': 2},
458 {'doctype': 'Vital Signs', 'index': 3},
459 {'doctype': 'Healthcare Practitioner', 'index': 4},
460 {'doctype': 'Patient Appointment', 'index': 5},
461 {'doctype': 'Healthcare Service Unit', 'index': 6},
462 {'doctype': 'Patient Encounter', 'index': 7},
463 {'doctype': 'Antibiotic', 'index': 8},
464 {'doctype': 'Diagnosis', 'index': 9},
465 {'doctype': 'Lab Test', 'index': 10},
466 {'doctype': 'Clinical Procedure', 'index': 11},
467 {'doctype': 'Inpatient Record', 'index': 12},
468 {'doctype': 'Sample Collection', 'index': 13},
469 {'doctype': 'Patient Medical Record', 'index': 14},
470 {'doctype': 'Appointment Type', 'index': 15},
471 {'doctype': 'Fee Validity', 'index': 16},
472 {'doctype': 'Practitioner Schedule', 'index': 17},
473 {'doctype': 'Dosage Form', 'index': 18},
474 {'doctype': 'Lab Test Sample', 'index': 19},
475 {'doctype': 'Prescription Duration', 'index': 20},
476 {'doctype': 'Prescription Dosage', 'index': 21},
477 {'doctype': 'Sensitivity', 'index': 22},
478 {'doctype': 'Complaint', 'index': 23},
479 {'doctype': 'Medical Code', 'index': 24},
480 ],
481 "Education": [
482 {'doctype': 'Article', 'index': 1},
483 {'doctype': 'Video', 'index': 2},
484 {'doctype': 'Topic', 'index': 3},
485 {'doctype': 'Course', 'index': 4},
486 {'doctype': 'Program', 'index': 5},
487 {'doctype': 'Quiz', 'index': 6},
488 {'doctype': 'Question', 'index': 7},
489 {'doctype': 'Fee Schedule', 'index': 8},
490 {'doctype': 'Fee Structure', 'index': 9},
491 {'doctype': 'Fees', 'index': 10},
492 {'doctype': 'Student Group', 'index': 11},
493 {'doctype': 'Student', 'index': 12},
494 {'doctype': 'Instructor', 'index': 13},
495 {'doctype': 'Course Activity', 'index': 14},
496 {'doctype': 'Quiz Activity', 'index': 15},
497 {'doctype': 'Course Enrollment', 'index': 16},
498 {'doctype': 'Program Enrollment', 'index': 17},
499 {'doctype': 'Student Language', 'index': 18},
500 {'doctype': 'Student Applicant', 'index': 19},
501 {'doctype': 'Assessment Result', 'index': 20},
502 {'doctype': 'Assessment Plan', 'index': 21},
503 {'doctype': 'Grading Scale', 'index': 22},
504 {'doctype': 'Guardian', 'index': 23},
505 {'doctype': 'Student Leave Application', 'index': 24},
506 {'doctype': 'Student Log', 'index': 25},
507 {'doctype': 'Room', 'index': 26},
508 {'doctype': 'Course Schedule', 'index': 27},
509 {'doctype': 'Student Attendance', 'index': 28},
510 {'doctype': 'Announcement', 'index': 29},
511 {'doctype': 'Student Category', 'index': 30},
512 {'doctype': 'Assessment Group', 'index': 31},
513 {'doctype': 'Student Batch Name', 'index': 32},
514 {'doctype': 'Assessment Criteria', 'index': 33},
515 {'doctype': 'Academic Year', 'index': 34},
516 {'doctype': 'Academic Term', 'index': 35},
517 {'doctype': 'School House', 'index': 36},
518 {'doctype': 'Student Admission', 'index': 37},
519 {'doctype': 'Fee Category', 'index': 38},
520 {'doctype': 'Assessment Code', 'index': 39},
521 {'doctype': 'Discussion', 'index': 40},
522 ],
523 "Agriculture": [
524 {'doctype': 'Weather', 'index': 1},
525 {'doctype': 'Soil Texture', 'index': 2},
526 {'doctype': 'Water Analysis', 'index': 3},
527 {'doctype': 'Soil Analysis', 'index': 4},
528 {'doctype': 'Plant Analysis', 'index': 5},
529 {'doctype': 'Agriculture Analysis Criteria', 'index': 6},
530 {'doctype': 'Disease', 'index': 7},
531 {'doctype': 'Crop', 'index': 8},
532 {'doctype': 'Fertilizer', 'index': 9},
533 {'doctype': 'Crop Cycle', 'index': 10}
534 ],
535 "Non Profit": [
536 {'doctype': 'Certified Consultant', 'index': 1},
537 {'doctype': 'Certification Application', 'index': 2},
538 {'doctype': 'Volunteer', 'index': 3},
539 {'doctype': 'Membership', 'index': 4},
540 {'doctype': 'Member', 'index': 5},
541 {'doctype': 'Donor', 'index': 6},
542 {'doctype': 'Chapter', 'index': 7},
543 {'doctype': 'Grant Application', 'index': 8},
544 {'doctype': 'Volunteer Type', 'index': 9},
545 {'doctype': 'Donor Type', 'index': 10},
546 {'doctype': 'Membership Type', 'index': 11}
547 ],
548 "Hospitality": [
549 {'doctype': 'Hotel Room', 'index': 0},
550 {'doctype': 'Hotel Room Reservation', 'index': 1},
551 {'doctype': 'Hotel Room Pricing', 'index': 2},
552 {'doctype': 'Hotel Room Package', 'index': 3},
553 {'doctype': 'Hotel Room Type', 'index': 4}
554 ]
KanchanChauhan2826fd32020-07-23 15:45:03 +0530555}