Skip to content

Commit 574605f

Browse files
committed
Merge branch 'develop' into version-12
2 parents 2ccf743 + 71d406a commit 574605f

File tree

113 files changed

+3050
-3006
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+3050
-3006
lines changed

frappe/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
reload(sys)
2424
sys.setdefaultencoding("utf-8")
2525

26-
__version__ = '12.0.8'
26+
__version__ = '12.0.9'
2727
__title__ = "Frappe Framework"
2828

2929
local = Local()
@@ -1162,7 +1162,7 @@ def respond_as_web_page(title, html, success=None, http_status_code=None,
11621162
:param context: web template context
11631163
:param indicator_color: color of indicator in title
11641164
:param primary_action: route on primary button (default is `/`)
1165-
:param primary_label: label on primary button (defaut is "Home")
1165+
:param primary_label: label on primary button (default is "Home")
11661166
:param fullpage: hide header / footer
11671167
:param width: Width of message in pixels
11681168
:param template: Optionally pass view template
@@ -1171,6 +1171,8 @@ def respond_as_web_page(title, html, success=None, http_status_code=None,
11711171
local.message = html
11721172
local.response['type'] = 'page'
11731173
local.response['route'] = template
1174+
local.no_cache = 1
1175+
11741176
if http_status_code:
11751177
local.response['http_status_code'] = http_status_code
11761178

frappe/api.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,10 @@ def handle():
113113
doctype, **frappe.local.form_dict)})
114114

115115
if frappe.local.request.method=="POST":
116-
data = json.loads(frappe.local.form_dict.data)
116+
if frappe.local.form_dict.data is None:
117+
data = json.loads(frappe.local.request.get_data())
118+
else:
119+
data = json.loads(frappe.local.form_dict.data)
117120
data.update({
118121
"doctype": doctype
119122
})

frappe/automation/doctype/auto_repeat/auto_repeat.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,9 @@ def send_notification(self, new_doc):
221221
attachments = [frappe.attach_print(new_doc.doctype, new_doc.name,
222222
file_name=new_doc.name, print_format=print_format)]
223223

224-
make(doctype=new_doc.doctype, name=new_doc.name, recipients=self.recipients,
224+
recipients = self.recipients.split('\n')
225+
226+
make(doctype=new_doc.doctype, name=new_doc.name, recipients=recipients,
225227
subject=subject, content=message, attachments=attachments, send_email=1)
226228

227229
def fetch_linked_contacts(self):
@@ -243,13 +245,14 @@ def disable_auto_repeat(self):
243245
frappe.db.set_value('Auto Repeat', self.name, 'disabled', 1)
244246

245247
def notify_error_to_user(self, error_log):
246-
recipients = get_system_managers(only_name=True) + self.owner
248+
recipients = list(get_system_managers(only_name=True))
249+
recipients.append(self.owner)
247250
subject = _("Auto Repeat Document Creation Failed")
248251

249252
form_link = frappe.utils.get_link_to_form(self.reference_doctype, self.reference_document)
250253
auto_repeat_failed_for = _('Auto Repeat failed for {0}').format(form_link)
251254

252-
error_log_link =frappe.utils.get_link_to_form(error_log.reference_doctype, error_log.reference_document)
255+
error_log_link = frappe.utils.get_link_to_form('Error Log', error_log.name)
253256
error_log_message = _('Check the Error Log for more information: {0}').format(error_log_link)
254257

255258
frappe.sendmail(

frappe/client.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,3 +377,14 @@ def check_parent_permission(parent, child_doctype):
377377
# Either parent not passed or the user doesn't have permission on parent doctype of child table!
378378
raise frappe.PermissionError
379379

380+
@frappe.whitelist()
381+
def is_document_amended(doctype, docname):
382+
if frappe.permissions.has_permission(doctype):
383+
try:
384+
return frappe.db.exists(doctype, {
385+
'amended_from': docname
386+
})
387+
except frappe.db.InternalError:
388+
pass
389+
390+
return False

frappe/contacts/address_and_contact.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
def load_address_and_contact(doc, key=None):
1212
"""Loads address list and contact list in `__onload`"""
13-
from frappe.contacts.doctype.address.address import get_address_display
13+
from frappe.contacts.doctype.address.address import get_address_display, get_condensed_address
1414

1515
filters = [
1616
["Dynamic Link", "link_doctype", "=", doc.doctype],
@@ -37,6 +37,23 @@ def load_address_and_contact(doc, key=None):
3737
]
3838
contact_list = frappe.get_all("Contact", filters=filters, fields=["*"])
3939

40+
for contact in contact_list:
41+
contact["email_ids"] = frappe.get_list("Contact Email", filters={
42+
"parenttype": "Contact",
43+
"parent": contact.name,
44+
"is_primary": 0
45+
}, fields=["email_id"])
46+
47+
contact["phone_nos"] = frappe.get_list("Contact Phone", filters={
48+
"parenttype": "Contact",
49+
"parent": contact.name,
50+
"is_primary": 0
51+
}, fields=["phone"])
52+
53+
if contact.address:
54+
address = frappe.get_doc("Address", contact.address)
55+
contact["address"] = get_condensed_address(address)
56+
4057
contact_list = sorted(contact_list,
4158
key = functools.cmp_to_key(lambda a, b:
4259
(int(a.is_primary_contact - b.is_primary_contact)) or

0 commit comments

Comments
 (0)