Skip to content

Commit

Permalink
Merge branch 'v12-pre-release' into version-12
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitwaghchaure committed Oct 30, 2021
2 parents 7a826b6 + 353b2f9 commit 03d50ce
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 15 deletions.
2 changes: 1 addition & 1 deletion frappe/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
reload(sys)
sys.setdefaultencoding("utf-8")

__version__ = '12.22.2'
__version__ = '12.23.0'
__title__ = "Frappe Framework"

local = Local()
Expand Down
7 changes: 7 additions & 0 deletions frappe/change_log/v12/v12_23_0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## Frappe Version 12.23.0 Release Notes

### Fixes & Enhancements

- Shift+tab keyboard navigation ([#14243](https://github.com/frappe/frappe/pull/14243))
- Include space and tab in special characters to match to encode url ([#12632](https://github.com/frappe/frappe/pull/12632))
- `convert_dates_to_str` converts everything except `date` objects ([#14340](https://github.com/frappe/frappe/pull/14340))
15 changes: 7 additions & 8 deletions frappe/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,18 +264,17 @@ def bulk_update(docs):
docs = json.loads(docs)
failed_docs = []
for doc in docs:
doc.pop("flags", None)
try:
ddoc = {key: val for key, val in iteritems(doc) if key not in ['doctype', 'docname']}
doctype = doc['doctype']
docname = doc['docname']
doc = frappe.get_doc(doctype, docname)
doc.update(ddoc)
doc.save()
except:
existing_doc = frappe.get_doc(doc.pop("doctype"), doc.pop("docname"))
existing_doc.update(doc)
existing_doc.save()
except Exception:
failed_docs.append({
'doc': doc,
'exc': frappe.utils.get_traceback()
})

return {'failed_docs': failed_docs}

@frappe.whitelist()
Expand Down Expand Up @@ -399,4 +398,4 @@ def is_document_amended(doctype, docname):
except frappe.db.InternalError:
pass

return False
return False
7 changes: 4 additions & 3 deletions frappe/core/doctype/user/user.json
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@
"fieldname": "role_profile_name",
"fieldtype": "Link",
"label": "Role Profile",
"options": "Role Profile"
"options": "Role Profile",
"permlevel": 1
},
{
"fieldname": "roles_html",
Expand Down Expand Up @@ -586,7 +587,7 @@
"idx": 413,
"image_field": "user_image",
"max_attachments": 5,
"modified": "2019-10-22 14:16:34.810223",
"modified": "2021-10-18 16:56:05.578379",
"modified_by": "Administrator",
"module": "Core",
"name": "User",
Expand Down Expand Up @@ -620,4 +621,4 @@
"sort_order": "DESC",
"title_field": "full_name",
"track_changes": 1
}
}
7 changes: 6 additions & 1 deletion frappe/model/base_document.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,12 @@ def get_valid_dict(self, sanitize=True, convert_dates_to_str=False, ignore_nulls
if isinstance(d[fieldname], list) and df.fieldtype not in table_fields:
frappe.throw(_('Value for {0} cannot be a list').format(_(df.label)))

if convert_dates_to_str and isinstance(d[fieldname], (datetime.datetime, datetime.time, datetime.timedelta)):
if convert_dates_to_str and isinstance(d[fieldname], (
datetime.datetime,
datetime.date,
datetime.time,
datetime.timedelta
)):
d[fieldname] = str(d[fieldname])

if d[fieldname] == None and ignore_nulls:
Expand Down
3 changes: 2 additions & 1 deletion frappe/public/js/frappe/form/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,8 @@ frappe.ui.form.Layout = Class.extend({
// next row
grid_row.grid.grid_rows[grid_row.doc.idx].toggle_view(true);
}
} else {
} else if (!shift) {
// End of tab navigation
$(this.primary_button).focus();
}
}
Expand Down
2 changes: 1 addition & 1 deletion frappe/public/js/frappe/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ frappe.set_route = function() {
return null;
} else {
a = String(a);
if (a && a.match(/[%'"]/)) {
if (a && !a.includes('/') && a.match(/[%'"\s\t]/)) {
// if special chars, then encode
a = encodeURIComponent(a);
}
Expand Down
1 change: 1 addition & 0 deletions frappe/public/js/frappe/views/communication.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ frappe.views.CommunicationComposer = Class.extend({

this.dialog.fields_dict["email_template"].df.onchange = () => {
var email_template = me.dialog.fields_dict.email_template.get_value();
if (!email_template) return;

var prepend_reply = function(reply) {
if(me.reply_added===email_template) {
Expand Down

0 comments on commit 03d50ce

Please sign in to comment.