Merge branch 'develop' into merge_translated_doctypes

This commit is contained in:
Himanshu 2022-08-11 13:50:11 +01:00 committed by GitHub
commit 1bdfd0176a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 29 deletions

View file

@ -20,16 +20,6 @@ pull_request_rules:
- name: Automatic merge on CI success and review
conditions:
- status-success=Sider
- status-success=Check Commit Titles
- status-success=Python Unit Tests (MariaDB) (1)
- status-success=Python Unit Tests (MariaDB) (2)
- status-success=Python Unit Tests (Postgres) (1)
- status-success=Python Unit Tests (Postgres) (2)
- status-success=UI Tests (Cypress) (1)
- status-success=UI Tests (Cypress) (2)
- status-success=UI Tests (Cypress) (3)
- status-success=security/snyk (frappe)
- label!=dont-merge
- label!=squash
- "#approved-reviews-by>=1"
@ -38,15 +28,6 @@ pull_request_rules:
method: merge
- name: Automatic squash on CI success and review
conditions:
- status-success=Sider
- status-success=Python Unit Tests (MariaDB) (1)
- status-success=Python Unit Tests (MariaDB) (2)
- status-success=Python Unit Tests (Postgres) (1)
- status-success=Python Unit Tests (Postgres) (2)
- status-success=UI Tests (Cypress) (1)
- status-success=UI Tests (Cypress) (2)
- status-success=UI Tests (Cypress) (3)
- status-success=security/snyk (frappe)
- label!=dont-merge
- label=squash
- "#approved-reviews-by>=1"

View file

@ -0,0 +1,16 @@
frappe.listview_settings["Calendar View"] = {
button: {
show(doc) {
return doc.name;
},
get_label() {
return frappe.utils.icon("calendar", "sm");
},
get_description(doc) {
return __("View {0}", [`${doc.name}`]);
},
action(doc) {
frappe.set_route("List", doc.reference_doctype, "Calendar", doc.name);
},
},
};

View file

@ -493,7 +493,7 @@ def init_singles():
doc.flags.ignore_mandatory = True
doc.flags.ignore_validate = True
doc.save()
except ImportError:
except (ImportError, frappe.DoesNotExistError):
# The doctype exists, but controller is deleted,
# no need to attempt to init such single, ref: #16917
continue

View file

@ -38,21 +38,14 @@ $.extend(frappe.perm, {
has_perm: (doctype, permlevel, ptype, doc) => {
if (!permlevel) permlevel = 0;
if (!frappe.perm.doctype_perm[doctype]) {
frappe.perm.doctype_perm[doctype] = frappe.perm.get_perm(doctype);
frappe.perm.doctype_perm[doctype] = frappe.perm.get_perm(doctype, doc);
}
let perms = frappe.perm.doctype_perm[doctype];
if (!perms || !perms[permlevel]) return false;
let perm = !!perms[permlevel][ptype];
if (permlevel === 0 && perm && doc) {
let docinfo = frappe.model.get_docinfo(doctype, doc.name);
if (docinfo && !docinfo.permissions[ptype]) perm = false;
}
return perm;
return !!perms[permlevel][ptype];
},
get_perm: (doctype, doc) => {