浏览代码

[minor] fixes with Email Digest, get_url_to_form

version-14
Rushabh Mehta 9 年前
父节点
当前提交
0cc66a5bc5
共有 5 个文件被更改,包括 29 次插入7 次删除
  1. +15
    -2
      frappe/commands.py
  2. +3
    -0
      frappe/desk/doctype/todo/todo.js
  3. +2
    -2
      frappe/desk/form/assign_to.py
  4. +1
    -1
      frappe/public/js/frappe/views/ganttview.js
  5. +8
    -2
      frappe/utils/data.py

+ 15
- 2
frappe/commands.py 查看文件

@@ -383,15 +383,28 @@ def reset_perms(context):


@click.command('execute') @click.command('execute')
@click.argument('method') @click.argument('method')
@click.option('--args')
@click.option('--kwargs')
@pass_context @pass_context
def execute(context, method):
def execute(context, method, args=None, kwargs=None):
"execute a function" "execute a function"
for site in context.sites: for site in context.sites:
try: try:
frappe.init(site=site) frappe.init(site=site)
frappe.connect() frappe.connect()
print frappe.local.site print frappe.local.site
ret = frappe.get_attr(method)()

if args:
args = eval(args)
else:
args = ()

if kwargs:
kwargs = eval(args)
else:
kwargs = {}

ret = frappe.get_attr(method)(*args, **kwargs)


if frappe.db: if frappe.db:
frappe.db.commit() frappe.db.commit()


+ 3
- 0
frappe/desk/doctype/todo/todo.js 查看文件

@@ -32,6 +32,9 @@ frappe.ui.form.on("ToDo", {
frm.save(); frm.save();
}, null, "btn-default"); }, null, "btn-default");
} }
frm.add_custom_button(__("New"), function() {
newdoc("ToDo")
}, null, "btn-default");
} }
} }
}); });

+ 2
- 2
frappe/desk/form/assign_to.py 查看文件

@@ -103,8 +103,8 @@ def notify_assignment(assigned_by, owner, doc_type, doc_name, action='CLOSE',
user_info = get_fullnames() user_info = get_fullnames()


# Search for email address in description -- i.e. assignee # Search for email address in description -- i.e. assignee
from frappe.utils import get_url_to_form
assignment = get_url_to_form(doc_type, doc_name, label="%s: %s" % (doc_type, doc_name))
from frappe.utils import get_link_to_form
assignment = get_link_to_form(doc_type, doc_name, label="%s: %s" % (doc_type, doc_name))
owner_name = user_info.get(owner, {}).get('fullname') owner_name = user_info.get(owner, {}).get('fullname')
user_name = user_info.get(frappe.session.get('user'), {}).get('fullname') user_name = user_info.get(frappe.session.get('user'), {}).get('fullname')
if action=='CLOSE': if action=='CLOSE':


+ 1
- 1
frappe/public/js/frappe/views/ganttview.js 查看文件

@@ -82,7 +82,7 @@ frappe.views.Gantt = frappe.views.CalendarBase.extend({
gantt_area.gantt({ gantt_area.gantt({
source: me.get_source(r), source: me.get_source(r),
navigate: "scroll", navigate: "scroll",
scale: "days",
scale: me.gantt_scale || "days",
minScale: "hours", minScale: "hours",
maxScale: "months", maxScale: "months",
itemsPerPage: 20, itemsPerPage: 20,


+ 8
- 2
frappe/utils/data.py 查看文件

@@ -538,10 +538,16 @@ def get_url(uri=None, full_address=False):
def get_host_name(): def get_host_name():
return get_url().rsplit("//", 1)[-1] return get_url().rsplit("//", 1)[-1]


def get_url_to_form(doctype, name, label=None):
def get_link_to_form(doctype, name, label=None):
if not label: label = name if not label: label = name


return """<a href="/desk#!Form/%(doctype)s/%(name)s">%(label)s</a>""" % locals()
return """<a href="{0}">{1}</a>""".format(get_url_to_form(doctype, name), label)

def get_url_to_form(doctype, name):
return get_url(uri = "desk/#Form/{0}/{1}".format(doctype, name))

def get_url_to_list(doctype):
return get_url(uri = "desk/#List/{0}".format(doctype))


operator_map = { operator_map = {
# startswith # startswith


正在加载...
取消
保存