blob: 5fca061f6bd419b487194f84a809d927fe7e467c [file] [log] [blame]
Rushabh Mehta156ce602015-09-11 18:49:59 +05301from frappe import _
2
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +05303app_name = "erpnext"
4app_title = "ERPNext"
Rushabh Mehtaba02ce62015-07-22 15:07:25 +05305app_publisher = "Frappe Technologies Pvt. Ltd."
Rushabh Mehtaedc8ab02015-11-18 16:48:19 +05306app_description = """ERP made simple"""
Rushabh Mehta2167ff52016-12-07 11:08:48 +05307app_icon = "fa fa-th"
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +05308app_color = "#e74c3c"
Nabin Hait7ba4d022015-11-05 16:55:10 +05309app_email = "info@erpnext.com"
10app_license = "GNU General Public License (v3)"
Rushabh Mehta7d23e422015-11-02 10:45:18 +053011source_link = "https://github.com/frappe/erpnext"
Shivam Mishra8261df22020-10-19 13:52:35 +053012app_logo_url = "/assets/erpnext/images/erpnext-logo.svg"
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +053013
scmmishra734d3e02018-11-03 18:03:35 +053014
Ankush Menat95e41b02022-05-08 22:04:00 +053015develop_version = "14.x.x-develop"
Rushabh Mehtadb206f22017-03-10 09:38:58 +053016
Faris Ansari464d8382021-05-07 14:53:42 +053017app_include_js = "erpnext.bundle.js"
18app_include_css = "erpnext.bundle.css"
19web_include_js = "erpnext-web.bundle.js"
20web_include_css = "erpnext-web.bundle.css"
Suraj Shetty815aad12021-05-23 13:31:54 +053021email_css = "email_erpnext.bundle.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",
Noah Jacobcbddeda2021-07-26 12:54:35 +053027 "Newsletter": "public/js/newsletter.js",
Ankush Menat494bd9e2022-03-28 18:52:46 +053028 "Contact": "public/js/contact.js",
mbauskarf54b1042017-03-13 16:32:46 +053029}
30
Ankush Menat494bd9e2022-03-28 18:52:46 +053031override_doctype_class = {"Address": "erpnext.accounts.custom.address.ERPNextAddress"}
Abhishek Balam6e9e7b42020-10-14 19:31:37 +053032
Neil Trini Lasrado771fbb82018-08-24 15:15:56 +053033welcome_email = "erpnext.setup.utils.welcome_email"
34
Rushabh Mehta37b4d752015-11-09 16:53:11 +053035# setup wizard
36setup_wizard_requires = "assets/erpnext/js/setup_wizard.js"
Prateeksha Singh8b0b56d2017-12-21 11:55:58 +053037setup_wizard_stages = "erpnext.setup.setup_wizard.setup_wizard.get_setup_stages"
Prateeksha Singh95d8fd32017-09-04 11:14:04 +053038setup_wizard_test = "erpnext.setup.setup_wizard.test_setup_wizard.run_setup_wizard_test"
Rushabh Mehta37b4d752015-11-09 16:53:11 +053039
Rushabh Mehtad55bdcf2015-12-31 11:12:48 +053040before_install = "erpnext.setup.install.check_setup_wizard_not_completed"
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +053041after_install = "erpnext.setup.install.after_install"
42
43boot_session = "erpnext.startup.boot.boot_session"
44notification_config = "erpnext.startup.notifications.get_notification_config"
Rushabh Mehta05ce7ec2017-02-22 16:15:43 +053045get_help_messages = "erpnext.utilities.activation.get_help_messages"
prssanna3f1444e2019-09-24 13:04:53 +053046leaderboards = "erpnext.startup.leaderboard.get_leaderboards"
Prssanna Desai82ddef52020-06-18 18:18:41 +053047filters_config = "erpnext.startup.filters.get_filters_config"
prssannab57b3c92020-10-22 15:37:47 +053048additional_print_settings = "erpnext.controllers.print_settings.get_print_settings"
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",
Ankush Menat494bd9e2022-03-28 18:52:46 +053052 "erpnext.e_commerce.shopping_cart.utils.set_cart_count",
Faris Ansari38ac7f72019-10-09 11:41:33 +053053]
marination22f41a12021-02-25 13:56:38 +053054on_logout = "erpnext.e_commerce.shopping_cart.utils.clear_cart_count"
Anand Doshif9fc04c2015-02-23 22:14:12 +053055
Ankush Menat494bd9e2022-03-28 18:52:46 +053056treeviews = [
57 "Account",
58 "Cost Center",
59 "Warehouse",
60 "Item Group",
61 "Customer Group",
Deepesh Garg0a67b022022-04-16 19:43:59 +053062 "Supplier Group",
Ankush Menat494bd9e2022-03-28 18:52:46 +053063 "Sales Person",
64 "Territory",
Ankush Menat494bd9e2022-03-28 18:52:46 +053065 "Department",
66]
Rushabh Mehta764aa922016-05-02 13:28:46 +053067
Anand Doshif9fc04c2015-02-23 22:14:12 +053068# website
Ankush Menat494bd9e2022-03-28 18:52:46 +053069update_website_context = [
70 "erpnext.e_commerce.shopping_cart.utils.update_website_context",
Ankush Menat494bd9e2022-03-28 18:52:46 +053071]
marination22f41a12021-02-25 13:56:38 +053072my_account_context = "erpnext.e_commerce.shopping_cart.utils.update_my_account_context"
Shariq Ansari9aa6f522021-09-14 12:49:08 +053073webform_list_context = "erpnext.controllers.website_list_for_contact.get_webform_list_context"
Rushabh Mehta621d6ea2015-07-08 12:39:27 +053074
Ankush Menat494bd9e2022-03-28 18:52:46 +053075calendars = [
76 "Task",
77 "Work Order",
78 "Leave Application",
79 "Sales Order",
80 "Holiday List",
Ankush Menat494bd9e2022-03-28 18:52:46 +053081]
Rushabh Mehta621d6ea2015-07-08 12:39:27 +053082
Rucha Mahabal512c82f2022-06-10 15:06:54 +053083website_generators = ["Item Group", "Website Item", "BOM", "Sales Partner"]
Rushabh Mehta621d6ea2015-07-08 12:39:27 +053084
Rushabh Mehta2e7c36e2015-04-16 12:41:42 +053085website_context = {
Rucha Mahabal01bea142021-10-04 09:58:38 +053086 "favicon": "/assets/erpnext/images/erpnext-favicon.svg",
Ankush Menat494bd9e2022-03-28 18:52:46 +053087 "splash_image": "/assets/erpnext/images/erpnext-logo.svg",
Rushabh Mehta2e7c36e2015-04-16 12:41:42 +053088}
89
Anand Doshif9fc04c2015-02-23 22:14:12 +053090website_route_rules = [
91 {"from_route": "/orders", "to_route": "Sales Order"},
Ankush Menat494bd9e2022-03-28 18:52:46 +053092 {
93 "from_route": "/orders/<path:name>",
94 "to_route": "order",
95 "defaults": {"doctype": "Sales Order", "parents": [{"label": _("Orders"), "route": "orders"}]},
Rushabh Mehta156ce602015-09-11 18:49:59 +053096 },
Anand Doshif9fc04c2015-02-23 22:14:12 +053097 {"from_route": "/invoices", "to_route": "Sales Invoice"},
Ankush Menat494bd9e2022-03-28 18:52:46 +053098 {
99 "from_route": "/invoices/<path:name>",
100 "to_route": "order",
Rushabh Mehta156ce602015-09-11 18:49:59 +0530101 "defaults": {
102 "doctype": "Sales Invoice",
Ankush Menat494bd9e2022-03-28 18:52:46 +0530103 "parents": [{"label": _("Invoices"), "route": "invoices"}],
104 },
Rushabh Mehta156ce602015-09-11 18:49:59 +0530105 },
Makarand Bauskar9306aff2017-07-21 15:19:47 +0530106 {"from_route": "/supplier-quotations", "to_route": "Supplier Quotation"},
Ankush Menat494bd9e2022-03-28 18:52:46 +0530107 {
108 "from_route": "/supplier-quotations/<path:name>",
109 "to_route": "order",
Rohit Waghchaure21499e82016-09-21 16:49:58 +0530110 "defaults": {
111 "doctype": "Supplier Quotation",
Ankush Menat494bd9e2022-03-28 18:52:46 +0530112 "parents": [{"label": _("Supplier Quotation"), "route": "supplier-quotations"}],
113 },
Rohit Waghchaure21499e82016-09-21 16:49:58 +0530114 },
Faris Ansari38ac7f72019-10-09 11:41:33 +0530115 {"from_route": "/purchase-orders", "to_route": "Purchase Order"},
Ankush Menat494bd9e2022-03-28 18:52:46 +0530116 {
117 "from_route": "/purchase-orders/<path:name>",
118 "to_route": "order",
Faris Ansari38ac7f72019-10-09 11:41:33 +0530119 "defaults": {
120 "doctype": "Purchase Order",
Ankush Menat494bd9e2022-03-28 18:52:46 +0530121 "parents": [{"label": _("Purchase Order"), "route": "purchase-orders"}],
122 },
Faris Ansari38ac7f72019-10-09 11:41:33 +0530123 },
124 {"from_route": "/purchase-invoices", "to_route": "Purchase Invoice"},
Ankush Menat494bd9e2022-03-28 18:52:46 +0530125 {
126 "from_route": "/purchase-invoices/<path:name>",
127 "to_route": "order",
Faris Ansari38ac7f72019-10-09 11:41:33 +0530128 "defaults": {
129 "doctype": "Purchase Invoice",
Ankush Menat494bd9e2022-03-28 18:52:46 +0530130 "parents": [{"label": _("Purchase Invoice"), "route": "purchase-invoices"}],
131 },
Faris Ansari38ac7f72019-10-09 11:41:33 +0530132 },
Makarand Bauskar9306aff2017-07-21 15:19:47 +0530133 {"from_route": "/quotations", "to_route": "Quotation"},
Ankush Menat494bd9e2022-03-28 18:52:46 +0530134 {
135 "from_route": "/quotations/<path:name>",
136 "to_route": "order",
Makarand Bauskar9306aff2017-07-21 15:19:47 +0530137 "defaults": {
138 "doctype": "Quotation",
Ankush Menat494bd9e2022-03-28 18:52:46 +0530139 "parents": [{"label": _("Quotations"), "route": "quotations"}],
140 },
Makarand Bauskar9306aff2017-07-21 15:19:47 +0530141 },
Anand Doshif9fc04c2015-02-23 22:14:12 +0530142 {"from_route": "/shipments", "to_route": "Delivery Note"},
Ankush Menat494bd9e2022-03-28 18:52:46 +0530143 {
144 "from_route": "/shipments/<path:name>",
145 "to_route": "order",
Rushabh Mehta156ce602015-09-11 18:49:59 +0530146 "defaults": {
Anand Doshi4b127402015-11-26 18:22:03 +0530147 "doctype": "Delivery Note",
Ankush Menat494bd9e2022-03-28 18:52:46 +0530148 "parents": [{"label": _("Shipments"), "route": "shipments"}],
149 },
Kanchan Chauhan2e8cc892016-02-19 17:27:23 +0530150 },
rohitwaghchaurea1064a62016-03-03 14:00:35 +0530151 {"from_route": "/rfq", "to_route": "Request for Quotation"},
Ankush Menat494bd9e2022-03-28 18:52:46 +0530152 {
153 "from_route": "/rfq/<path:name>",
154 "to_route": "rfq",
rohitwaghchaurea1064a62016-03-03 14:00:35 +0530155 "defaults": {
156 "doctype": "Request for Quotation",
Ankush Menat494bd9e2022-03-28 18:52:46 +0530157 "parents": [{"label": _("Request for Quotation"), "route": "rfq"}],
158 },
rohitwaghchaurea1064a62016-03-03 14:00:35 +0530159 },
Kanchan Chauhan1605ff02016-07-04 14:28:09 +0530160 {"from_route": "/addresses", "to_route": "Address"},
Ankush Menat494bd9e2022-03-28 18:52:46 +0530161 {
162 "from_route": "/addresses/<path:name>",
163 "to_route": "addresses",
164 "defaults": {"doctype": "Address", "parents": [{"label": _("Addresses"), "route": "addresses"}]},
Kanchan Chauhan1605ff02016-07-04 14:28:09 +0530165 },
Vishal Dhayagudeedb27492017-07-25 10:53:12 +0530166 {"from_route": "/boms", "to_route": "BOM"},
167 {"from_route": "/timesheets", "to_route": "Timesheet"},
Doridel Cahanap2b14d6a2018-11-13 14:37:16 +0800168 {"from_route": "/material-requests", "to_route": "Material Request"},
Ankush Menat494bd9e2022-03-28 18:52:46 +0530169 {
170 "from_route": "/material-requests/<path:name>",
171 "to_route": "material_request_info",
Doridel Cahanap2b14d6a2018-11-13 14:37:16 +0800172 "defaults": {
173 "doctype": "Material Request",
Ankush Menat494bd9e2022-03-28 18:52:46 +0530174 "parents": [{"label": _("Material Request"), "route": "material-requests"}],
175 },
Doridel Cahanap2b14d6a2018-11-13 14:37:16 +0800176 },
Ankush Menat494bd9e2022-03-28 18:52:46 +0530177 {"from_route": "/project", "to_route": "Project"},
Anand Doshif9fc04c2015-02-23 22:14:12 +0530178]
179
Rushabh Mehtab9cdb052017-03-08 12:33:43 +0530180standard_portal_menu_items = [
Rushabh Mehta0c76f212016-04-01 11:53:50 +0530181 {"title": _("Projects"), "route": "/project", "reference_doctype": "Project"},
Ankush Menat494bd9e2022-03-28 18:52:46 +0530182 {
183 "title": _("Request for Quotations"),
184 "route": "/rfq",
185 "reference_doctype": "Request for Quotation",
186 "role": "Supplier",
187 },
188 {
189 "title": _("Supplier Quotation"),
190 "route": "/supplier-quotations",
191 "reference_doctype": "Supplier Quotation",
192 "role": "Supplier",
193 },
194 {
195 "title": _("Purchase Orders"),
196 "route": "/purchase-orders",
197 "reference_doctype": "Purchase Order",
198 "role": "Supplier",
199 },
200 {
201 "title": _("Purchase Invoices"),
202 "route": "/purchase-invoices",
203 "reference_doctype": "Purchase Invoice",
204 "role": "Supplier",
205 },
206 {
207 "title": _("Quotations"),
208 "route": "/quotations",
209 "reference_doctype": "Quotation",
210 "role": "Customer",
211 },
212 {
213 "title": _("Orders"),
214 "route": "/orders",
215 "reference_doctype": "Sales Order",
216 "role": "Customer",
217 },
218 {
219 "title": _("Invoices"),
220 "route": "/invoices",
221 "reference_doctype": "Sales Invoice",
222 "role": "Customer",
223 },
224 {
225 "title": _("Shipments"),
226 "route": "/shipments",
227 "reference_doctype": "Delivery Note",
228 "role": "Customer",
229 },
230 {"title": _("Issues"), "route": "/issues", "reference_doctype": "Issue", "role": "Customer"},
Neil Trini Lasrado3f0a5812016-07-19 14:17:33 +0530231 {"title": _("Addresses"), "route": "/addresses", "reference_doctype": "Address"},
Ankush Menat494bd9e2022-03-28 18:52:46 +0530232 {
233 "title": _("Timesheets"),
234 "route": "/timesheets",
235 "reference_doctype": "Timesheet",
236 "role": "Customer",
237 },
Manas Solanki05180012017-10-05 14:31:31 +0530238 {"title": _("Newsletter"), "route": "/newsletters", "reference_doctype": "Newsletter"},
Ankush Menat494bd9e2022-03-28 18:52:46 +0530239 {
Ankush Menat494bd9e2022-03-28 18:52:46 +0530240 "title": _("Material Request"),
241 "route": "/material-requests",
242 "reference_doctype": "Material Request",
243 "role": "Customer",
244 },
0Pranav5f5c7252019-12-18 16:21:50 +0530245 {"title": _("Appointment Booking"), "route": "/book_appointment"},
Rushabh Mehtafc800b32016-09-23 21:51:51 +0530246]
247
248default_roles = [
Ankush Menat494bd9e2022-03-28 18:52:46 +0530249 {"role": "Customer", "doctype": "Contact", "email_field": "email_id"},
250 {"role": "Supplier", "doctype": "Contact", "email_field": "email_id"},
Rushabh Mehtac78b3112016-03-30 12:29:48 +0530251]
252
Suraj Shettyf1ffdb32019-06-07 12:48:13 +0530253sounds = [
254 {"name": "incoming-call", "src": "/assets/erpnext/sounds/incoming-call.mp3", "volume": 0.2},
255 {"name": "call-disconnect", "src": "/assets/erpnext/sounds/call-disconnect.mp3", "volume": 0.2},
256]
257
Rucha Mahabal85b18e22022-06-10 16:26:07 +0530258has_upload_permission = {
259 "Employee": "employee.setup.doctype.employee.employee.has_upload_permission"
260}
shariquerik19893752021-03-26 16:34:22 +0530261
Anand Doshif9fc04c2015-02-23 22:14:12 +0530262has_website_permission = {
263 "Sales Order": "erpnext.controllers.website_list_for_contact.has_website_permission",
Makarand Bauskar9306aff2017-07-21 15:19:47 +0530264 "Quotation": "erpnext.controllers.website_list_for_contact.has_website_permission",
Anand Doshif9fc04c2015-02-23 22:14:12 +0530265 "Sales Invoice": "erpnext.controllers.website_list_for_contact.has_website_permission",
Rohit Waghchaure21499e82016-09-21 16:49:58 +0530266 "Supplier Quotation": "erpnext.controllers.website_list_for_contact.has_website_permission",
Faris Ansari38ac7f72019-10-09 11:41:33 +0530267 "Purchase Order": "erpnext.controllers.website_list_for_contact.has_website_permission",
268 "Purchase Invoice": "erpnext.controllers.website_list_for_contact.has_website_permission",
Doridel Cahanap2b14d6a2018-11-13 14:37:16 +0800269 "Material Request": "erpnext.controllers.website_list_for_contact.has_website_permission",
Rushabh Mehtaa33d4682015-06-01 17:15:42 +0530270 "Delivery Note": "erpnext.controllers.website_list_for_contact.has_website_permission",
Vishal Dhayagudeedb27492017-07-25 10:53:12 +0530271 "Issue": "erpnext.support.doctype.issue.issue.has_website_permission",
Rushabh Mehtaf0569742017-09-13 12:52:30 +0530272 "Timesheet": "erpnext.controllers.website_list_for_contact.has_website_permission",
Anand Doshif9fc04c2015-02-23 22:14:12 +0530273}
Rushabh Mehta3daa49a2014-10-21 16:16:30 +0530274
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +0530275dump_report_map = "erpnext.startup.report_data_map.data_map"
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +0530276
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +0530277before_tests = "erpnext.setup.utils.before_tests"
278
Rushabh Mehta308e6ea2015-03-24 17:34:58 +0530279standard_queries = {
Jamsheerc0097ad2018-11-23 11:37:58 +0530280 "Customer": "erpnext.selling.doctype.customer.customer.get_customer_list",
Rushabh Mehta308e6ea2015-03-24 17:34:58 +0530281}
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +0530282
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +0530283doc_events = {
Rucha Mahabalc91e03c2020-11-28 20:24:06 +0530284 "*": {
Himanshuec25d592021-06-14 19:05:52 +0530285 "validate": "erpnext.support.doctype.service_level_agreement.service_level_agreement.apply",
Rucha Mahabalc91e03c2020-11-28 20:24:06 +0530286 },
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +0530287 "Stock Entry": {
Nabin Hait4acd4312014-11-04 15:32:31 +0530288 "on_submit": "erpnext.stock.doctype.material_request.material_request.update_completed_and_requested_qty",
Ankush Menat494bd9e2022-03-28 18:52:46 +0530289 "on_cancel": "erpnext.stock.doctype.material_request.material_request.update_completed_and_requested_qty",
Anand Doshi648062d2014-05-05 16:46:14 +0530290 },
291 "User": {
KanchanChauhan1dc26b12017-06-13 15:26:35 +0530292 "after_insert": "frappe.contacts.doctype.contact.contact.update_contact",
Rucha Mahabal512c82f2022-06-10 15:06:54 +0530293 "validate": "employee.setup.doctype.employee.employee.validate_employee_role",
Ankush Menat494bd9e2022-03-28 18:52:46 +0530294 "on_update": [
Rucha Mahabal512c82f2022-06-10 15:06:54 +0530295 "employee.setup.doctype.employee.employee.update_user_permissions",
Ankush Menat494bd9e2022-03-28 18:52:46 +0530296 "erpnext.portal.utils.set_default_role",
297 ],
Rushabh Mehta3daa49a2014-10-21 16:16:30 +0530298 },
Himanshuec25d592021-06-14 19:05:52 +0530299 "Communication": {
Ganga Manojf4fc1382021-07-14 11:43:10 +0530300 "on_update": [
Saqib Ansaric1d88772021-12-06 14:34:59 +0530301 "erpnext.support.doctype.service_level_agreement.service_level_agreement.on_communication_update",
Ankush Menat494bd9e2022-03-28 18:52:46 +0530302 "erpnext.support.doctype.issue.issue.set_first_response_time",
Ganga Manojf4fc1382021-07-14 11:43:10 +0530303 ]
Himanshuec25d592021-06-14 19:05:52 +0530304 },
marination45617ae2021-08-19 17:40:00 +0530305 "Sales Taxes and Charges Template": {
marinationeef9cf12021-02-16 18:45:36 +0530306 "on_update": "erpnext.e_commerce.doctype.e_commerce_settings.e_commerce_settings.validate_cart_settings"
Saurabhe4e89542016-07-21 20:26:46 +0530307 },
Ankush Menat494bd9e2022-03-28 18:52:46 +0530308 "Tax Category": {"validate": "erpnext.regional.india.utils.validate_tax_category"},
Charles-Henri Decultotb8c088e2018-02-21 06:37:33 +0100309 "Sales Invoice": {
vishdhad3ec1c12020-03-24 11:31:41 +0530310 "on_submit": [
311 "erpnext.regional.create_transaction_log",
312 "erpnext.regional.italy.utils.sales_invoice_on_submit",
Mohammed Redah9d319c22021-11-19 15:13:23 +0300313 "erpnext.regional.saudi_arabia.utils.create_qr_code",
Ankush Menat494bd9e2022-03-28 18:52:46 +0530314 "erpnext.erpnext_integrations.taxjar_integration.create_transaction",
vishdhad3ec1c12020-03-24 11:31:41 +0530315 ],
316 "on_cancel": [
317 "erpnext.regional.italy.utils.sales_invoice_on_cancel",
Deepesh Garg43820402021-11-29 18:25:47 +0530318 "erpnext.erpnext_integrations.taxjar_integration.delete_transaction",
Ankush Menat494bd9e2022-03-28 18:52:46 +0530319 "erpnext.regional.saudi_arabia.utils.delete_qr_code_file",
Ahmad940db712021-09-17 01:14:41 +0500320 ],
Deepesh Garg43820402021-11-29 18:25:47 +0530321 "on_trash": "erpnext.regional.check_deletion_permission",
Ankush Menat76c85212021-04-07 16:09:58 +0530322 "validate": [
Deepesh Gargc36e48a2021-04-12 10:55:43 +0530323 "erpnext.regional.india.utils.validate_document_name",
Ankush Menat494bd9e2022-03-28 18:52:46 +0530324 "erpnext.regional.india.utils.update_taxable_values",
Deepesh Garg48175212022-05-13 18:08:32 +0530325 "erpnext.regional.india.utils.validate_sez_and_export_invoices",
Ankush Menat494bd9e2022-03-28 18:52:46 +0530326 ],
Charles-Henri Decultotb8c088e2018-02-21 06:37:33 +0100327 },
Ankush Menat494bd9e2022-03-28 18:52:46 +0530328 "POS Invoice": {"on_submit": ["erpnext.regional.saudi_arabia.utils.create_qr_code"]},
Deepesh Garg24f9a802020-06-03 10:59:37 +0530329 "Purchase Invoice": {
hasnain28087b7a8e12020-09-09 20:54:30 +0530330 "validate": [
Deepesh Garg55fe85d2021-05-14 12:17:41 +0530331 "erpnext.regional.india.utils.validate_reverse_charge_transaction",
332 "erpnext.regional.india.utils.update_itc_availed_fields",
hasnain28087b7a8e12020-09-09 20:54:30 +0530333 "erpnext.regional.united_arab_emirates.utils.update_grand_total_for_rcm",
Deepesh Garg55fe85d2021-05-14 12:17:41 +0530334 "erpnext.regional.united_arab_emirates.utils.validate_returns",
Ankush Menat494bd9e2022-03-28 18:52:46 +0530335 "erpnext.regional.india.utils.update_taxable_values",
Deepesh Garg55fe85d2021-05-14 12:17:41 +0530336 ]
Deepesh Garg24f9a802020-06-03 10:59:37 +0530337 },
Saurabhe4e89542016-07-21 20:26:46 +0530338 "Payment Entry": {
Deepesh Garg8b644d82021-07-15 15:36:54 +0530339 "validate": "erpnext.regional.india.utils.update_place_of_supply",
Ankush Menat494bd9e2022-03-28 18:52:46 +0530340 "on_submit": [
341 "erpnext.regional.create_transaction_log",
342 "erpnext.accounts.doctype.payment_request.payment_request.update_payment_req_status",
343 "erpnext.accounts.doctype.dunning.dunning.resolve_dunning",
344 ],
345 "on_trash": "erpnext.regional.check_deletion_permission",
Rushabh Mehtab3c8f442017-06-21 17:22:38 +0530346 },
Ankush Menat494bd9e2022-03-28 18:52:46 +0530347 "Address": {
348 "validate": [
349 "erpnext.regional.india.utils.validate_gstin_for_india",
350 "erpnext.regional.italy.utils.set_state_code",
351 "erpnext.regional.india.utils.update_gst_category",
Rucha Mahabal212eb4b2021-08-30 13:10:18 +0530352 ],
Nabin Hait619c42b2018-01-10 17:48:03 +0530353 },
Ankush Menat494bd9e2022-03-28 18:52:46 +0530354 "Supplier": {"validate": "erpnext.regional.india.utils.validate_pan_for_india"},
355 (
356 "Sales Invoice",
357 "Sales Order",
358 "Delivery Note",
359 "Purchase Invoice",
360 "Purchase Order",
361 "Purchase Receipt",
362 ): {"validate": ["erpnext.regional.india.utils.set_place_of_supply"]},
Suraj Shettyd4edd282019-08-09 19:23:04 +0530363 "Contact": {
364 "on_trash": "erpnext.support.doctype.issue.issue.update_issue",
leela3234df52021-01-12 23:31:40 +0530365 "after_insert": "erpnext.telephony.doctype.call_log.call_log.link_existing_conversations",
Ankush Menat494bd9e2022-03-28 18:52:46 +0530366 "validate": ["erpnext.crm.utils.update_lead_phone_numbers"],
Suraj Shettyd4edd282019-08-09 19:23:04 +0530367 },
Rucha Mahabal9e35bff2019-07-12 13:56:36 +0530368 "Email Unsubscribe": {
369 "after_insert": "erpnext.crm.doctype.email_campaign.email_campaign.unsubscribe_recipient"
vishdhad3ec1c12020-03-24 11:31:41 +0530370 },
Ankush Menat494bd9e2022-03-28 18:52:46 +0530371 ("Quotation", "Sales Order", "Sales Invoice"): {
372 "validate": ["erpnext.erpnext_integrations.taxjar_integration.set_sales_tax"]
Deepesh Garg2b2572b2021-08-20 14:40:12 +0530373 },
374 "Company": {
Ankush Menat494bd9e2022-03-28 18:52:46 +0530375 "on_trash": [
376 "erpnext.regional.india.utils.delete_gst_settings_for_company",
377 "erpnext.regional.saudi_arabia.utils.delete_vat_settings_for_company",
378 ]
Subin Tom798b4642021-09-03 12:30:57 +0530379 },
380 "Integration Request": {
381 "validate": "erpnext.accounts.doctype.payment_request.payment_request.validate_payment"
Ankush Menat494bd9e2022-03-28 18:52:46 +0530382 },
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +0530383}
384
vishaldcef7982020-01-13 12:59:52 +0530385# On cancel event Payment Entry will be exempted and all linked submittable doctype will get cancelled.
386# to maintain data integrity we exempted payment entry. it will un-link when sales invoice get cancelled.
387# if payment entry not in auto cancel exempted doctypes it will cancel payment entry.
Ankush Menat494bd9e2022-03-28 18:52:46 +0530388auto_cancel_exempted_doctypes = [
Rucha Mahabal4887b692020-10-23 20:33:30 +0530389 "Payment Entry",
vishaldcef7982020-01-13 12:59:52 +0530390]
vishal70148a62019-12-02 17:37:46 +0530391
Rohit Waghchaurea8f78fa2021-04-13 18:43:57 +0530392after_migrate = ["erpnext.setup.install.update_select_perm_after_install"]
393
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +0530394scheduler_events = {
marination06ee0ea2020-09-07 18:49:06 +0530395 "cron": {
396 "0/30 * * * *": [
Gavin D'souza71ac3992020-09-10 13:57:44 +0530397 "erpnext.utilities.doctype.video.video.update_youtube_data",
marination06ee0ea2020-09-07 18:49:06 +0530398 ]
399 },
Rohit Waghchaure425dff92019-01-17 12:49:45 +0530400 "all": [
Rucha Mahabal5100e112020-02-24 22:08:45 +0530401 "erpnext.projects.doctype.project.project.project_status_update_reminder",
mergify[bot]b9942ad2021-10-01 13:15:40 +0530402 "erpnext.hr.doctype.interview.interview.send_interview_reminder",
Ankush Menat494bd9e2022-03-28 18:52:46 +0530403 "erpnext.crm.doctype.social_media_post.social_media_post.process_scheduled_social_media_posts",
Rohit Waghchaure425dff92019-01-17 12:49:45 +0530404 ],
Nabin Hait75807232015-07-02 14:41:27 +0530405 "hourly": [
Ankush Menat494bd9e2022-03-28 18:52:46 +0530406 "erpnext.hr.doctype.daily_work_summary_group.daily_work_summary_group.trigger_emails",
Pawan Mehta6010a102018-09-05 17:16:57 +0530407 "erpnext.accounts.doctype.subscription.subscription.process_all",
Aditya Hase7bc692d2019-01-07 19:01:47 +0530408 "erpnext.accounts.doctype.gl_entry.gl_entry.rename_gle_sle_docs",
Nabin Hait34c551d2019-07-03 10:34:31 +0530409 "erpnext.erpnext_integrations.doctype.plaid_settings.plaid_settings.automatic_synchronization",
Rohit Waghchaure425dff92019-01-17 12:49:45 +0530410 "erpnext.projects.doctype.project.project.hourly_reminder",
Himanshu Warekar6e6148b2019-05-10 23:49:42 +0530411 "erpnext.projects.doctype.project.project.collect_project_status",
Ankush Menat494bd9e2022-03-28 18:52:46 +0530412 "erpnext.hr.doctype.shift_type.shift_type.process_auto_attendance_for_all_shifts",
Rohit Waghchaureb103b242021-05-27 17:05:36 +0530413 ],
414 "hourly_long": [
Mohammed Yusuf Shaikha3e69cf2022-02-08 01:00:37 +0530415 "erpnext.stock.doctype.repost_item_valuation.repost_item_valuation.repost_entries",
Ankush Menat494bd9e2022-03-28 18:52:46 +0530416 "erpnext.bulk_transaction.doctype.bulk_transaction_log.bulk_transaction_log.retry_failing_transaction",
Nabin Hait75807232015-07-02 14:41:27 +0530417 ],
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +0530418 "daily": [
Rushabh Mehtaf8509872014-10-08 12:03:19 +0530419 "erpnext.stock.reorder_item.reorder_item",
Nabin Hait606af962014-12-15 11:57:03 +0530420 "erpnext.support.doctype.issue.issue.auto_close_tickets",
mbauskare1e25a02017-02-16 19:36:59 +0530421 "erpnext.crm.doctype.opportunity.opportunity.auto_close_opportunity",
Rohit Waghchaure2f1db572016-11-08 12:39:33 +0530422 "erpnext.controllers.accounts_controller.update_invoice_status",
Rushabh Mehta5bceebc2015-01-23 15:22:13 +0530423 "erpnext.accounts.doctype.fiscal_year.fiscal_year.auto_create_fiscal_year",
Nabin Hait4fdb0522016-03-09 12:40:56 +0530424 "erpnext.projects.doctype.task.task.set_tasks_as_overdue",
Kanchan Chauhane58a41a2017-10-17 15:17:24 +0530425 "erpnext.assets.doctype.asset.depreciation.post_depreciation_entries",
Suraj Shettyd3069fe2018-02-21 15:15:43 +0530426 "erpnext.hr.doctype.daily_work_summary_group.daily_work_summary_group.send_summary",
Prateeksha Singhe012e242017-07-18 10:35:12 +0530427 "erpnext.stock.doctype.serial_no.serial_no.update_maintenance_status",
bcornwellmott96381da2017-07-24 10:12:30 -0700428 "erpnext.buying.doctype.supplier_scorecard.supplier_scorecard.refresh_scorecards",
Nabin Haitadbf8ad2017-07-31 20:45:36 +0530429 "erpnext.setup.doctype.company.company.cache_companies_monthly_sales_history",
Manas Solanki2f4e5ee2018-05-15 15:25:14 +0530430 "erpnext.assets.doctype.asset.asset.update_maintenance_status",
Rohan Bansalbf0f0aa2018-05-23 15:06:45 +0530431 "erpnext.assets.doctype.asset.asset.make_post_gl_entry",
Himanshu Mishra7aabef22018-06-28 23:43:23 +0530432 "erpnext.crm.doctype.contract.contract.update_status_for_contracts",
Himanshu0209ef02018-12-25 17:42:31 +0530433 "erpnext.projects.doctype.project.project.update_project_sales_billing",
Sagar Vora4d1a9b12019-01-22 15:56:39 +0530434 "erpnext.projects.doctype.project.project.send_project_status_email_to_users",
Himanshuf3e52132019-03-19 16:47:56 +0530435 "erpnext.quality_management.doctype.quality_review.quality_review.review",
Himanshu Warekarcf37e402019-05-07 10:27:01 +0530436 "erpnext.support.doctype.service_level_agreement.service_level_agreement.check_agreement_status",
Rucha Mahabalb54459e2019-07-22 03:23:40 +0530437 "erpnext.crm.doctype.email_campaign.email_campaign.send_email_to_leads_or_contacts",
0Pranav53b65ab2019-11-15 16:42:32 +0530438 "erpnext.crm.doctype.email_campaign.email_campaign.set_email_campaign_status",
marination81798042020-04-14 23:05:11 +0530439 "erpnext.selling.doctype.quotation.quotation.set_expired_status",
Abhishek Balamee5b9c72020-08-11 16:23:47 +0530440 "erpnext.buying.doctype.supplier_quotation.supplier_quotation.set_expired_status",
Rucha Mahabalf1cca592021-01-21 16:36:15 +0530441 "erpnext.accounts.doctype.process_statement_of_accounts.process_statement_of_accounts.send_auto_email",
Ankush Menat494bd9e2022-03-28 18:52:46 +0530442 "erpnext.hr.doctype.interview.interview.send_daily_feedback_reminder",
KanchanChauhan73bd3cb2018-09-05 11:01:35 +0530443 ],
444 "daily_long": [
Gavin D'souzad38f5372019-10-30 14:43:58 +0530445 "erpnext.setup.doctype.email_digest.email_digest.send",
marination4283a132022-03-16 19:45:03 +0530446 "erpnext.manufacturing.doctype.bom_update_tool.bom_update_tool.auto_update_latest_price_in_all_boms",
Mangesh-Khairnarf281f002019-08-05 14:47:02 +0530447 "erpnext.hr.doctype.leave_ledger_entry.leave_ledger_entry.process_expired_allocation",
Deepesh Gargd1d0a502020-02-26 10:44:24 +0530448 "erpnext.hr.utils.generate_leave_encashment",
Anurag Mishra755b7732020-11-25 16:05:17 +0530449 "erpnext.hr.utils.allocate_earned_leaves",
Afshan5d66a2b2021-03-12 15:51:34 +0530450 "erpnext.loan_management.doctype.process_loan_security_shortfall.process_loan_security_shortfall.create_process_loan_security_shortfall",
451 "erpnext.loan_management.doctype.process_loan_interest_accrual.process_loan_interest_accrual.process_loan_interest_accrual_for_term_loans",
Ankush Menat494bd9e2022-03-28 18:52:46 +0530452 "erpnext.crm.doctype.lead.lead.daily_open_lead",
KanchanChauhan73bd3cb2018-09-05 11:01:35 +0530453 ],
Nabin Haitb9b2a062019-05-01 12:49:44 +0530454 "monthly_long": [
Deepesh Gargde03d2c2020-06-01 11:30:34 +0530455 "erpnext.accounts.deferred_revenue.process_deferred_accounting",
Ankush Menat494bd9e2022-03-28 18:52:46 +0530456 "erpnext.loan_management.doctype.process_loan_interest_accrual.process_loan_interest_accrual.process_loan_interest_accrual_for_demand_loans",
457 ],
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +0530458}
Anand Doshi7f41ff22014-06-26 12:02:55 +0530459
Faris Ansari2c5b3e82017-07-13 18:37:18 +0530460email_brand_image = "assets/erpnext/images/erpnext-logo.jpg"
461
Faris Ansari40d3ad22017-07-31 16:16:22 +0530462default_mail_footer = """
463 <span>
464 Sent via
465 <a class="text-muted" href="https://erpnext.com?source=via_email_footer" target="_blank">
466 ERPNext
467 </a>
468 </span>
469"""
Anand Doshic82331b2015-02-12 18:58:28 +0530470
471get_translated_dict = {
Anand Doshic82331b2015-02-12 18:58:28 +0530472 ("doctype", "Global Defaults"): "frappe.geo.country_info.get_translated_dict"
473}
Rushabh Mehtafe027b32016-03-28 13:21:43 +0530474
475bot_parsers = [
Ankush Menat494bd9e2022-03-28 18:52:46 +0530476 "erpnext.utilities.bot.FindItemBot",
Rushabh Mehta0c76f212016-04-01 11:53:50 +0530477]
Anand Doshif576f3b2016-06-25 19:51:48 +0530478
Ankush Menat494bd9e2022-03-28 18:52:46 +0530479get_site_info = "erpnext.utilities.get_site_info"
Saurabh94c666a2016-11-08 20:35:50 +0530480
Saurabh0d47d512017-03-14 14:46:05 +0530481payment_gateway_enabled = "erpnext.accounts.utils.create_payment_gateway_account"
Rushabh Mehta7231f292017-07-13 15:00:56 +0530482
Himanshub84333f2020-04-14 13:02:03 +0530483communication_doctypes = ["Customer", "Supplier"]
484
Ankush Menat494bd9e2022-03-28 18:52:46 +0530485accounting_dimension_doctypes = [
486 "GL Entry",
ruthra kumar7b1cb672022-05-16 14:32:58 +0530487 "Payment Ledger Entry",
Ankush Menat494bd9e2022-03-28 18:52:46 +0530488 "Sales Invoice",
489 "Purchase Invoice",
490 "Payment Entry",
491 "Asset",
492 "Expense Claim",
493 "Expense Claim Detail",
494 "Expense Taxes and Charges",
495 "Stock Entry",
496 "Budget",
497 "Payroll Entry",
498 "Delivery Note",
499 "Sales Invoice Item",
500 "Purchase Invoice Item",
501 "Purchase Order Item",
502 "Journal Entry Account",
503 "Material Request Item",
504 "Delivery Note Item",
505 "Purchase Receipt Item",
506 "Stock Entry Detail",
507 "Payment Entry Deduction",
508 "Sales Taxes and Charges",
509 "Purchase Taxes and Charges",
510 "Shipping Rule",
511 "Landed Cost Item",
512 "Asset Value Adjustment",
513 "Loyalty Program",
Ankush Menat494bd9e2022-03-28 18:52:46 +0530514 "Stock Reconciliation",
515 "Travel Request",
Ankush Menat494bd9e2022-03-28 18:52:46 +0530516 "POS Profile",
517 "Opening Invoice Creation Tool",
518 "Opening Invoice Creation Tool Item",
519 "Subscription",
520 "Subscription Plan",
521 "POS Invoice",
522 "POS Invoice Item",
Deepesh Garg82a06352022-04-26 14:01:13 +0530523 "Purchase Order",
524 "Purchase Receipt",
525 "Sales Order",
Glen Whitneydea6a902020-11-17 22:16:13 +0000526]
527
Rushabh Mehta7231f292017-07-13 15:00:56 +0530528regional_overrides = {
Ankush Menat494bd9e2022-03-28 18:52:46 +0530529 "France": {
530 "erpnext.tests.test_regional.test_method": "erpnext.regional.france.utils.test_method"
Charles-Henri Decultotb8c088e2018-02-21 06:37:33 +0100531 },
Ankush Menat494bd9e2022-03-28 18:52:46 +0530532 "India": {
533 "erpnext.tests.test_regional.test_method": "erpnext.regional.india.utils.test_method",
534 "erpnext.controllers.taxes_and_totals.get_itemised_tax_breakup_header": "erpnext.regional.india.utils.get_itemised_tax_breakup_header",
535 "erpnext.controllers.taxes_and_totals.get_itemised_tax_breakup_data": "erpnext.regional.india.utils.get_itemised_tax_breakup_data",
536 "erpnext.accounts.party.get_regional_address_details": "erpnext.regional.india.utils.get_regional_address_details",
537 "erpnext.controllers.taxes_and_totals.get_regional_round_off_accounts": "erpnext.regional.india.utils.get_regional_round_off_accounts",
538 "erpnext.hr.utils.calculate_annual_eligible_hra_exemption": "erpnext.regional.india.utils.calculate_annual_eligible_hra_exemption",
539 "erpnext.hr.utils.calculate_hra_exemption_for_period": "erpnext.regional.india.utils.calculate_hra_exemption_for_period",
540 "erpnext.controllers.accounts_controller.validate_einvoice_fields": "erpnext.regional.india.e_invoice.utils.validate_einvoice_fields",
541 "erpnext.assets.doctype.asset.asset.get_depreciation_amount": "erpnext.regional.india.utils.get_depreciation_amount",
542 "erpnext.stock.doctype.item.item.set_item_tax_from_hsn_code": "erpnext.regional.india.utils.set_item_tax_from_hsn_code",
rohitwaghchaured4526682017-12-28 14:20:13 +0530543 },
Ankush Menat494bd9e2022-03-28 18:52:46 +0530544 "United Arab Emirates": {
545 "erpnext.controllers.taxes_and_totals.update_itemised_tax_data": "erpnext.regional.united_arab_emirates.utils.update_itemised_tax_data",
546 "erpnext.accounts.doctype.purchase_invoice.purchase_invoice.make_regional_gl_entries": "erpnext.regional.united_arab_emirates.utils.make_regional_gl_entries",
rohitwaghchaured4526682017-12-28 14:20:13 +0530547 },
Ankush Menat494bd9e2022-03-28 18:52:46 +0530548 "Saudi Arabia": {
549 "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 +0530550 },
Ankush Menat494bd9e2022-03-28 18:52:46 +0530551 "Italy": {
552 "erpnext.controllers.taxes_and_totals.update_itemised_tax_data": "erpnext.regional.italy.utils.update_itemised_tax_data",
553 "erpnext.controllers.accounts_controller.validate_regional": "erpnext.regional.italy.utils.sales_invoice_validate",
554 },
Manas Solanki2f4e5ee2018-05-15 15:25:14 +0530555}
Mangesh-Khairnar2ffa87e2019-03-20 13:25:48 +0530556user_privacy_documents = [
557 {
Ankush Menat494bd9e2022-03-28 18:52:46 +0530558 "doctype": "Lead",
559 "match_field": "email_id",
560 "personal_fields": ["phone", "mobile_no", "fax", "website", "lead_name"],
Mangesh-Khairnar2ffa87e2019-03-20 13:25:48 +0530561 },
562 {
Ankush Menat494bd9e2022-03-28 18:52:46 +0530563 "doctype": "Opportunity",
564 "match_field": "contact_email",
565 "personal_fields": ["contact_mobile", "contact_display", "customer_name"],
566 },
John Clarkeb7339842019-04-04 23:32:25 -0600567]
Himanshu83b0b2a2019-09-27 00:59:48 +0530568
Himanshu Warekar21abc3a2019-09-30 13:40:02 +0530569# ERPNext doctypes for Global Search
Himanshu Warekar23c916c2019-10-02 16:32:53 +0530570global_search_doctypes = {
571 "Default": [
572 {"doctype": "Customer", "index": 0},
573 {"doctype": "Supplier", "index": 1},
574 {"doctype": "Item", "index": 2},
575 {"doctype": "Warehouse", "index": 3},
576 {"doctype": "Account", "index": 4},
577 {"doctype": "Employee", "index": 5},
578 {"doctype": "BOM", "index": 6},
579 {"doctype": "Sales Invoice", "index": 7},
580 {"doctype": "Sales Order", "index": 8},
581 {"doctype": "Quotation", "index": 9},
582 {"doctype": "Work Order", "index": 10},
Walstan Baptista0baebbd2020-12-08 09:43:29 +0530583 {"doctype": "Purchase Order", "index": 11},
584 {"doctype": "Purchase Receipt", "index": 12},
585 {"doctype": "Purchase Invoice", "index": 13},
586 {"doctype": "Delivery Note", "index": 14},
587 {"doctype": "Stock Entry", "index": 15},
588 {"doctype": "Material Request", "index": 16},
589 {"doctype": "Delivery Trip", "index": 17},
590 {"doctype": "Pick List", "index": 18},
Walstan Baptista0baebbd2020-12-08 09:43:29 +0530591 {"doctype": "Payment Entry", "index": 22},
592 {"doctype": "Lead", "index": 23},
593 {"doctype": "Opportunity", "index": 24},
594 {"doctype": "Item Price", "index": 25},
595 {"doctype": "Purchase Taxes and Charges Template", "index": 26},
596 {"doctype": "Sales Taxes and Charges", "index": 27},
597 {"doctype": "Asset", "index": 28},
598 {"doctype": "Project", "index": 29},
599 {"doctype": "Task", "index": 30},
600 {"doctype": "Timesheet", "index": 31},
601 {"doctype": "Issue", "index": 32},
602 {"doctype": "Serial No", "index": 33},
603 {"doctype": "Batch", "index": 34},
604 {"doctype": "Branch", "index": 35},
605 {"doctype": "Department", "index": 36},
Walstan Baptista0baebbd2020-12-08 09:43:29 +0530606 {"doctype": "Designation", "index": 38},
Walstan Baptista0baebbd2020-12-08 09:43:29 +0530607 {"doctype": "Loan", "index": 44},
608 {"doctype": "Maintenance Schedule", "index": 45},
609 {"doctype": "Maintenance Visit", "index": 46},
610 {"doctype": "Warranty Claim", "index": 47},
Himanshu Warekar23c916c2019-10-02 16:32:53 +0530611 ],
Faris Ansari22bcad92020-10-16 15:28:12 +0530612}
leela3234df52021-01-12 23:31:40 +0530613
614additional_timeline_content = {
Ankush Menat494bd9e2022-03-28 18:52:46 +0530615 "*": ["erpnext.telephony.doctype.call_log.call_log.get_linked_call_logs"]
leela3234df52021-01-12 23:31:40 +0530616}