diff --git a/frappe/__init__.py b/frappe/__init__.py index 2ede0f5e07..9cb0aeb2ce 100644 --- a/frappe/__init__.py +++ b/frappe/__init__.py @@ -638,6 +638,11 @@ def set_filters(jenv): def get_template(path): return get_jenv().get_template(path) +def render_template(template, context): + from jinja2 import Template + template = Template(template) + return template.render(**context) + def get_website_route(doctype, name): return db.get_value("Website Route", {"ref_doctype": doctype, "docname": name}) diff --git a/frappe/core/page/messages/messages.py b/frappe/core/page/messages/messages.py index b6ec56285b..7399c4a2a9 100644 --- a/frappe/core/page/messages/messages.py +++ b/frappe/core/page/messages/messages.py @@ -72,8 +72,8 @@ def post(txt, contact, parenttype=None, notify=False, subject=None): if notify and cint(notify): if contact==frappe.session.user: _notify([user.name for user in frappe.get_list("User", - {"user_type":"System User"}) \ - if user.name not in ("Guest", "Administrator")], txt, subject) + {"user_type":"System User", "enabled": 1}) \ + if user.name not in ("Guest", "Administrator")], txt) else: _notify(contact, txt, subject) @@ -83,7 +83,7 @@ def delete(arg=None): frappe.form_dict['name']); def _notify(contact, txt, subject=None): - from frappe.utils import cstr, get_fullname, get_url + from frappe.utils import get_fullname, get_url try: if not isinstance(contact, list): @@ -98,5 +98,5 @@ def _notify(contact, txt, subject=None): "link": get_url() }), bulk=True) - except frappe.OutgoingEmailError, e: + except frappe.OutgoingEmailError: pass diff --git a/frappe/model/base_document.py b/frappe/model/base_document.py index e79a5e9887..41714d4d49 100644 --- a/frappe/model/base_document.py +++ b/frappe/model/base_document.py @@ -33,6 +33,8 @@ class BaseDocument(object): for key, value in d.iteritems(): self.set(key, value) + return self + def update_if_missing(self, d): if isinstance(d, BaseDocument): d = d.get_valid_dict() @@ -264,7 +266,10 @@ class BaseDocument(object): frappe.throw(_("Options not set for link field {0}").format(df.fieldname)) docname = self.get(df.fieldname) - if docname and not frappe.db.get_value(doctype, docname): + if docname: + value = frappe.db.get_value(doctype, docname) + setattr(self, df.fieldname, value) + if docname and not value: invalid_links.append((df.fieldname, docname, get_msg(df, docname))) return invalid_links diff --git a/frappe/public/css/appframe.css b/frappe/public/css/appframe.css index d660346702..f0b76add15 100644 --- a/frappe/public/css/appframe.css +++ b/frappe/public/css/appframe.css @@ -17,14 +17,11 @@ .appframe-footer { border-top: 1px solid #ddd; - background-color: rgba(255,255,255,0.9); + background-color: rgba(255, 255, 255, 0.9); } -.appframe-titlebar, .appframe-iconbar { - background-color: rgba(255,255,255,0.7); - /*background: url(/assets/frappe/images/ui/sos.png) repeat;*/ - /*-webkit-box-shadow: inset 0 0 7px rgba(0, 0, 0, .07); - box-shadow: inset 0 0 7px rgba(0, 0, 0, .07);*/ +.appframe-titlebar, .appframe-iconbar, .appframe-form { + background-color: rgba(255, 255, 255, 0.7); } .appframe-iconbar { diff --git a/frappe/public/js/frappe/form/formatters.js b/frappe/public/js/frappe/form/formatters.js index 64de2be9ba..e99158a1ab 100644 --- a/frappe/public/js/frappe/form/formatters.js +++ b/frappe/public/js/frappe/form/formatters.js @@ -57,12 +57,13 @@ frappe.form.formatters = { }, Text: function(value) { if(value) { - var tags = ["
]>", "
]>", "
]>", "