blob: ec93f626e372c0aa68a931de53f5ceb860f57cfc [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 _
Anand Doshi227b2382016-06-09 16:29:12 +05303from . import __version__ as app_version
Rushabh Mehta156ce602015-09-11 18:49:59 +05304
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +05305app_name = "erpnext"
6app_title = "ERPNext"
Rushabh Mehtaba02ce62015-07-22 15:07:25 +05307app_publisher = "Frappe Technologies Pvt. Ltd."
Rushabh Mehtaedc8ab02015-11-18 16:48:19 +05308app_description = """ERP made simple"""
Rushabh Mehta2167ff52016-12-07 11:08:48 +05309app_icon = "fa fa-th"
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +053010app_color = "#e74c3c"
Nabin Hait7ba4d022015-11-05 16:55:10 +053011app_email = "info@erpnext.com"
12app_license = "GNU General Public License (v3)"
Rushabh Mehta7d23e422015-11-02 10:45:18 +053013source_link = "https://github.com/frappe/erpnext"
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +053014
Faris Ansari1c09a992017-05-04 12:12:14 +053015develop_version = '8.x.x-beta'
Rushabh Mehtadb206f22017-03-10 09:38:58 +053016
Anand Doshi0c3bb752014-07-09 12:59:56 +053017error_report_email = "support@erpnext.com"
18
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +053019app_include_js = "assets/js/erpnext.min.js"
20app_include_css = "assets/css/erpnext.css"
21web_include_js = "assets/js/erpnext-web.min.js"
Anand Doshida858cc2015-02-24 17:50:44 +053022web_include_css = "assets/erpnext/css/website.css"
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +053023
mbauskarf54b1042017-03-13 16:32:46 +053024doctype_js = {
25 "Communication": "public/js/communication.js",
26}
27
Rushabh Mehta37b4d752015-11-09 16:53:11 +053028# setup wizard
29setup_wizard_requires = "assets/erpnext/js/setup_wizard.js"
30setup_wizard_complete = "erpnext.setup.setup_wizard.setup_wizard.setup_complete"
31
Rushabh Mehtad55bdcf2015-12-31 11:12:48 +053032before_install = "erpnext.setup.install.check_setup_wizard_not_completed"
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +053033after_install = "erpnext.setup.install.after_install"
34
35boot_session = "erpnext.startup.boot.boot_session"
36notification_config = "erpnext.startup.notifications.get_notification_config"
Rushabh Mehta05ce7ec2017-02-22 16:15:43 +053037get_help_messages = "erpnext.utilities.activation.get_help_messages"
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +053038
Rushabh Mehta3daa49a2014-10-21 16:16:30 +053039on_session_creation = "erpnext.shopping_cart.utils.set_cart_count"
40on_logout = "erpnext.shopping_cart.utils.clear_cart_count"
Anand Doshif9fc04c2015-02-23 22:14:12 +053041
Saurabh62124782016-06-30 13:33:49 +053042treeviews = ['Account', 'Cost Center', 'Warehouse', 'Item Group', 'Customer Group', 'Sales Person', 'Territory', "BOM"]
Rushabh Mehta764aa922016-05-02 13:28:46 +053043
Anand Doshif9fc04c2015-02-23 22:14:12 +053044# website
45update_website_context = "erpnext.shopping_cart.utils.update_website_context"
46my_account_context = "erpnext.shopping_cart.utils.update_my_account_context"
Rushabh Mehta621d6ea2015-07-08 12:39:27 +053047
Rushabh Mehta4c466872015-04-02 22:00:34 +053048email_append_to = ["Job Applicant", "Opportunity", "Issue"]
Anand Doshif9fc04c2015-02-23 22:14:12 +053049
Rohit Waghchaured6c986d2016-06-03 14:44:35 +053050calendars = ["Task", "Production Order", "Leave Application", "Sales Order", "Holiday List"]
Rushabh Mehta621d6ea2015-07-08 12:39:27 +053051
Kanchan Chauhan1f3d5b72016-03-01 11:33:49 +053052fixtures = ["Web Form"]
53
pratu16x7aad82572017-02-09 08:57:33 +053054website_generators = ["Item Group", "Item", "BOM", "Sales Partner", "Job Opening", "Student Admission"]
Rushabh Mehta621d6ea2015-07-08 12:39:27 +053055
Rushabh Mehta2e7c36e2015-04-16 12:41:42 +053056website_context = {
Rushabh Mehta5674c4f2015-04-16 15:09:42 +053057 "favicon": "/assets/erpnext/images/favicon.png",
Rushabh Mehtad40e6612017-01-10 14:46:45 +053058 "splash_image": "/assets/erpnext/images/erp-icon.svg"
Rushabh Mehta2e7c36e2015-04-16 12:41:42 +053059}
60
Anand Doshif9fc04c2015-02-23 22:14:12 +053061website_route_rules = [
62 {"from_route": "/orders", "to_route": "Sales Order"},
Rushabh Mehta156ce602015-09-11 18:49:59 +053063 {"from_route": "/orders/<path:name>", "to_route": "order",
64 "defaults": {
65 "doctype": "Sales Order",
66 "parents": [{"title": _("Orders"), "name": "orders"}]
67 }
68 },
Anand Doshif9fc04c2015-02-23 22:14:12 +053069 {"from_route": "/invoices", "to_route": "Sales Invoice"},
Rushabh Mehta156ce602015-09-11 18:49:59 +053070 {"from_route": "/invoices/<path:name>", "to_route": "order",
71 "defaults": {
72 "doctype": "Sales Invoice",
73 "parents": [{"title": _("Invoices"), "name": "invoices"}]
74 }
75 },
Rohit Waghchaure21499e82016-09-21 16:49:58 +053076 {"from_route": "/quotations", "to_route": "Supplier Quotation"},
77 {"from_route": "/quotations/<path:name>", "to_route": "order",
78 "defaults": {
79 "doctype": "Supplier Quotation",
80 "parents": [{"title": _("Supplier Quotation"), "name": "quotations"}]
81 }
82 },
Anand Doshif9fc04c2015-02-23 22:14:12 +053083 {"from_route": "/shipments", "to_route": "Delivery Note"},
Rushabh Mehta156ce602015-09-11 18:49:59 +053084 {"from_route": "/shipments/<path:name>", "to_route": "order",
85 "defaults": {
Anand Doshi4b127402015-11-26 18:22:03 +053086 "doctype": "Delivery Note",
Rushabh Mehta156ce602015-09-11 18:49:59 +053087 "parents": [{"title": _("Shipments"), "name": "shipments"}]
88 }
Kanchan Chauhan2e8cc892016-02-19 17:27:23 +053089 },
rohitwaghchaurea1064a62016-03-03 14:00:35 +053090 {"from_route": "/rfq", "to_route": "Request for Quotation"},
91 {"from_route": "/rfq/<path:name>", "to_route": "rfq",
92 "defaults": {
93 "doctype": "Request for Quotation",
94 "parents": [{"title": _("Request for Quotation"), "name": "rfq"}]
95 }
96 },
Kanchan Chauhan1605ff02016-07-04 14:28:09 +053097 {"from_route": "/addresses", "to_route": "Address"},
98 {"from_route": "/addresses/<path:name>", "to_route": "addresses",
99 "defaults": {
100 "doctype": "Address",
101 "parents": [{"title": _("Addresses"), "name": "addresses"}]
102 }
103 },
Kanchan Chauhan2e8cc892016-02-19 17:27:23 +0530104 {"from_route": "/jobs", "to_route": "Job Opening"},
Neil Trini Lasrado83d81202016-09-15 14:48:13 +0530105 {"from_route": "/admissions", "to_route": "Student Admission"},
pratu16x7dee36e12017-02-10 18:28:39 +0530106 {"from_route": "/boms", "to_route": "BOM"}
Anand Doshif9fc04c2015-02-23 22:14:12 +0530107]
108
Rushabh Mehtab9cdb052017-03-08 12:33:43 +0530109standard_portal_menu_items = [
Rushabh Mehta0c76f212016-04-01 11:53:50 +0530110 {"title": _("Projects"), "route": "/project", "reference_doctype": "Project"},
Rushabh Mehtafc800b32016-09-23 21:51:51 +0530111 {"title": _("Request for Quotations"), "route": "/rfq", "reference_doctype": "Request for Quotation", "role": "Supplier"},
112 {"title": _("Supplier Quotation"), "route": "/quotations", "reference_doctype": "Supplier Quotation", "role": "Supplier"},
113 {"title": _("Orders"), "route": "/orders", "reference_doctype": "Sales Order", "role":"Customer"},
114 {"title": _("Invoices"), "route": "/invoices", "reference_doctype": "Sales Invoice", "role":"Customer"},
115 {"title": _("Shipments"), "route": "/shipments", "reference_doctype": "Delivery Note", "role":"Customer"},
116 {"title": _("Issues"), "route": "/issues", "reference_doctype": "Issue", "role":"Customer"},
Neil Trini Lasrado3f0a5812016-07-19 14:17:33 +0530117 {"title": _("Addresses"), "route": "/addresses", "reference_doctype": "Address"},
Rushabh Mehtafc800b32016-09-23 21:51:51 +0530118 {"title": _("Fees"), "route": "/fees", "reference_doctype": "Fees", "role":"Student"}
119]
120
121default_roles = [
Rushabh Mehta95439db2017-01-14 00:25:22 +0530122 {'role': 'Customer', 'doctype':'Contact', 'email_field': 'email_id'},
123 {'role': 'Supplier', 'doctype':'Contact', 'email_field': 'email_id'},
Rushabh Mehtafc800b32016-09-23 21:51:51 +0530124 {'role': 'Student', 'doctype':'Student', 'email_field': 'student_email_id'}
Rushabh Mehtac78b3112016-03-30 12:29:48 +0530125]
126
Anand Doshif9fc04c2015-02-23 22:14:12 +0530127has_website_permission = {
128 "Sales Order": "erpnext.controllers.website_list_for_contact.has_website_permission",
129 "Sales Invoice": "erpnext.controllers.website_list_for_contact.has_website_permission",
Rohit Waghchaure21499e82016-09-21 16:49:58 +0530130 "Supplier Quotation": "erpnext.controllers.website_list_for_contact.has_website_permission",
Rushabh Mehtaa33d4682015-06-01 17:15:42 +0530131 "Delivery Note": "erpnext.controllers.website_list_for_contact.has_website_permission",
Rushabh Mehta4500f7b2017-01-30 17:04:38 +0530132 "Issue": "erpnext.support.doctype.issue.issue.has_website_permission"
Anand Doshif9fc04c2015-02-23 22:14:12 +0530133}
Rushabh Mehta3daa49a2014-10-21 16:16:30 +0530134
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +0530135dump_report_map = "erpnext.startup.report_data_map.data_map"
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +0530136
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +0530137before_tests = "erpnext.setup.utils.before_tests"
138
Rushabh Mehta308e6ea2015-03-24 17:34:58 +0530139standard_queries = {
140 "Customer": "erpnext.selling.doctype.customer.customer.get_customer_list"
141}
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +0530142
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +0530143doc_events = {
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +0530144 "Stock Entry": {
Nabin Hait4acd4312014-11-04 15:32:31 +0530145 "on_submit": "erpnext.stock.doctype.material_request.material_request.update_completed_and_requested_qty",
146 "on_cancel": "erpnext.stock.doctype.material_request.material_request.update_completed_and_requested_qty"
Anand Doshi648062d2014-05-05 16:46:14 +0530147 },
148 "User": {
KanchanChauhan1dc26b12017-06-13 15:26:35 +0530149 "after_insert": "frappe.contacts.doctype.contact.contact.update_contact",
Anand Doshi49856912014-05-28 18:49:13 +0530150 "validate": "erpnext.hr.doctype.employee.employee.validate_employee_role",
Rushabh Mehta0d6db6c2017-03-31 23:01:45 +0530151 "on_update": ["erpnext.hr.doctype.employee.employee.update_user_permissions",
152 "erpnext.portal.utils.set_default_role"]
Rushabh Mehta3daa49a2014-10-21 16:16:30 +0530153 },
Rushabh Mehtaf16f9c52016-04-08 17:20:50 +0530154 ("Sales Taxes and Charges Template", 'Price List'): {
Rushabh Mehta3daa49a2014-10-21 16:16:30 +0530155 "on_update": "erpnext.shopping_cart.doctype.shopping_cart_settings.shopping_cart_settings.validate_cart_settings"
156 },
Rushabh Mehtaf16f9c52016-04-08 17:20:50 +0530157
Anand Doshie3bd78e2016-04-22 18:53:21 +0530158 "Website Settings": {
159 "validate": "erpnext.portal.doctype.products_settings.products_settings.home_page_is_products"
Saurabhe4e89542016-07-21 20:26:46 +0530160 },
161 "Payment Entry": {
162 "on_submit": "erpnext.accounts.doctype.payment_request.payment_request.make_status_as_paid"
Rushabh Mehtab3c8f442017-06-21 17:22:38 +0530163 },
164 'Address': {
165 'validate': 'erpnext.regional.india.utils.validate_gstin_for_india'
Anand Doshie3bd78e2016-04-22 18:53:21 +0530166 }
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +0530167}
168
169scheduler_events = {
Nabin Hait75807232015-07-02 14:41:27 +0530170 "hourly": [
Rushabh Mehtafe816c32016-11-08 18:18:40 +0530171 "erpnext.controllers.recurring_document.create_recurring_documents",
172 'erpnext.hr.doctype.daily_work_summary_settings.daily_work_summary_settings.trigger_emails'
Nabin Hait75807232015-07-02 14:41:27 +0530173 ],
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +0530174 "daily": [
Rushabh Mehtaf8509872014-10-08 12:03:19 +0530175 "erpnext.stock.reorder_item.reorder_item",
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +0530176 "erpnext.setup.doctype.email_digest.email_digest.send",
Nabin Hait606af962014-12-15 11:57:03 +0530177 "erpnext.support.doctype.issue.issue.auto_close_tickets",
mbauskare1e25a02017-02-16 19:36:59 +0530178 "erpnext.crm.doctype.opportunity.opportunity.auto_close_opportunity",
Rohit Waghchaure2f1db572016-11-08 12:39:33 +0530179 "erpnext.controllers.accounts_controller.update_invoice_status",
Rushabh Mehta5bceebc2015-01-23 15:22:13 +0530180 "erpnext.accounts.doctype.fiscal_year.fiscal_year.auto_create_fiscal_year",
Rushabh Mehta13ec41a2015-12-10 12:31:36 +0530181 "erpnext.hr.doctype.employee.employee.send_birthday_reminders",
Nabin Hait4fdb0522016-03-09 12:40:56 +0530182 "erpnext.projects.doctype.task.task.set_tasks_as_overdue",
Rushabh Mehta9dd58d42016-11-18 12:39:24 +0530183 "erpnext.accounts.doctype.asset.depreciation.post_depreciation_entries",
Manas Solanki253c53c2017-05-30 15:35:58 +0530184 "erpnext.hr.doctype.daily_work_summary_settings.daily_work_summary_settings.send_summary",
185 "erpnext.stock.doctype.serial_no.serial_no.update_maintenance_status"
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +0530186 ]
187}
Anand Doshi7f41ff22014-06-26 12:02:55 +0530188
Anand Doshic5f919e2015-09-16 19:20:55 +0530189default_mail_footer = """<div style="text-align: center;">
Nabin Haitb3a142f2015-05-26 12:13:30 +0530190 <a href="https://erpnext.com?source=via_email_footer" target="_blank" style="color: #8d99a6;">
191 Sent via ERPNext
Anand Doshiadcf8572015-03-27 17:42:03 +0530192 </a>
193</div>"""
Anand Doshic82331b2015-02-12 18:58:28 +0530194
195get_translated_dict = {
Anand Doshic82331b2015-02-12 18:58:28 +0530196 ("doctype", "Global Defaults"): "frappe.geo.country_info.get_translated_dict"
197}
Rushabh Mehtafe027b32016-03-28 13:21:43 +0530198
199bot_parsers = [
200 'erpnext.utilities.bot.FindItemBot',
Rushabh Mehta0c76f212016-04-01 11:53:50 +0530201]
Anand Doshif576f3b2016-06-25 19:51:48 +0530202
203get_site_info = 'erpnext.utilities.get_site_info'
Saurabh94c666a2016-11-08 20:35:50 +0530204
Saurabh0d47d512017-03-14 14:46:05 +0530205payment_gateway_enabled = "erpnext.accounts.utils.create_payment_gateway_account"