blob: dbb6c0d92ecfb044198e666c49423c86ab7092a2 [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 = {
Abhishek Balam346ca562020-10-14 18:11:04 +053024 "Address": "public/js/address.js",
mbauskarf54b1042017-03-13 16:32:46 +053025 "Communication": "public/js/communication.js",
Faris Ansari5f8b3582019-03-19 11:48:32 +053026 "Event": "public/js/event.js",
Faris Ansari1e55c2e2019-04-30 10:18:09 +053027 "Newsletter": "public/js/newsletter.js"
mbauskarf54b1042017-03-13 16:32:46 +053028}
29
Abhishek Balam6e9e7b42020-10-14 19:31:37 +053030override_doctype_class = {
Faris Ansari22bcad92020-10-16 15:28:12 +053031 'Address': 'erpnext.accounts.custom.address.ERPNextAddress'
Abhishek Balam6e9e7b42020-10-14 19:31:37 +053032}
33
Neil Trini Lasrado771fbb82018-08-24 15:15:56 +053034welcome_email = "erpnext.setup.utils.welcome_email"
35
Rushabh Mehta37b4d752015-11-09 16:53:11 +053036# setup wizard
37setup_wizard_requires = "assets/erpnext/js/setup_wizard.js"
Prateeksha Singh8b0b56d2017-12-21 11:55:58 +053038setup_wizard_stages = "erpnext.setup.setup_wizard.setup_wizard.get_setup_stages"
Prateeksha Singh95d8fd32017-09-04 11:14:04 +053039setup_wizard_test = "erpnext.setup.setup_wizard.test_setup_wizard.run_setup_wizard_test"
Rushabh Mehta37b4d752015-11-09 16:53:11 +053040
Rushabh Mehtad55bdcf2015-12-31 11:12:48 +053041before_install = "erpnext.setup.install.check_setup_wizard_not_completed"
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +053042after_install = "erpnext.setup.install.after_install"
43
44boot_session = "erpnext.startup.boot.boot_session"
45notification_config = "erpnext.startup.notifications.get_notification_config"
Rushabh Mehta05ce7ec2017-02-22 16:15:43 +053046get_help_messages = "erpnext.utilities.activation.get_help_messages"
prssanna3f1444e2019-09-24 13:04:53 +053047leaderboards = "erpnext.startup.leaderboard.get_leaderboards"
Prssanna Desai82ddef52020-06-18 18:18:41 +053048filters_config = "erpnext.startup.filters.get_filters_config"
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +053049
Faris Ansari38ac7f72019-10-09 11:41:33 +053050on_session_creation = [
51 "erpnext.portal.utils.create_customer_or_supplier",
52 "erpnext.shopping_cart.utils.set_cart_count"
53]
Rushabh Mehta3daa49a2014-10-21 16:16:30 +053054on_logout = "erpnext.shopping_cart.utils.clear_cart_count"
Anand Doshif9fc04c2015-02-23 22:14:12 +053055
Mangesh-Khairnar07aae762019-06-26 11:03:57 +053056treeviews = ['Account', 'Cost Center', 'Warehouse', 'Item Group', 'Customer Group', 'Sales Person', 'Territory', 'Assessment Group', 'Department']
Rushabh Mehta764aa922016-05-02 13:28:46 +053057
Anand Doshif9fc04c2015-02-23 22:14:12 +053058# website
Shivam Mishra51b6fe22019-05-14 10:22:15 +053059update_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 +053060my_account_context = "erpnext.shopping_cart.utils.update_my_account_context"
Rushabh Mehta621d6ea2015-07-08 12:39:27 +053061
Zarrar13ddc7e2018-03-20 12:38:43 +053062calendars = ["Task", "Work Order", "Leave Application", "Sales Order", "Holiday List", "Course Schedule"]
Rushabh Mehta621d6ea2015-07-08 12:39:27 +053063
Rushabh Mehtabc4e2cd2017-10-17 12:30:34 +053064domains = {
Ameya Shenoy5c623682017-12-06 18:36:27 +053065 'Agriculture': 'erpnext.domains.agriculture',
Rushabh Mehtabc4e2cd2017-10-17 12:30:34 +053066 'Distribution': 'erpnext.domains.distribution',
67 'Education': 'erpnext.domains.education',
68 'Healthcare': 'erpnext.domains.healthcare',
69 'Hospitality': 'erpnext.domains.hospitality',
70 'Manufacturing': 'erpnext.domains.manufacturing',
Zarrarde8f6122017-12-13 18:36:08 +053071 'Non Profit': 'erpnext.domains.non_profit',
Rushabh Mehtabc4e2cd2017-10-17 12:30:34 +053072 'Retail': 'erpnext.domains.retail',
73 'Services': 'erpnext.domains.services',
74}
75
Rushabh Mehtadbb51542017-08-10 21:06:09 +053076website_generators = ["Item Group", "Item", "BOM", "Sales Partner",
77 "Job Opening", "Student Admission"]
Rushabh Mehta621d6ea2015-07-08 12:39:27 +053078
Rushabh Mehta2e7c36e2015-04-16 12:41:42 +053079website_context = {
Rushabh Mehta5674c4f2015-04-16 15:09:42 +053080 "favicon": "/assets/erpnext/images/favicon.png",
Rushabh Mehtad40e6612017-01-10 14:46:45 +053081 "splash_image": "/assets/erpnext/images/erp-icon.svg"
Rushabh Mehta2e7c36e2015-04-16 12:41:42 +053082}
83
Anand Doshif9fc04c2015-02-23 22:14:12 +053084website_route_rules = [
85 {"from_route": "/orders", "to_route": "Sales Order"},
Rushabh Mehta156ce602015-09-11 18:49:59 +053086 {"from_route": "/orders/<path:name>", "to_route": "order",
87 "defaults": {
88 "doctype": "Sales Order",
Britlog4c7709e2017-07-28 15:24:22 +020089 "parents": [{"label": _("Orders"), "route": "orders"}]
Rushabh Mehta156ce602015-09-11 18:49:59 +053090 }
91 },
Anand Doshif9fc04c2015-02-23 22:14:12 +053092 {"from_route": "/invoices", "to_route": "Sales Invoice"},
Rushabh Mehta156ce602015-09-11 18:49:59 +053093 {"from_route": "/invoices/<path:name>", "to_route": "order",
94 "defaults": {
95 "doctype": "Sales Invoice",
Britlog4c7709e2017-07-28 15:24:22 +020096 "parents": [{"label": _("Invoices"), "route": "invoices"}]
Rushabh Mehta156ce602015-09-11 18:49:59 +053097 }
98 },
Makarand Bauskar9306aff2017-07-21 15:19:47 +053099 {"from_route": "/supplier-quotations", "to_route": "Supplier Quotation"},
100 {"from_route": "/supplier-quotations/<path:name>", "to_route": "order",
Rohit Waghchaure21499e82016-09-21 16:49:58 +0530101 "defaults": {
102 "doctype": "Supplier Quotation",
Brown-Harry Bomad3fa1912017-09-27 08:23:38 +0100103 "parents": [{"label": _("Supplier Quotation"), "route": "supplier-quotations"}]
Rohit Waghchaure21499e82016-09-21 16:49:58 +0530104 }
105 },
Faris Ansari38ac7f72019-10-09 11:41:33 +0530106 {"from_route": "/purchase-orders", "to_route": "Purchase Order"},
107 {"from_route": "/purchase-orders/<path:name>", "to_route": "order",
108 "defaults": {
109 "doctype": "Purchase Order",
110 "parents": [{"label": _("Purchase Order"), "route": "purchase-orders"}]
111 }
112 },
113 {"from_route": "/purchase-invoices", "to_route": "Purchase Invoice"},
114 {"from_route": "/purchase-invoices/<path:name>", "to_route": "order",
115 "defaults": {
116 "doctype": "Purchase Invoice",
117 "parents": [{"label": _("Purchase Invoice"), "route": "purchase-invoices"}]
118 }
119 },
Makarand Bauskar9306aff2017-07-21 15:19:47 +0530120 {"from_route": "/quotations", "to_route": "Quotation"},
121 {"from_route": "/quotations/<path:name>", "to_route": "order",
122 "defaults": {
123 "doctype": "Quotation",
Rushabh Mehtadbb51542017-08-10 21:06:09 +0530124 "parents": [{"label": _("Quotations"), "route": "quotations"}]
Makarand Bauskar9306aff2017-07-21 15:19:47 +0530125 }
126 },
Anand Doshif9fc04c2015-02-23 22:14:12 +0530127 {"from_route": "/shipments", "to_route": "Delivery Note"},
Rushabh Mehta156ce602015-09-11 18:49:59 +0530128 {"from_route": "/shipments/<path:name>", "to_route": "order",
129 "defaults": {
Anand Doshi4b127402015-11-26 18:22:03 +0530130 "doctype": "Delivery Note",
Britlog4c7709e2017-07-28 15:24:22 +0200131 "parents": [{"label": _("Shipments"), "route": "shipments"}]
Rushabh Mehta156ce602015-09-11 18:49:59 +0530132 }
Kanchan Chauhan2e8cc892016-02-19 17:27:23 +0530133 },
rohitwaghchaurea1064a62016-03-03 14:00:35 +0530134 {"from_route": "/rfq", "to_route": "Request for Quotation"},
135 {"from_route": "/rfq/<path:name>", "to_route": "rfq",
136 "defaults": {
137 "doctype": "Request for Quotation",
Britlog4c7709e2017-07-28 15:24:22 +0200138 "parents": [{"label": _("Request for Quotation"), "route": "rfq"}]
rohitwaghchaurea1064a62016-03-03 14:00:35 +0530139 }
140 },
Kanchan Chauhan1605ff02016-07-04 14:28:09 +0530141 {"from_route": "/addresses", "to_route": "Address"},
142 {"from_route": "/addresses/<path:name>", "to_route": "addresses",
143 "defaults": {
144 "doctype": "Address",
Britlog4c7709e2017-07-28 15:24:22 +0200145 "parents": [{"label": _("Addresses"), "route": "addresses"}]
Kanchan Chauhan1605ff02016-07-04 14:28:09 +0530146 }
147 },
Kanchan Chauhan2e8cc892016-02-19 17:27:23 +0530148 {"from_route": "/jobs", "to_route": "Job Opening"},
Neil Trini Lasrado83d81202016-09-15 14:48:13 +0530149 {"from_route": "/admissions", "to_route": "Student Admission"},
Vishal Dhayagudeedb27492017-07-25 10:53:12 +0530150 {"from_route": "/boms", "to_route": "BOM"},
151 {"from_route": "/timesheets", "to_route": "Timesheet"},
Doridel Cahanap2b14d6a2018-11-13 14:37:16 +0800152 {"from_route": "/material-requests", "to_route": "Material Request"},
153 {"from_route": "/material-requests/<path:name>", "to_route": "material_request_info",
154 "defaults": {
155 "doctype": "Material Request",
156 "parents": [{"label": _("Material Request"), "route": "material-requests"}]
157 }
158 },
Anand Doshif9fc04c2015-02-23 22:14:12 +0530159]
160
Rushabh Mehtab9cdb052017-03-08 12:33:43 +0530161standard_portal_menu_items = [
Jamsheerf9269112018-07-16 18:08:53 +0530162 {"title": _("Personal Details"), "route": "/personal-details", "reference_doctype": "Patient", "role": "Patient"},
Rushabh Mehta0c76f212016-04-01 11:53:50 +0530163 {"title": _("Projects"), "route": "/project", "reference_doctype": "Project"},
Rushabh Mehtafc800b32016-09-23 21:51:51 +0530164 {"title": _("Request for Quotations"), "route": "/rfq", "reference_doctype": "Request for Quotation", "role": "Supplier"},
Makarand Bauskar9306aff2017-07-21 15:19:47 +0530165 {"title": _("Supplier Quotation"), "route": "/supplier-quotations", "reference_doctype": "Supplier Quotation", "role": "Supplier"},
Faris Ansari38ac7f72019-10-09 11:41:33 +0530166 {"title": _("Purchase Orders"), "route": "/purchase-orders", "reference_doctype": "Purchase Order", "role": "Supplier"},
167 {"title": _("Purchase Invoices"), "route": "/purchase-invoices", "reference_doctype": "Purchase Invoice", "role": "Supplier"},
Makarand Bauskar9306aff2017-07-21 15:19:47 +0530168 {"title": _("Quotations"), "route": "/quotations", "reference_doctype": "Quotation", "role":"Customer"},
Rushabh Mehtafc800b32016-09-23 21:51:51 +0530169 {"title": _("Orders"), "route": "/orders", "reference_doctype": "Sales Order", "role":"Customer"},
170 {"title": _("Invoices"), "route": "/invoices", "reference_doctype": "Sales Invoice", "role":"Customer"},
171 {"title": _("Shipments"), "route": "/shipments", "reference_doctype": "Delivery Note", "role":"Customer"},
172 {"title": _("Issues"), "route": "/issues", "reference_doctype": "Issue", "role":"Customer"},
Neil Trini Lasrado3f0a5812016-07-19 14:17:33 +0530173 {"title": _("Addresses"), "route": "/addresses", "reference_doctype": "Address"},
Manas Solankie716da02017-09-18 16:00:34 +0530174 {"title": _("Timesheets"), "route": "/timesheets", "reference_doctype": "Timesheet", "role":"Customer"},
Rushabh Mehtaf0569742017-09-13 12:52:30 +0530175 {"title": _("Lab Test"), "route": "/lab-test", "reference_doctype": "Lab Test", "role":"Patient"},
Jamsheerf9269112018-07-16 18:08:53 +0530176 {"title": _("Prescription"), "route": "/prescription", "reference_doctype": "Patient Encounter", "role":"Patient"},
Manas Solankie716da02017-09-18 16:00:34 +0530177 {"title": _("Patient Appointment"), "route": "/patient-appointments", "reference_doctype": "Patient Appointment", "role":"Patient"},
178 {"title": _("Fees"), "route": "/fees", "reference_doctype": "Fees", "role":"Student"},
Manas Solanki05180012017-10-05 14:31:31 +0530179 {"title": _("Newsletter"), "route": "/newsletters", "reference_doctype": "Newsletter"},
Faris Ansari38ac7f72019-10-09 11:41:33 +0530180 {"title": _("Admission"), "route": "/admissions", "reference_doctype": "Student Admission", "role": "Student"},
181 {"title": _("Certification"), "route": "/certification", "reference_doctype": "Certification Application", "role": "Non Profit Portal User"},
Doridel Cahanap2b14d6a2018-11-13 14:37:16 +0800182 {"title": _("Material Request"), "route": "/material-requests", "reference_doctype": "Material Request", "role": "Customer"},
0Pranav5f5c7252019-12-18 16:21:50 +0530183 {"title": _("Appointment Booking"), "route": "/book_appointment"},
Rushabh Mehtafc800b32016-09-23 21:51:51 +0530184]
185
186default_roles = [
Rushabh Mehta95439db2017-01-14 00:25:22 +0530187 {'role': 'Customer', 'doctype':'Contact', 'email_field': 'email_id'},
188 {'role': 'Supplier', 'doctype':'Contact', 'email_field': 'email_id'},
Vishal Dhayagudeedb27492017-07-25 10:53:12 +0530189 {'role': 'Student', 'doctype':'Student', 'email_field': 'student_email_id'},
Rushabh Mehtac78b3112016-03-30 12:29:48 +0530190]
191
Suraj Shettyf1ffdb32019-06-07 12:48:13 +0530192sounds = [
193 {"name": "incoming-call", "src": "/assets/erpnext/sounds/incoming-call.mp3", "volume": 0.2},
194 {"name": "call-disconnect", "src": "/assets/erpnext/sounds/call-disconnect.mp3", "volume": 0.2},
195]
196
Anand Doshif9fc04c2015-02-23 22:14:12 +0530197has_website_permission = {
198 "Sales Order": "erpnext.controllers.website_list_for_contact.has_website_permission",
Makarand Bauskar9306aff2017-07-21 15:19:47 +0530199 "Quotation": "erpnext.controllers.website_list_for_contact.has_website_permission",
Anand Doshif9fc04c2015-02-23 22:14:12 +0530200 "Sales Invoice": "erpnext.controllers.website_list_for_contact.has_website_permission",
Rohit Waghchaure21499e82016-09-21 16:49:58 +0530201 "Supplier Quotation": "erpnext.controllers.website_list_for_contact.has_website_permission",
Faris Ansari38ac7f72019-10-09 11:41:33 +0530202 "Purchase Order": "erpnext.controllers.website_list_for_contact.has_website_permission",
203 "Purchase Invoice": "erpnext.controllers.website_list_for_contact.has_website_permission",
Doridel Cahanap2b14d6a2018-11-13 14:37:16 +0800204 "Material Request": "erpnext.controllers.website_list_for_contact.has_website_permission",
Rushabh Mehtaa33d4682015-06-01 17:15:42 +0530205 "Delivery Note": "erpnext.controllers.website_list_for_contact.has_website_permission",
Vishal Dhayagudeedb27492017-07-25 10:53:12 +0530206 "Issue": "erpnext.support.doctype.issue.issue.has_website_permission",
Rushabh Mehtaf0569742017-09-13 12:52:30 +0530207 "Timesheet": "erpnext.controllers.website_list_for_contact.has_website_permission",
208 "Lab Test": "erpnext.healthcare.web_form.lab_test.lab_test.has_website_permission",
Jamsheerf9269112018-07-16 18:08:53 +0530209 "Patient Encounter": "erpnext.healthcare.web_form.prescription.prescription.has_website_permission",
210 "Patient Appointment": "erpnext.healthcare.web_form.patient_appointments.patient_appointments.has_website_permission",
211 "Patient": "erpnext.healthcare.web_form.personal_details.personal_details.has_website_permission"
Anand Doshif9fc04c2015-02-23 22:14:12 +0530212}
Rushabh Mehta3daa49a2014-10-21 16:16:30 +0530213
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +0530214dump_report_map = "erpnext.startup.report_data_map.data_map"
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +0530215
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +0530216before_tests = "erpnext.setup.utils.before_tests"
217
Rushabh Mehta308e6ea2015-03-24 17:34:58 +0530218standard_queries = {
Jamsheerc0097ad2018-11-23 11:37:58 +0530219 "Customer": "erpnext.selling.doctype.customer.customer.get_customer_list",
220 "Healthcare Practitioner": "erpnext.healthcare.doctype.healthcare_practitioner.healthcare_practitioner.get_practitioner_list"
Rushabh Mehta308e6ea2015-03-24 17:34:58 +0530221}
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +0530222
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +0530223doc_events = {
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +0530224 "Stock Entry": {
Nabin Hait4acd4312014-11-04 15:32:31 +0530225 "on_submit": "erpnext.stock.doctype.material_request.material_request.update_completed_and_requested_qty",
226 "on_cancel": "erpnext.stock.doctype.material_request.material_request.update_completed_and_requested_qty"
Anand Doshi648062d2014-05-05 16:46:14 +0530227 },
228 "User": {
KanchanChauhan1dc26b12017-06-13 15:26:35 +0530229 "after_insert": "frappe.contacts.doctype.contact.contact.update_contact",
Anand Doshi49856912014-05-28 18:49:13 +0530230 "validate": "erpnext.hr.doctype.employee.employee.validate_employee_role",
Rushabh Mehta0d6db6c2017-03-31 23:01:45 +0530231 "on_update": ["erpnext.hr.doctype.employee.employee.update_user_permissions",
232 "erpnext.portal.utils.set_default_role"]
Rushabh Mehta3daa49a2014-10-21 16:16:30 +0530233 },
Rushabh Mehtaf16f9c52016-04-08 17:20:50 +0530234 ("Sales Taxes and Charges Template", 'Price List'): {
Rushabh Mehta3daa49a2014-10-21 16:16:30 +0530235 "on_update": "erpnext.shopping_cart.doctype.shopping_cart_settings.shopping_cart_settings.validate_cart_settings"
236 },
Anand Doshie3bd78e2016-04-22 18:53:21 +0530237 "Website Settings": {
238 "validate": "erpnext.portal.doctype.products_settings.products_settings.home_page_is_products"
Saurabhe4e89542016-07-21 20:26:46 +0530239 },
Charles-Henri Decultotb8c088e2018-02-21 06:37:33 +0100240 "Sales Invoice": {
vishdhad3ec1c12020-03-24 11:31:41 +0530241 "on_submit": [
242 "erpnext.regional.create_transaction_log",
243 "erpnext.regional.italy.utils.sales_invoice_on_submit",
244 "erpnext.erpnext_integrations.taxjar_integration.create_transaction"
245 ],
246 "on_cancel": [
247 "erpnext.regional.italy.utils.sales_invoice_on_cancel",
248 "erpnext.erpnext_integrations.taxjar_integration.delete_transaction"
249 ],
Nabin Hait0357fbc2018-03-09 13:19:52 +0530250 "on_trash": "erpnext.regional.check_deletion_permission"
Charles-Henri Decultotb8c088e2018-02-21 06:37:33 +0100251 },
Deepesh Garg24f9a802020-06-03 10:59:37 +0530252 "Purchase Invoice": {
Deepesh Garg3c004ad2020-07-02 21:18:29 +0530253 "validate": "erpnext.regional.india.utils.update_grand_total_for_rcm"
Deepesh Garg24f9a802020-06-03 10:59:37 +0530254 },
Saurabhe4e89542016-07-21 20:26:46 +0530255 "Payment Entry": {
KanchanChauhan2826fd32020-07-23 15:45:03 +0530256 "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 +0530257 "on_trash": "erpnext.regional.check_deletion_permission"
Rushabh Mehtab3c8f442017-06-21 17:22:38 +0530258 },
259 'Address': {
Deepesh Garg6e2c13f2019-12-10 15:55:05 +0530260 '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 +0530261 },
Deepesh Garg6e2c13f2019-12-10 15:55:05 +0530262 ('Sales Invoice', 'Sales Order', 'Delivery Note', 'Purchase Invoice', 'Purchase Order', 'Purchase Receipt'): {
263 'validate': ['erpnext.regional.india.utils.set_place_of_supply']
Shridhar Patil4987c4e2018-07-03 10:10:04 +0530264 },
Suraj Shettyd4edd282019-08-09 19:23:04 +0530265 "Contact": {
266 "on_trash": "erpnext.support.doctype.issue.issue.update_issue",
Rohan Bansal76825ab2020-04-28 16:08:52 +0530267 "after_insert": "erpnext.communication.doctype.call_log.call_log.set_caller_information",
268 "validate": "erpnext.crm.utils.update_lead_phone_numbers"
Suraj Shettyd4edd282019-08-09 19:23:04 +0530269 },
270 "Lead": {
271 "after_insert": "erpnext.communication.doctype.call_log.call_log.set_caller_information"
Rucha Mahabal9e35bff2019-07-12 13:56:36 +0530272 },
273 "Email Unsubscribe": {
274 "after_insert": "erpnext.crm.doctype.email_campaign.email_campaign.unsubscribe_recipient"
vishdhad3ec1c12020-03-24 11:31:41 +0530275 },
276 ('Quotation', 'Sales Order', 'Sales Invoice'): {
277 'validate': ["erpnext.erpnext_integrations.taxjar_integration.set_sales_tax"]
Anand Doshie3bd78e2016-04-22 18:53:21 +0530278 }
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +0530279}
280
vishaldcef7982020-01-13 12:59:52 +0530281# On cancel event Payment Entry will be exempted and all linked submittable doctype will get cancelled.
282# to maintain data integrity we exempted payment entry. it will un-link when sales invoice get cancelled.
283# if payment entry not in auto cancel exempted doctypes it will cancel payment entry.
284auto_cancel_exempted_doctypes= [
Rucha Mahabal4887b692020-10-23 20:33:30 +0530285 "Payment Entry",
286 "Inpatient Medication Entry"
vishaldcef7982020-01-13 12:59:52 +0530287]
vishal70148a62019-12-02 17:37:46 +0530288
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +0530289scheduler_events = {
marination06ee0ea2020-09-07 18:49:06 +0530290 "cron": {
291 "0/30 * * * *": [
Gavin D'souza71ac3992020-09-10 13:57:44 +0530292 "erpnext.utilities.doctype.video.video.update_youtube_data",
marination06ee0ea2020-09-07 18:49:06 +0530293 ]
294 },
Rohit Waghchaure425dff92019-01-17 12:49:45 +0530295 "all": [
Rucha Mahabal5100e112020-02-24 22:08:45 +0530296 "erpnext.projects.doctype.project.project.project_status_update_reminder",
rohitwaghchaure77403ab2020-04-25 17:37:24 +0530297 "erpnext.healthcare.doctype.patient_appointment.patient_appointment.send_appointment_reminder",
Anupam K22318b22020-04-18 00:45:18 +0530298 "erpnext.crm.doctype.social_media_post.social_media_post.process_scheduled_social_media_posts"
Rohit Waghchaure425dff92019-01-17 12:49:45 +0530299 ],
Nabin Hait75807232015-07-02 14:41:27 +0530300 "hourly": [
tundebabzy0ec44522018-03-01 11:33:03 +0100301 'erpnext.hr.doctype.daily_work_summary_group.daily_work_summary_group.trigger_emails',
Pawan Mehta6010a102018-09-05 17:16:57 +0530302 "erpnext.accounts.doctype.subscription.subscription.process_all",
Aditya Hase7bc692d2019-01-07 19:01:47 +0530303 "erpnext.erpnext_integrations.doctype.amazon_mws_settings.amazon_mws_settings.schedule_get_order_details",
304 "erpnext.accounts.doctype.gl_entry.gl_entry.rename_gle_sle_docs",
Nabin Hait34c551d2019-07-03 10:34:31 +0530305 "erpnext.erpnext_integrations.doctype.plaid_settings.plaid_settings.automatic_synchronization",
Rohit Waghchaure425dff92019-01-17 12:49:45 +0530306 "erpnext.projects.doctype.project.project.hourly_reminder",
Himanshu Warekar6e6148b2019-05-10 23:49:42 +0530307 "erpnext.projects.doctype.project.project.collect_project_status",
Himanshu Warekar2373c092019-06-25 16:27:06 +0530308 "erpnext.hr.doctype.shift_type.shift_type.process_auto_attendance_for_all_shifts",
Himanshu Warekar6931ea62019-06-25 16:27:58 +0530309 "erpnext.support.doctype.issue.issue.set_service_level_agreement_variance",
Nabin Hait75807232015-07-02 14:41:27 +0530310 ],
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +0530311 "daily": [
Rushabh Mehtaf8509872014-10-08 12:03:19 +0530312 "erpnext.stock.reorder_item.reorder_item",
Nabin Hait606af962014-12-15 11:57:03 +0530313 "erpnext.support.doctype.issue.issue.auto_close_tickets",
mbauskare1e25a02017-02-16 19:36:59 +0530314 "erpnext.crm.doctype.opportunity.opportunity.auto_close_opportunity",
Rohit Waghchaure2f1db572016-11-08 12:39:33 +0530315 "erpnext.controllers.accounts_controller.update_invoice_status",
Rushabh Mehta5bceebc2015-01-23 15:22:13 +0530316 "erpnext.accounts.doctype.fiscal_year.fiscal_year.auto_create_fiscal_year",
Rushabh Mehta13ec41a2015-12-10 12:31:36 +0530317 "erpnext.hr.doctype.employee.employee.send_birthday_reminders",
Nabin Hait4fdb0522016-03-09 12:40:56 +0530318 "erpnext.projects.doctype.task.task.set_tasks_as_overdue",
Kanchan Chauhane58a41a2017-10-17 15:17:24 +0530319 "erpnext.assets.doctype.asset.depreciation.post_depreciation_entries",
Suraj Shettyd3069fe2018-02-21 15:15:43 +0530320 "erpnext.hr.doctype.daily_work_summary_group.daily_work_summary_group.send_summary",
Prateeksha Singhe012e242017-07-18 10:35:12 +0530321 "erpnext.stock.doctype.serial_no.serial_no.update_maintenance_status",
bcornwellmott96381da2017-07-24 10:12:30 -0700322 "erpnext.buying.doctype.supplier_scorecard.supplier_scorecard.refresh_scorecards",
Nabin Haitadbf8ad2017-07-31 20:45:36 +0530323 "erpnext.setup.doctype.company.company.cache_companies_monthly_sales_history",
Manas Solanki2f4e5ee2018-05-15 15:25:14 +0530324 "erpnext.assets.doctype.asset.asset.update_maintenance_status",
Rohan Bansalbf0f0aa2018-05-23 15:06:45 +0530325 "erpnext.assets.doctype.asset.asset.make_post_gl_entry",
Himanshu Mishra7aabef22018-06-28 23:43:23 +0530326 "erpnext.crm.doctype.contract.contract.update_status_for_contracts",
Himanshu0209ef02018-12-25 17:42:31 +0530327 "erpnext.projects.doctype.project.project.update_project_sales_billing",
Sagar Vora4d1a9b12019-01-22 15:56:39 +0530328 "erpnext.projects.doctype.project.project.send_project_status_email_to_users",
Himanshuf3e52132019-03-19 16:47:56 +0530329 "erpnext.quality_management.doctype.quality_review.quality_review.review",
Himanshu Warekarcf37e402019-05-07 10:27:01 +0530330 "erpnext.support.doctype.service_level_agreement.service_level_agreement.check_agreement_status",
Rucha Mahabalb54459e2019-07-22 03:23:40 +0530331 "erpnext.crm.doctype.email_campaign.email_campaign.send_email_to_leads_or_contacts",
0Pranav53b65ab2019-11-15 16:42:32 +0530332 "erpnext.crm.doctype.email_campaign.email_campaign.set_email_campaign_status",
marination81798042020-04-14 23:05:11 +0530333 "erpnext.selling.doctype.quotation.quotation.set_expired_status",
marination1bab1532020-04-15 12:16:31 +0530334 "erpnext.healthcare.doctype.patient_appointment.patient_appointment.update_appointment_status",
Abhishek Balamee5b9c72020-08-11 16:23:47 +0530335 "erpnext.buying.doctype.supplier_quotation.supplier_quotation.set_expired_status",
336 "erpnext.accounts.doctype.process_statement_of_accounts.process_statement_of_accounts.send_auto_email"
KanchanChauhan73bd3cb2018-09-05 11:01:35 +0530337 ],
338 "daily_long": [
Gavin D'souzad38f5372019-10-30 14:43:58 +0530339 "erpnext.setup.doctype.email_digest.email_digest.send",
Mangesh-Khairnarf281f002019-08-05 14:47:02 +0530340 "erpnext.manufacturing.doctype.bom_update_tool.bom_update_tool.update_latest_price_in_all_boms",
341 "erpnext.hr.doctype.leave_ledger_entry.leave_ledger_entry.process_expired_allocation",
Deepesh Gargd1d0a502020-02-26 10:44:24 +0530342 "erpnext.hr.utils.generate_leave_encashment",
Deepesh Gargaf27d612020-04-13 12:29:00 +0530343 "erpnext.loan_management.doctype.loan_security_shortfall.loan_security_shortfall.create_process_loan_security_shortfall",
Anupam77cf5322020-09-28 18:38:41 +0530344 "erpnext.loan_management.doctype.loan_interest_accrual.loan_interest_accrual.process_loan_interest_accrual_for_term_loans",
345 "erpnext.crm.doctype.lead.lead.daily_open_lead"
KanchanChauhan73bd3cb2018-09-05 11:01:35 +0530346 ],
Nabin Haitb9b2a062019-05-01 12:49:44 +0530347 "monthly_long": [
Deepesh Gargde03d2c2020-06-01 11:30:34 +0530348 "erpnext.accounts.deferred_revenue.process_deferred_accounting",
Deepesh Gargd1d0a502020-02-26 10:44:24 +0530349 "erpnext.hr.utils.allocate_earned_leaves",
Deepesh Gargf7e216e2020-04-10 20:03:11 +0530350 "erpnext.loan_management.doctype.loan_interest_accrual.loan_interest_accrual.process_loan_interest_accrual_for_demand_loans"
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +0530351 ]
352}
Anand Doshi7f41ff22014-06-26 12:02:55 +0530353
Faris Ansari2c5b3e82017-07-13 18:37:18 +0530354email_brand_image = "assets/erpnext/images/erpnext-logo.jpg"
355
Faris Ansari40d3ad22017-07-31 16:16:22 +0530356default_mail_footer = """
357 <span>
358 Sent via
359 <a class="text-muted" href="https://erpnext.com?source=via_email_footer" target="_blank">
360 ERPNext
361 </a>
362 </span>
363"""
Anand Doshic82331b2015-02-12 18:58:28 +0530364
365get_translated_dict = {
Anand Doshic82331b2015-02-12 18:58:28 +0530366 ("doctype", "Global Defaults"): "frappe.geo.country_info.get_translated_dict"
367}
Rushabh Mehtafe027b32016-03-28 13:21:43 +0530368
369bot_parsers = [
370 'erpnext.utilities.bot.FindItemBot',
Rushabh Mehta0c76f212016-04-01 11:53:50 +0530371]
Anand Doshif576f3b2016-06-25 19:51:48 +0530372
373get_site_info = 'erpnext.utilities.get_site_info'
Saurabh94c666a2016-11-08 20:35:50 +0530374
Saurabh0d47d512017-03-14 14:46:05 +0530375payment_gateway_enabled = "erpnext.accounts.utils.create_payment_gateway_account"
Rushabh Mehta7231f292017-07-13 15:00:56 +0530376
Himanshub84333f2020-04-14 13:02:03 +0530377communication_doctypes = ["Customer", "Supplier"]
378
Rushabh Mehta7231f292017-07-13 15:00:56 +0530379regional_overrides = {
Charles-Henri Decultotb8c088e2018-02-21 06:37:33 +0100380 'France': {
381 'erpnext.tests.test_regional.test_method': 'erpnext.regional.france.utils.test_method'
382 },
Rushabh Mehta7231f292017-07-13 15:00:56 +0530383 'India': {
Nabin Haitb962fc12017-07-17 18:02:31 +0530384 'erpnext.tests.test_regional.test_method': 'erpnext.regional.india.utils.test_method',
385 '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 +0530386 '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 +0530387 'erpnext.accounts.party.get_regional_address_details': 'erpnext.regional.india.utils.get_regional_address_details',
388 'erpnext.hr.utils.calculate_annual_eligible_hra_exemption': 'erpnext.regional.india.utils.calculate_annual_eligible_hra_exemption',
Deepesh Garg3c004ad2020-07-02 21:18:29 +0530389 'erpnext.hr.utils.calculate_hra_exemption_for_period': 'erpnext.regional.india.utils.calculate_hra_exemption_for_period',
390 '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 +0530391 },
392 'United Arab Emirates': {
393 'erpnext.controllers.taxes_and_totals.update_itemised_tax_data': 'erpnext.regional.united_arab_emirates.utils.update_itemised_tax_data'
394 },
395 'Saudi Arabia': {
396 '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 +0530397 },
398 'Italy': {
399 'erpnext.controllers.taxes_and_totals.update_itemised_tax_data': 'erpnext.regional.italy.utils.update_itemised_tax_data',
400 'erpnext.controllers.accounts_controller.validate_regional': 'erpnext.regional.italy.utils.sales_invoice_validate',
barredterra81ad90c2020-09-29 11:54:57 +0200401 },
402 'Germany': {
403 'erpnext.controllers.accounts_controller.validate_regional': 'erpnext.regional.germany.accounts_controller.validate_regional',
Rushabh Mehta7231f292017-07-13 15:00:56 +0530404 }
Manas Solanki2f4e5ee2018-05-15 15:25:14 +0530405}
Mangesh-Khairnar2ffa87e2019-03-20 13:25:48 +0530406user_privacy_documents = [
407 {
408 'doctype': 'Lead',
409 'match_field': 'email_id',
410 'personal_fields': ['phone', 'mobile_no', 'fax', 'website', 'lead_name'],
411 },
412 {
413 'doctype': 'Opportunity',
414 'match_field': 'contact_email',
415 'personal_fields': ['contact_mobile', 'contact_display', 'customer_name'],
416 }
John Clarkeb7339842019-04-04 23:32:25 -0600417]
Himanshu83b0b2a2019-09-27 00:59:48 +0530418
Himanshu Warekar21abc3a2019-09-30 13:40:02 +0530419# ERPNext doctypes for Global Search
Himanshu Warekar23c916c2019-10-02 16:32:53 +0530420global_search_doctypes = {
421 "Default": [
422 {"doctype": "Customer", "index": 0},
423 {"doctype": "Supplier", "index": 1},
424 {"doctype": "Item", "index": 2},
425 {"doctype": "Warehouse", "index": 3},
426 {"doctype": "Account", "index": 4},
427 {"doctype": "Employee", "index": 5},
428 {"doctype": "BOM", "index": 6},
429 {"doctype": "Sales Invoice", "index": 7},
430 {"doctype": "Sales Order", "index": 8},
431 {"doctype": "Quotation", "index": 9},
432 {"doctype": "Work Order", "index": 10},
433 {"doctype": "Purchase Receipt", "index": 11},
434 {"doctype": "Purchase Invoice", "index": 12},
435 {"doctype": "Delivery Note", "index": 13},
436 {"doctype": "Stock Entry", "index": 14},
437 {"doctype": "Material Request", "index": 15},
438 {"doctype": "Delivery Trip", "index": 16},
439 {"doctype": "Pick List", "index": 17},
440 {"doctype": "Salary Slip", "index": 18},
441 {"doctype": "Leave Application", "index": 19},
442 {"doctype": "Expense Claim", "index": 20},
443 {"doctype": "Payment Entry", "index": 21},
444 {"doctype": "Lead", "index": 22},
445 {"doctype": "Opportunity", "index": 23},
446 {"doctype": "Item Price", "index": 24},
447 {"doctype": "Purchase Taxes and Charges Template", "index": 25},
448 {"doctype": "Sales Taxes and Charges", "index": 26},
449 {"doctype": "Asset", "index": 27},
450 {"doctype": "Project", "index": 28},
451 {"doctype": "Task", "index": 29},
452 {"doctype": "Timesheet", "index": 30},
453 {"doctype": "Issue", "index": 31},
454 {"doctype": "Serial No", "index": 32},
455 {"doctype": "Batch", "index": 33},
456 {"doctype": "Branch", "index": 34},
457 {"doctype": "Department", "index": 35},
458 {"doctype": "Employee Grade", "index": 36},
459 {"doctype": "Designation", "index": 37},
460 {"doctype": "Job Opening", "index": 38},
461 {"doctype": "Job Applicant", "index": 39},
462 {"doctype": "Job Offer", "index": 40},
463 {"doctype": "Salary Structure Assignment", "index": 41},
464 {"doctype": "Appraisal", "index": 42},
465 {"doctype": "Loan", "index": 43},
466 {"doctype": "Maintenance Schedule", "index": 44},
467 {"doctype": "Maintenance Visit", "index": 45},
468 {"doctype": "Warranty Claim", "index": 46},
469 ],
470 "Healthcare": [
471 {'doctype': 'Patient', 'index': 1},
472 {'doctype': 'Medical Department', 'index': 2},
473 {'doctype': 'Vital Signs', 'index': 3},
474 {'doctype': 'Healthcare Practitioner', 'index': 4},
475 {'doctype': 'Patient Appointment', 'index': 5},
476 {'doctype': 'Healthcare Service Unit', 'index': 6},
477 {'doctype': 'Patient Encounter', 'index': 7},
478 {'doctype': 'Antibiotic', 'index': 8},
479 {'doctype': 'Diagnosis', 'index': 9},
480 {'doctype': 'Lab Test', 'index': 10},
481 {'doctype': 'Clinical Procedure', 'index': 11},
482 {'doctype': 'Inpatient Record', 'index': 12},
483 {'doctype': 'Sample Collection', 'index': 13},
484 {'doctype': 'Patient Medical Record', 'index': 14},
485 {'doctype': 'Appointment Type', 'index': 15},
486 {'doctype': 'Fee Validity', 'index': 16},
487 {'doctype': 'Practitioner Schedule', 'index': 17},
488 {'doctype': 'Dosage Form', 'index': 18},
489 {'doctype': 'Lab Test Sample', 'index': 19},
490 {'doctype': 'Prescription Duration', 'index': 20},
491 {'doctype': 'Prescription Dosage', 'index': 21},
492 {'doctype': 'Sensitivity', 'index': 22},
493 {'doctype': 'Complaint', 'index': 23},
494 {'doctype': 'Medical Code', 'index': 24},
495 ],
496 "Education": [
497 {'doctype': 'Article', 'index': 1},
498 {'doctype': 'Video', 'index': 2},
499 {'doctype': 'Topic', 'index': 3},
500 {'doctype': 'Course', 'index': 4},
501 {'doctype': 'Program', 'index': 5},
502 {'doctype': 'Quiz', 'index': 6},
503 {'doctype': 'Question', 'index': 7},
504 {'doctype': 'Fee Schedule', 'index': 8},
505 {'doctype': 'Fee Structure', 'index': 9},
506 {'doctype': 'Fees', 'index': 10},
507 {'doctype': 'Student Group', 'index': 11},
508 {'doctype': 'Student', 'index': 12},
509 {'doctype': 'Instructor', 'index': 13},
510 {'doctype': 'Course Activity', 'index': 14},
511 {'doctype': 'Quiz Activity', 'index': 15},
512 {'doctype': 'Course Enrollment', 'index': 16},
513 {'doctype': 'Program Enrollment', 'index': 17},
514 {'doctype': 'Student Language', 'index': 18},
515 {'doctype': 'Student Applicant', 'index': 19},
516 {'doctype': 'Assessment Result', 'index': 20},
517 {'doctype': 'Assessment Plan', 'index': 21},
518 {'doctype': 'Grading Scale', 'index': 22},
519 {'doctype': 'Guardian', 'index': 23},
520 {'doctype': 'Student Leave Application', 'index': 24},
521 {'doctype': 'Student Log', 'index': 25},
522 {'doctype': 'Room', 'index': 26},
523 {'doctype': 'Course Schedule', 'index': 27},
524 {'doctype': 'Student Attendance', 'index': 28},
525 {'doctype': 'Announcement', 'index': 29},
526 {'doctype': 'Student Category', 'index': 30},
527 {'doctype': 'Assessment Group', 'index': 31},
528 {'doctype': 'Student Batch Name', 'index': 32},
529 {'doctype': 'Assessment Criteria', 'index': 33},
530 {'doctype': 'Academic Year', 'index': 34},
531 {'doctype': 'Academic Term', 'index': 35},
532 {'doctype': 'School House', 'index': 36},
533 {'doctype': 'Student Admission', 'index': 37},
534 {'doctype': 'Fee Category', 'index': 38},
535 {'doctype': 'Assessment Code', 'index': 39},
536 {'doctype': 'Discussion', 'index': 40},
537 ],
538 "Agriculture": [
539 {'doctype': 'Weather', 'index': 1},
540 {'doctype': 'Soil Texture', 'index': 2},
541 {'doctype': 'Water Analysis', 'index': 3},
542 {'doctype': 'Soil Analysis', 'index': 4},
543 {'doctype': 'Plant Analysis', 'index': 5},
544 {'doctype': 'Agriculture Analysis Criteria', 'index': 6},
545 {'doctype': 'Disease', 'index': 7},
546 {'doctype': 'Crop', 'index': 8},
547 {'doctype': 'Fertilizer', 'index': 9},
548 {'doctype': 'Crop Cycle', 'index': 10}
549 ],
550 "Non Profit": [
551 {'doctype': 'Certified Consultant', 'index': 1},
552 {'doctype': 'Certification Application', 'index': 2},
553 {'doctype': 'Volunteer', 'index': 3},
554 {'doctype': 'Membership', 'index': 4},
555 {'doctype': 'Member', 'index': 5},
556 {'doctype': 'Donor', 'index': 6},
557 {'doctype': 'Chapter', 'index': 7},
558 {'doctype': 'Grant Application', 'index': 8},
559 {'doctype': 'Volunteer Type', 'index': 9},
560 {'doctype': 'Donor Type', 'index': 10},
561 {'doctype': 'Membership Type', 'index': 11}
562 ],
563 "Hospitality": [
564 {'doctype': 'Hotel Room', 'index': 0},
565 {'doctype': 'Hotel Room Reservation', 'index': 1},
566 {'doctype': 'Hotel Room Pricing', 'index': 2},
567 {'doctype': 'Hotel Room Package', 'index': 3},
568 {'doctype': 'Hotel Room Type', 'index': 4}
569 ]
Faris Ansari22bcad92020-10-16 15:28:12 +0530570}