Merge pull request #17124 from s-aga-r/fix/user-type

This commit is contained in:
Suraj Shetty 2022-06-15 16:13:31 +05:30 committed by GitHub
commit 444c2db1c4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 17 deletions

View file

@ -3,13 +3,8 @@
frappe.ui.form.on('User Type', {
refresh: function(frm) {
frm.toggle_display('is_standard', frappe.boot.developer_mode);
frm.set_df_property('is_standard', 'read_only', !frappe.boot.developer_mode);
const fields = ['role', 'apply_user_permission_on', 'user_id_field',
'user_doctypes', 'user_type_modules'];
frm.toggle_display(fields, !frm.doc.is_standard);
if (frm.is_new() && !frappe.boot.developer_mode)
frm.set_value('is_standard', 1);
frm.set_query('document_type', 'user_doctypes', function() {
return {

View file

@ -22,9 +22,11 @@
"fields": [
{
"default": "0",
"depends_on": "eval: frappe.boot.developer_mode",
"fieldname": "is_standard",
"fieldtype": "Check",
"label": "Is Standard"
"label": "Is Standard",
"read_only_depends_on": "eval: !frappe.boot.developer_mode"
},
{
"depends_on": "eval: !doc.is_standard",
@ -33,21 +35,21 @@
"label": "Document Types and Permissions"
},
{
"depends_on": "eval: !doc.is_standard",
"fieldname": "user_doctypes",
"fieldtype": "Table",
"label": "Document Types",
"mandatory_depends_on": "eval: !doc.is_standard",
"options": "User Document Type",
"read_only": 1
"options": "User Document Type"
},
{
"depends_on": "eval: !doc.is_standard",
"fieldname": "role",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Role",
"mandatory_depends_on": "eval: !doc.is_standard",
"options": "Role",
"read_only": 1
"options": "Role"
},
{
"fieldname": "select_doctypes",
@ -62,13 +64,13 @@
"fieldtype": "Column Break"
},
{
"depends_on": "eval: !doc.is_standard",
"description": "Can only list down the document types which has been linked to the User document type.",
"fieldname": "apply_user_permission_on",
"fieldtype": "Link",
"label": "Apply User Permission On",
"mandatory_depends_on": "eval: !doc.is_standard",
"options": "DocType",
"read_only": 1
"options": "DocType"
},
{
"depends_on": "eval: !doc.is_standard",
@ -81,8 +83,7 @@
"fieldname": "user_id_field",
"fieldtype": "Select",
"label": "User Id Field",
"mandatory_depends_on": "eval: !doc.is_standard",
"read_only": 1
"mandatory_depends_on": "eval: !doc.is_standard"
},
{
"depends_on": "eval: !doc.is_standard",
@ -93,6 +94,7 @@
{
"fieldname": "user_type_modules",
"fieldtype": "Table",
"label": "User Type Module",
"no_copy": 1,
"options": "User Type Module",
"print_hide": 1,
@ -107,10 +109,11 @@
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2021-03-12 16:25:18.639050",
"modified": "2022-06-09 14:00:36.820306",
"modified_by": "Administrator",
"module": "Core",
"name": "User Type",
"naming_rule": "Set by user",
"owner": "Administrator",
"permissions": [
{
@ -137,5 +140,6 @@
],
"sort_field": "modified",
"sort_order": "DESC",
"states": [],
"track_changes": 1
}