Browse Source

Merge pull request #12300 from prssanna/patch-fixes

version-14
Prssanna Desai 4 years ago
committed by GitHub
parent
commit
cb3e57f914
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 1 deletions
  1. +1
    -1
      frappe/core/doctype/doctype/doctype.py
  2. +1
    -0
      frappe/core/doctype/role/patches/v13_set_default_desk_properties.py
  3. +3
    -0
      frappe/desk/utils.py
  4. +1
    -0
      frappe/patches.txt
  5. +2
    -0
      frappe/patches/v13_0/rename_desk_page_to_workspace.py

+ 1
- 1
frappe/core/doctype/doctype/doctype.py View File

@@ -664,7 +664,7 @@ class DocType(Document):
if not re.match("^(?![\W])[^\d_\s][\w ]+$", name, **flags):
frappe.throw(_("DocType's name should start with a letter and it can only consist of letters, numbers, spaces and underscores"), frappe.NameError)

validate_route_conflict(self.doctype, self.name)
validate_route_conflict(self.doctype, self.name)

def validate_links_table_fieldnames(meta):
"""Validate fieldnames in Links table"""


+ 1
- 0
frappe/core/doctype/role/patches/v13_set_default_desk_properties.py View File

@@ -2,6 +2,7 @@ import frappe
from ..role import desk_properties

def execute():
frappe.reload_doctype('role')
for role in frappe.get_all('Role', ['name', 'desk_access']):
role_doc = frappe.get_doc('Role', role.name)
for key in desk_properties:


+ 3
- 0
frappe/desk/utils.py View File

@@ -7,6 +7,9 @@ def validate_route_conflict(doctype, name):
'''
Raises exception if name clashes with routes from other documents for /app routing
'''
if frappe.flags.ignore_route_conflict_validation:
return

all_names = []
for _doctype in ['Page', 'Workspace', 'DocType']:
all_names.extend([slug(d) for d in frappe.get_all(_doctype, pluck='name') if (doctype != _doctype and d != name)])


+ 1
- 0
frappe/patches.txt View File

@@ -316,6 +316,7 @@ frappe.patches.v13_0.delete_event_producer_and_consumer_keys
frappe.patches.v13_0.web_template_set_module #2020-10-05
frappe.patches.v13_0.remove_custom_link
execute:frappe.delete_doc("DocType", "Footer Item")
execute:frappe.reload_doctype('user')
execute:frappe.reload_doctype('docperm')
frappe.patches.v13_0.replace_field_target_with_open_in_new_tab
frappe.core.doctype.role.patches.v13_set_default_desk_properties


+ 2
- 0
frappe/patches/v13_0/rename_desk_page_to_workspace.py View File

@@ -7,7 +7,9 @@ def execute():
# this patch was not added initially, so this page might still exist
frappe.delete_doc('DocType', 'Desk Page')
else:
frappe.flags.ignore_route_conflict_validation = True
rename_doc('DocType', 'Desk Page', 'Workspace')
frappe.flags.ignore_route_conflict_validation = False

rename_doc('DocType', 'Desk Chart', 'Workspace Chart', ignore_if_exists=True)
rename_doc('DocType', 'Desk Shortcut', 'Workspace Shortcut', ignore_if_exists=True)


Loading…
Cancel
Save