From 39bb8e2ed4c1af6801e1f7d590882d953260f11e Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Wed, 11 Dec 2013 15:32:14 +0530 Subject: [PATCH] step 0: install --- .../hr/doctype/job_applicant/get_job_applications.py | 2 +- .../hr/doctype/leave_application/leave_application.py | 2 +- erpnext/modules.txt | 11 +++++++++++ erpnext/patches/1311/p01_cleanup.py | 2 +- .../october_2013/p05_server_custom_script_to_file.py | 2 +- erpnext/patches/october_2013/p10_plugins_refactor.py | 2 ++ erpnext/portal/utils.py | 2 +- erpnext/selling/doctype/lead/get_leads.py | 2 +- erpnext/setup/doctype/email_digest/email_digest.py | 4 ++-- erpnext/setup/doctype/item_group/item_group.py | 2 +- erpnext/setup/doctype/naming_series/naming_series.py | 4 ++-- erpnext/startup/bean_handlers.py | 2 +- erpnext/startup/open_count.py | 2 +- erpnext/startup/schedule_handlers.py | 4 ++-- erpnext/stock/doctype/item/item.py | 2 +- .../doctype/support_ticket/get_support_mails.py | 2 +- .../doctype/support_ticket/templates/pages/ticket.py | 2 +- erpnext/utilities/demo/make_demo.py | 2 +- 18 files changed, 32 insertions(+), 19 deletions(-) create mode 100644 erpnext/modules.txt diff --git a/erpnext/hr/doctype/job_applicant/get_job_applications.py b/erpnext/hr/doctype/job_applicant/get_job_applications.py index 33e1261bc4..05bd46f610 100644 --- a/erpnext/hr/doctype/job_applicant/get_job_applications.py +++ b/erpnext/hr/doctype/job_applicant/get_job_applications.py @@ -5,7 +5,7 @@ from __future__ import unicode_literals import webnotes from webnotes.utils import cstr, cint from webnotes.utils.email_lib.receive import POP3Mailbox -from core.doctype.communication.communication import make +from webnotes.core.doctype.communication.communication import make class JobsMailbox(POP3Mailbox): def setup(self, args=None): diff --git a/erpnext/hr/doctype/leave_application/leave_application.py b/erpnext/hr/doctype/leave_application/leave_application.py index 38ca3061d4..9b75b101b1 100755 --- a/erpnext/hr/doctype/leave_application/leave_application.py +++ b/erpnext/hr/doctype/leave_application/leave_application.py @@ -205,7 +205,7 @@ class DocType(DocListController): def notify(self, args): args = webnotes._dict(args) - from core.page.messages.messages import post + from webnotes.core.page.messages.messages import post post({"txt": args.message, "contact": args.message_to, "subject": args.subject, "notify": cint(self.doc.follow_via_email)}) diff --git a/erpnext/modules.txt b/erpnext/modules.txt new file mode 100644 index 0000000000..f7857e4334 --- /dev/null +++ b/erpnext/modules.txt @@ -0,0 +1,11 @@ +accounts +buying +home +hr +manufacturing +projects +selling +setup +stock +support +utilities \ No newline at end of file diff --git a/erpnext/patches/1311/p01_cleanup.py b/erpnext/patches/1311/p01_cleanup.py index 04d8f6a161..23f6576927 100644 --- a/erpnext/patches/1311/p01_cleanup.py +++ b/erpnext/patches/1311/p01_cleanup.py @@ -9,7 +9,7 @@ def execute(): webnotes.reload_doc("buying", "doctype", "purchase_order") webnotes.reload_doc("selling", "doctype", "lead") - from core.doctype.custom_field.custom_field import create_custom_field_if_values_exist + from webnotes.core.doctype.custom_field.custom_field import create_custom_field_if_values_exist create_custom_field_if_values_exist("Material Request", {"fieldtype":"Text", "fieldname":"remark", "label":"Remarks","insert_after":"Fiscal Year"}) diff --git a/erpnext/patches/october_2013/p05_server_custom_script_to_file.py b/erpnext/patches/october_2013/p05_server_custom_script_to_file.py index 76ec56cbfd..5cffed64fe 100644 --- a/erpnext/patches/october_2013/p05_server_custom_script_to_file.py +++ b/erpnext/patches/october_2013/p05_server_custom_script_to_file.py @@ -17,7 +17,7 @@ def execute(): """ import os from webnotes.utils import get_site_base_path - from core.doctype.custom_script.custom_script import make_custom_server_script_file + from webnotes.core.doctype.custom_script.custom_script import make_custom_server_script_file for name, dt, script in webnotes.conn.sql("""select name, dt, script from `tabCustom Script` where script_type='Server'"""): if script and script.strip(): diff --git a/erpnext/patches/october_2013/p10_plugins_refactor.py b/erpnext/patches/october_2013/p10_plugins_refactor.py index 47d9d09191..851c8afccd 100644 --- a/erpnext/patches/october_2013/p10_plugins_refactor.py +++ b/erpnext/patches/october_2013/p10_plugins_refactor.py @@ -6,6 +6,8 @@ import webnotes, os, shutil def execute(): # changed cache key for plugin code files + return + for doctype in webnotes.conn.sql_list("""select name from `tabDocType`"""): webnotes.cache().delete_value("_server_script:"+doctype) diff --git a/erpnext/portal/utils.py b/erpnext/portal/utils.py index 89800f3e1d..727edf3aff 100644 --- a/erpnext/portal/utils.py +++ b/erpnext/portal/utils.py @@ -59,7 +59,7 @@ def get_transaction_context(doctype, name): @webnotes.whitelist(allow_guest=True) def send_message(subject="Website Query", message="", sender="", status="Open"): - from website.doctype.contact_us_settings.templates.pages.contact \ + from webnotes.website.doctype.contact_us_settings.templates.pages.contact \ import send_message as website_send_message if not website_send_message(subject, message, sender): diff --git a/erpnext/selling/doctype/lead/get_leads.py b/erpnext/selling/doctype/lead/get_leads.py index 7bc691f458..898ee0e9dc 100644 --- a/erpnext/selling/doctype/lead/get_leads.py +++ b/erpnext/selling/doctype/lead/get_leads.py @@ -5,7 +5,7 @@ from __future__ import unicode_literals import webnotes from webnotes.utils import cstr, cint from webnotes.utils.email_lib.receive import POP3Mailbox -from core.doctype.communication.communication import make +from webnotes.core.doctype.communication.communication import make def add_sales_communication(subject, content, sender, real_name, mail=None, status="Open", date=None): diff --git a/erpnext/setup/doctype/email_digest/email_digest.py b/erpnext/setup/doctype/email_digest/email_digest.py index 1078d03268..15bb67aaf3 100644 --- a/erpnext/setup/doctype/email_digest/email_digest.py +++ b/erpnext/setup/doctype/email_digest/email_digest.py @@ -280,7 +280,7 @@ class DocType(DocListController): return self.get_new_count("Project", self.meta.get_label("new_projects"), False) def get_calendar_events(self, user_id): - from core.doctype.event.event import get_events + from webnotes.core.doctype.event.event import get_events events = get_events(self.future_from_date.strftime("%Y-%m-%d"), self.future_to_date.strftime("%Y-%m-%d")) html = "" @@ -301,7 +301,7 @@ class DocType(DocListController): return 0, "

Calendar Events

" def get_todo_list(self, user_id): - from core.page.todo.todo import get + from webnotes.core.page.todo.todo import get todo_list = get() html = "" diff --git a/erpnext/setup/doctype/item_group/item_group.py b/erpnext/setup/doctype/item_group/item_group.py index e2fc7abe11..5ad25af6a4 100644 --- a/erpnext/setup/doctype/item_group/item_group.py +++ b/erpnext/setup/doctype/item_group/item_group.py @@ -45,6 +45,6 @@ class DocType(DocTypeNestedSet, WebsiteGenerator): self.doc.title = self.doc.name if self.doc.slideshow: - from website.doctype.website_slideshow.website_slideshow import get_slideshow + from webnotes.website.doctype.website_slideshow.website_slideshow import get_slideshow get_slideshow(self) \ No newline at end of file diff --git a/erpnext/setup/doctype/naming_series/naming_series.py b/erpnext/setup/doctype/naming_series/naming_series.py index 234a689a7b..f825e2104b 100644 --- a/erpnext/setup/doctype/naming_series/naming_series.py +++ b/erpnext/setup/doctype/naming_series/naming_series.py @@ -83,7 +83,7 @@ class DocType: webnotes.clear_cache(doctype=doctype) def check_duplicate(self): - from core.doctype.doctype.doctype import DocType + from webnotes.core.doctype.doctype.doctype import DocType dt = DocType() parent = list(set( @@ -136,7 +136,7 @@ class DocType: msgprint("Please select prefix first") def set_by_naming_series(doctype, fieldname, naming_series, hide_name_field=True): - from core.doctype.property_setter.property_setter import make_property_setter + from webnotes.core.doctype.property_setter.property_setter import make_property_setter if naming_series: make_property_setter(doctype, "naming_series", "hidden", 0, "Check") make_property_setter(doctype, "naming_series", "reqd", 1, "Check") diff --git a/erpnext/startup/bean_handlers.py b/erpnext/startup/bean_handlers.py index 06d27343d8..679c3aa042 100644 --- a/erpnext/startup/bean_handlers.py +++ b/erpnext/startup/bean_handlers.py @@ -2,7 +2,7 @@ # License: GNU General Public License v3. See license.txt from home import update_feed -from core.doctype.notification_count.notification_count import clear_doctype_notifications +from webnotes.core.doctype.notification_count.notification_count import clear_doctype_notifications from stock.doctype.material_request.material_request import update_completed_qty def on_method(bean, method): diff --git a/erpnext/startup/open_count.py b/erpnext/startup/open_count.py index 38034e2a8b..e561c03adf 100644 --- a/erpnext/startup/open_count.py +++ b/erpnext/startup/open_count.py @@ -41,7 +41,7 @@ def get_things_todo(): def get_todays_events(): """Returns a count of todays events in calendar""" - from core.doctype.event.event import get_events + from webnotes.core.doctype.event.event import get_events from webnotes.utils import nowdate today = nowdate() return len(get_events(today, today)) diff --git a/erpnext/startup/schedule_handlers.py b/erpnext/startup/schedule_handlers.py index cdb0e5d5dd..32987c465d 100644 --- a/erpnext/startup/schedule_handlers.py +++ b/erpnext/startup/schedule_handlers.py @@ -27,11 +27,11 @@ def execute_all(): def execute_daily(): # event reminders - from core.doctype.event.event import send_event_digest + from webnotes.core.doctype.event.event import send_event_digest run_fn(send_event_digest) # clear daily event notifications - from core.doctype.notification_count.notification_count import delete_notification_count_for + from webnotes.core.doctype.notification_count.notification_count import delete_notification_count_for delete_notification_count_for("Event") # email digest diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py index a4985e9794..0459070e36 100644 --- a/erpnext/stock/doctype/item/item.py +++ b/erpnext/stock/doctype/item/item.py @@ -238,7 +238,7 @@ class DocType(DocListController, WebsiteGenerator): self.doc.title = self.doc.item_name if self.doc.slideshow: - from website.doctype.website_slideshow.website_slideshow import get_slideshow + from webnotes.website.doctype.website_slideshow.website_slideshow import get_slideshow get_slideshow(self) def get_file_details(self, arg = ''): diff --git a/erpnext/support/doctype/support_ticket/get_support_mails.py b/erpnext/support/doctype/support_ticket/get_support_mails.py index 33cb023747..b50e46ea08 100644 --- a/erpnext/support/doctype/support_ticket/get_support_mails.py +++ b/erpnext/support/doctype/support_ticket/get_support_mails.py @@ -6,7 +6,7 @@ import webnotes from webnotes.utils import cstr, cint, decode_dict, today from webnotes.utils.email_lib import sendmail from webnotes.utils.email_lib.receive import POP3Mailbox -from core.doctype.communication.communication import make +from webnotes.core.doctype.communication.communication import make class SupportMailbox(POP3Mailbox): def setup(self, args=None): diff --git a/erpnext/support/doctype/support_ticket/templates/pages/ticket.py b/erpnext/support/doctype/support_ticket/templates/pages/ticket.py index 28d8802cc3..f9e5c88040 100644 --- a/erpnext/support/doctype/support_ticket/templates/pages/ticket.py +++ b/erpnext/support/doctype/support_ticket/templates/pages/ticket.py @@ -31,7 +31,7 @@ def add_reply(ticket, message): if bean.doc.raised_by != webnotes.session.user: raise webnotes.throw(_("You are not allowed to reply to this ticket."), webnotes.PermissionError) - from core.doctype.communication.communication import make + from webnotes.core.doctype.communication.communication import make make(content=message, sender=bean.doc.raised_by, subject = bean.doc.subject, doctype="Support Ticket", name=bean.doc.name, date=today()) \ No newline at end of file diff --git a/erpnext/utilities/demo/make_demo.py b/erpnext/utilities/demo/make_demo.py index b98fd7ac9c..18211a12a2 100644 --- a/erpnext/utilities/demo/make_demo.py +++ b/erpnext/utilities/demo/make_demo.py @@ -9,7 +9,7 @@ import random import json webnotes.session = webnotes._dict({"user":"Administrator"}) -from core.page.data_import_tool.data_import_tool import upload +from webnotes.core.page.data_import_tool.data_import_tool import upload # fix price list # fix fiscal year