blob: af364e857f57206f2ade2f5d2e4ee71c7b56004f [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
Anand Doshi0c3bb752014-07-09 12:59:56 +053015error_report_email = "support@erpnext.com"
16
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +053017app_include_js = "assets/js/erpnext.min.js"
18app_include_css = "assets/css/erpnext.css"
19web_include_js = "assets/js/erpnext-web.min.js"
Anand Doshida858cc2015-02-24 17:50:44 +053020web_include_css = "assets/erpnext/css/website.css"
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +053021
Rushabh Mehta37b4d752015-11-09 16:53:11 +053022# setup wizard
23setup_wizard_requires = "assets/erpnext/js/setup_wizard.js"
24setup_wizard_complete = "erpnext.setup.setup_wizard.setup_wizard.setup_complete"
25
Rushabh Mehtad55bdcf2015-12-31 11:12:48 +053026before_install = "erpnext.setup.install.check_setup_wizard_not_completed"
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +053027after_install = "erpnext.setup.install.after_install"
28
29boot_session = "erpnext.startup.boot.boot_session"
30notification_config = "erpnext.startup.notifications.get_notification_config"
Rushabh Mehta05ce7ec2017-02-22 16:15:43 +053031get_help_messages = "erpnext.utilities.activation.get_help_messages"
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +053032
Rushabh Mehta3daa49a2014-10-21 16:16:30 +053033on_session_creation = "erpnext.shopping_cart.utils.set_cart_count"
34on_logout = "erpnext.shopping_cart.utils.clear_cart_count"
Anand Doshif9fc04c2015-02-23 22:14:12 +053035
Saurabh62124782016-06-30 13:33:49 +053036treeviews = ['Account', 'Cost Center', 'Warehouse', 'Item Group', 'Customer Group', 'Sales Person', 'Territory', "BOM"]
Rushabh Mehta764aa922016-05-02 13:28:46 +053037
Anand Doshif9fc04c2015-02-23 22:14:12 +053038# website
39update_website_context = "erpnext.shopping_cart.utils.update_website_context"
40my_account_context = "erpnext.shopping_cart.utils.update_my_account_context"
Rushabh Mehta621d6ea2015-07-08 12:39:27 +053041
Rushabh Mehta4c466872015-04-02 22:00:34 +053042email_append_to = ["Job Applicant", "Opportunity", "Issue"]
Anand Doshif9fc04c2015-02-23 22:14:12 +053043
Rohit Waghchaured6c986d2016-06-03 14:44:35 +053044calendars = ["Task", "Production Order", "Leave Application", "Sales Order", "Holiday List"]
Rushabh Mehta621d6ea2015-07-08 12:39:27 +053045
Kanchan Chauhan1f3d5b72016-03-01 11:33:49 +053046fixtures = ["Web Form"]
47
Neil Trini Lasrado83d81202016-09-15 14:48:13 +053048website_generators = ["Item Group", "Item", "Sales Partner", "Job Opening", "Student Admission"]
Rushabh Mehta621d6ea2015-07-08 12:39:27 +053049
Rushabh Mehta2e7c36e2015-04-16 12:41:42 +053050website_context = {
Rushabh Mehta5674c4f2015-04-16 15:09:42 +053051 "favicon": "/assets/erpnext/images/favicon.png",
52 "splash_image": "/assets/erpnext/images/splash.png"
Rushabh Mehta2e7c36e2015-04-16 12:41:42 +053053}
54
Anand Doshif9fc04c2015-02-23 22:14:12 +053055website_route_rules = [
56 {"from_route": "/orders", "to_route": "Sales Order"},
Rushabh Mehta156ce602015-09-11 18:49:59 +053057 {"from_route": "/orders/<path:name>", "to_route": "order",
58 "defaults": {
59 "doctype": "Sales Order",
60 "parents": [{"title": _("Orders"), "name": "orders"}]
61 }
62 },
Anand Doshif9fc04c2015-02-23 22:14:12 +053063 {"from_route": "/invoices", "to_route": "Sales Invoice"},
Rushabh Mehta156ce602015-09-11 18:49:59 +053064 {"from_route": "/invoices/<path:name>", "to_route": "order",
65 "defaults": {
66 "doctype": "Sales Invoice",
67 "parents": [{"title": _("Invoices"), "name": "invoices"}]
68 }
69 },
Rohit Waghchaure21499e82016-09-21 16:49:58 +053070 {"from_route": "/quotations", "to_route": "Supplier Quotation"},
71 {"from_route": "/quotations/<path:name>", "to_route": "order",
72 "defaults": {
73 "doctype": "Supplier Quotation",
74 "parents": [{"title": _("Supplier Quotation"), "name": "quotations"}]
75 }
76 },
Anand Doshif9fc04c2015-02-23 22:14:12 +053077 {"from_route": "/shipments", "to_route": "Delivery Note"},
Rushabh Mehta156ce602015-09-11 18:49:59 +053078 {"from_route": "/shipments/<path:name>", "to_route": "order",
79 "defaults": {
Anand Doshi4b127402015-11-26 18:22:03 +053080 "doctype": "Delivery Note",
Rushabh Mehta156ce602015-09-11 18:49:59 +053081 "parents": [{"title": _("Shipments"), "name": "shipments"}]
82 }
Kanchan Chauhan2e8cc892016-02-19 17:27:23 +053083 },
rohitwaghchaurea1064a62016-03-03 14:00:35 +053084 {"from_route": "/rfq", "to_route": "Request for Quotation"},
85 {"from_route": "/rfq/<path:name>", "to_route": "rfq",
86 "defaults": {
87 "doctype": "Request for Quotation",
88 "parents": [{"title": _("Request for Quotation"), "name": "rfq"}]
89 }
90 },
Kanchan Chauhan1605ff02016-07-04 14:28:09 +053091 {"from_route": "/addresses", "to_route": "Address"},
92 {"from_route": "/addresses/<path:name>", "to_route": "addresses",
93 "defaults": {
94 "doctype": "Address",
95 "parents": [{"title": _("Addresses"), "name": "addresses"}]
96 }
97 },
Kanchan Chauhan2e8cc892016-02-19 17:27:23 +053098 {"from_route": "/jobs", "to_route": "Job Opening"},
Neil Trini Lasrado83d81202016-09-15 14:48:13 +053099 {"from_route": "/admissions", "to_route": "Student Admission"},
Anand Doshif9fc04c2015-02-23 22:14:12 +0530100]
101
Rushabh Mehtac78b3112016-03-30 12:29:48 +0530102portal_menu_items = [
Rushabh Mehta0c76f212016-04-01 11:53:50 +0530103 {"title": _("Projects"), "route": "/project", "reference_doctype": "Project"},
Rushabh Mehtafc800b32016-09-23 21:51:51 +0530104 {"title": _("Request for Quotations"), "route": "/rfq", "reference_doctype": "Request for Quotation", "role": "Supplier"},
105 {"title": _("Supplier Quotation"), "route": "/quotations", "reference_doctype": "Supplier Quotation", "role": "Supplier"},
106 {"title": _("Orders"), "route": "/orders", "reference_doctype": "Sales Order", "role":"Customer"},
107 {"title": _("Invoices"), "route": "/invoices", "reference_doctype": "Sales Invoice", "role":"Customer"},
108 {"title": _("Shipments"), "route": "/shipments", "reference_doctype": "Delivery Note", "role":"Customer"},
109 {"title": _("Issues"), "route": "/issues", "reference_doctype": "Issue", "role":"Customer"},
Neil Trini Lasrado3f0a5812016-07-19 14:17:33 +0530110 {"title": _("Addresses"), "route": "/addresses", "reference_doctype": "Address"},
111 {"title": _("Announcements"), "route": "/announcement", "reference_doctype": "Announcement"},
Rushabh Mehtafc800b32016-09-23 21:51:51 +0530112 {"title": _("Courses"), "route": "/course", "reference_doctype": "Course", "role":"Student"},
113 {"title": _("Assessment Schedule"), "route": "/assessment", "reference_doctype": "Assessment", "role":"Student"},
114 {"title": _("Fees"), "route": "/fees", "reference_doctype": "Fees", "role":"Student"}
115]
116
117default_roles = [
118 {'role': 'Customer', 'doctype':'Contact', 'email_field': 'email_id',
119 'filters': {'ifnull(customer, "")': ('!=', '')}},
120 {'role': 'Supplier', 'doctype':'Contact', 'email_field': 'email_id',
121 'filters': {'ifnull(supplier, "")': ('!=', '')}},
122 {'role': 'Student', 'doctype':'Student', 'email_field': 'student_email_id'}
Rushabh Mehtac78b3112016-03-30 12:29:48 +0530123]
124
Anand Doshif9fc04c2015-02-23 22:14:12 +0530125has_website_permission = {
126 "Sales Order": "erpnext.controllers.website_list_for_contact.has_website_permission",
127 "Sales Invoice": "erpnext.controllers.website_list_for_contact.has_website_permission",
Rohit Waghchaure21499e82016-09-21 16:49:58 +0530128 "Supplier Quotation": "erpnext.controllers.website_list_for_contact.has_website_permission",
Rushabh Mehtaa33d4682015-06-01 17:15:42 +0530129 "Delivery Note": "erpnext.controllers.website_list_for_contact.has_website_permission",
Rushabh Mehta834b3e62015-11-13 14:37:52 +0530130 "Issue": "erpnext.support.doctype.issue.issue.has_website_permission",
Neil Trini Lasrado3f0a5812016-07-19 14:17:33 +0530131 "Address": "erpnext.utilities.doctype.address.address.has_website_permission",
132 "Discussion": "erpnext.schools.web_form.discussion.discussion.has_website_permission"
Anand Doshif9fc04c2015-02-23 22:14:12 +0530133}
Rushabh Mehta3daa49a2014-10-21 16:16:30 +0530134
Anand Doshi89b8d112015-09-29 20:06:53 +0530135permission_query_conditions = {
136 "Contact": "erpnext.utilities.address_and_contact.get_permission_query_conditions_for_contact",
137 "Address": "erpnext.utilities.address_and_contact.get_permission_query_conditions_for_address"
138}
139
140has_permission = {
141 "Contact": "erpnext.utilities.address_and_contact.has_permission",
142 "Address": "erpnext.utilities.address_and_contact.has_permission"
143}
144
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +0530145dump_report_map = "erpnext.startup.report_data_map.data_map"
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +0530146
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +0530147before_tests = "erpnext.setup.utils.before_tests"
148
Rushabh Mehta308e6ea2015-03-24 17:34:58 +0530149standard_queries = {
150 "Customer": "erpnext.selling.doctype.customer.customer.get_customer_list"
151}
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +0530152
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +0530153doc_events = {
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +0530154 "Stock Entry": {
Nabin Hait4acd4312014-11-04 15:32:31 +0530155 "on_submit": "erpnext.stock.doctype.material_request.material_request.update_completed_and_requested_qty",
156 "on_cancel": "erpnext.stock.doctype.material_request.material_request.update_completed_and_requested_qty"
Anand Doshi648062d2014-05-05 16:46:14 +0530157 },
158 "User": {
Anand Doshi49856912014-05-28 18:49:13 +0530159 "validate": "erpnext.hr.doctype.employee.employee.validate_employee_role",
Rushabh Mehta2d985e12016-03-30 17:15:33 +0530160 "on_update": "erpnext.hr.doctype.employee.employee.update_user_permissions",
161 "on_update": "erpnext.utilities.doctype.contact.contact.update_contact"
Rushabh Mehta3daa49a2014-10-21 16:16:30 +0530162 },
Rushabh Mehtaf16f9c52016-04-08 17:20:50 +0530163 ("Sales Taxes and Charges Template", 'Price List'): {
Rushabh Mehta3daa49a2014-10-21 16:16:30 +0530164 "on_update": "erpnext.shopping_cart.doctype.shopping_cart_settings.shopping_cart_settings.validate_cart_settings"
165 },
Anand Doshicc24d282015-12-08 12:34:01 +0530166 "Address": {
167 "validate": "erpnext.shopping_cart.cart.set_customer_in_address"
Rushabh Mehtaf16f9c52016-04-08 17:20:50 +0530168 },
169
170 # bubble transaction notification on master
Rushabh Mehta5d0e8de2016-04-11 17:34:25 +0530171 ('Opportunity', 'Quotation', 'Sales Order', 'Delivery Note', 'Sales Invoice',
172 'Supplier Quotation', 'Purchase Order', 'Purchase Receipt',
173 'Purchase Invoice', 'Project', 'Issue'): {
Rushabh Mehtaf4d1b182016-04-11 11:34:59 +0530174 'on_change': 'erpnext.accounts.party_status.notify_status'
Anand Doshie3bd78e2016-04-22 18:53:21 +0530175 },
176
177 "Website Settings": {
178 "validate": "erpnext.portal.doctype.products_settings.products_settings.home_page_is_products"
Saurabhe4e89542016-07-21 20:26:46 +0530179 },
180 "Payment Entry": {
181 "on_submit": "erpnext.accounts.doctype.payment_request.payment_request.make_status_as_paid"
Anand Doshie3bd78e2016-04-22 18:53:21 +0530182 }
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +0530183}
184
185scheduler_events = {
Nabin Hait75807232015-07-02 14:41:27 +0530186 "hourly": [
Rushabh Mehtafe816c32016-11-08 18:18:40 +0530187 "erpnext.controllers.recurring_document.create_recurring_documents",
188 'erpnext.hr.doctype.daily_work_summary_settings.daily_work_summary_settings.trigger_emails'
Nabin Hait75807232015-07-02 14:41:27 +0530189 ],
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +0530190 "daily": [
Rushabh Mehtaf8509872014-10-08 12:03:19 +0530191 "erpnext.stock.reorder_item.reorder_item",
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +0530192 "erpnext.setup.doctype.email_digest.email_digest.send",
Nabin Hait606af962014-12-15 11:57:03 +0530193 "erpnext.support.doctype.issue.issue.auto_close_tickets",
Rohit Waghchaure2f1db572016-11-08 12:39:33 +0530194 "erpnext.controllers.accounts_controller.update_invoice_status",
Rushabh Mehta5bceebc2015-01-23 15:22:13 +0530195 "erpnext.accounts.doctype.fiscal_year.fiscal_year.auto_create_fiscal_year",
Rushabh Mehta13ec41a2015-12-10 12:31:36 +0530196 "erpnext.hr.doctype.employee.employee.send_birthday_reminders",
Nabin Hait4fdb0522016-03-09 12:40:56 +0530197 "erpnext.projects.doctype.task.task.set_tasks_as_overdue",
Rushabh Mehta9dd58d42016-11-18 12:39:24 +0530198 "erpnext.accounts.doctype.asset.depreciation.post_depreciation_entries",
199 'erpnext.hr.doctype.daily_work_summary_settings.daily_work_summary_settings.send_summary'
Rushabh Mehta4ceb20e2014-05-02 12:14:03 +0530200 ]
201}
Anand Doshi7f41ff22014-06-26 12:02:55 +0530202
Anand Doshic5f919e2015-09-16 19:20:55 +0530203default_mail_footer = """<div style="text-align: center;">
Nabin Haitb3a142f2015-05-26 12:13:30 +0530204 <a href="https://erpnext.com?source=via_email_footer" target="_blank" style="color: #8d99a6;">
205 Sent via ERPNext
Anand Doshiadcf8572015-03-27 17:42:03 +0530206 </a>
207</div>"""
Anand Doshic82331b2015-02-12 18:58:28 +0530208
209get_translated_dict = {
Anand Doshic82331b2015-02-12 18:58:28 +0530210 ("doctype", "Global Defaults"): "frappe.geo.country_info.get_translated_dict"
211}
Rushabh Mehtafe027b32016-03-28 13:21:43 +0530212
213bot_parsers = [
214 'erpnext.utilities.bot.FindItemBot',
Rushabh Mehta0c76f212016-04-01 11:53:50 +0530215]
Anand Doshif576f3b2016-06-25 19:51:48 +0530216
217get_site_info = 'erpnext.utilities.get_site_info'
Saurabh94c666a2016-11-08 20:35:50 +0530218
219payment_gateway_enabled = "erpnext.accounts.utils.create_payment_gateway_and_account"