From 28406200704bcf29e045665e6abde80d16844026 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 17 Sep 2013 15:28:58 +0530 Subject: [PATCH] [fix] [minor] [website] --- .../doctype/sales_invoice/sales_invoice.py | 4 +- .../p03_move_website_to_framework.py | 3 +- setup/doctype/website_item_group/README.md | 1 + setup/doctype/website_item_group/__init__.py | 0 .../website_item_group/website_item_group.py | 11 ++++++ .../website_item_group/website_item_group.txt | 37 +++++++++++++++++++ startup/__init__.py | 11 ------ 7 files changed, 52 insertions(+), 15 deletions(-) create mode 100644 setup/doctype/website_item_group/README.md create mode 100644 setup/doctype/website_item_group/__init__.py create mode 100644 setup/doctype/website_item_group/website_item_group.py create mode 100644 setup/doctype/website_item_group/website_item_group.txt diff --git a/accounts/doctype/sales_invoice/sales_invoice.py b/accounts/doctype/sales_invoice/sales_invoice.py index 879ccaf4413..c7dba9c95b3 100644 --- a/accounts/doctype/sales_invoice/sales_invoice.py +++ b/accounts/doctype/sales_invoice/sales_invoice.py @@ -9,7 +9,7 @@ from webnotes.utils import add_days, cint, cstr, date_diff, flt, getdate, nowdat get_first_day, get_last_day from webnotes.utils.email_lib import sendmail -from webnotes.utils import comma_and +from webnotes.utils import comma_and, get_url from webnotes.model.doc import make_autoname from webnotes.model.bean import getlist from webnotes.model.code import get_obj @@ -919,7 +919,7 @@ def notify_errors(inv, owner): Regards, Administrator - """ % (inv, website.get_site_address(), inv) + """ % (inv, get_url(), inv) subj = "[Urgent] Error while creating recurring invoice from %s" % inv from webnotes.profile import get_system_managers diff --git a/patches/september_2013/p03_move_website_to_framework.py b/patches/september_2013/p03_move_website_to_framework.py index 9629b7acc14..9c15bcc34c4 100644 --- a/patches/september_2013/p03_move_website_to_framework.py +++ b/patches/september_2013/p03_move_website_to_framework.py @@ -14,5 +14,4 @@ def execute(): old_path = os.path.join(get_base_path(), "app", "website") if os.path.exists(old_path): - shutil.rmtree(old_path) - \ No newline at end of file + shutil.rmtree(old_path) \ No newline at end of file diff --git a/setup/doctype/website_item_group/README.md b/setup/doctype/website_item_group/README.md new file mode 100644 index 00000000000..54abfaf4fbc --- /dev/null +++ b/setup/doctype/website_item_group/README.md @@ -0,0 +1 @@ +Alternate grouping of parent Item (for website, so an Item can be listed under multiple groups). \ No newline at end of file diff --git a/setup/doctype/website_item_group/__init__.py b/setup/doctype/website_item_group/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/setup/doctype/website_item_group/website_item_group.py b/setup/doctype/website_item_group/website_item_group.py new file mode 100644 index 00000000000..3256c80d422 --- /dev/null +++ b/setup/doctype/website_item_group/website_item_group.py @@ -0,0 +1,11 @@ +# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. +# MIT License. See license.txt + +# For license information, please see license.txt + +from __future__ import unicode_literals +import webnotes + +class DocType: + def __init__(self, d, dl): + self.doc, self.doclist = d, dl \ No newline at end of file diff --git a/setup/doctype/website_item_group/website_item_group.txt b/setup/doctype/website_item_group/website_item_group.txt new file mode 100644 index 00000000000..5753fcf81e9 --- /dev/null +++ b/setup/doctype/website_item_group/website_item_group.txt @@ -0,0 +1,37 @@ +[ + { + "creation": "2013-02-22 01:28:09", + "docstatus": 0, + "modified": "2013-07-10 14:54:30", + "modified_by": "Administrator", + "owner": "Administrator" + }, + { + "description": "Cross Listing of Item in multiple groups", + "doctype": "DocType", + "document_type": "Other", + "istable": 1, + "module": "Setup", + "name": "__common__" + }, + { + "doctype": "DocField", + "fieldname": "item_group", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Item Group", + "name": "__common__", + "options": "Item Group", + "parent": "Website Item Group", + "parentfield": "fields", + "parenttype": "DocType", + "permlevel": 0 + }, + { + "doctype": "DocType", + "name": "Website Item Group" + }, + { + "doctype": "DocField" + } +] \ No newline at end of file diff --git a/startup/__init__.py b/startup/__init__.py index dd46cbe7eb2..227846c46dc 100644 --- a/startup/__init__.py +++ b/startup/__init__.py @@ -40,14 +40,3 @@ def get_monthly_bulk_mail_limit(): return 999999 else: return 500 - -def get_url(): - from webnotes.utils import get_request_site_address - url = get_request_site_address() - if not url or "localhost" in url: - subdomain = webnotes.conn.get_value("Website Settings", "Website Settings", - "subdomain") - if subdomain: - if "http" not in subdomain: - url = "http://" + subdomain - return url