瀏覽代碼

fix(Custom DocPerm): Use Link type instead of Data for parent (#15715)

* fix: Use Link type instead of Data for parent

This makes sure frappe.rename_doc updates linked doctype records

* Revert "fix: Use Link type instead of Data for parent"

This reverts commit 93b3735106.

* fix(rename_doc): Handle re-linking Custom DocPerm records
version-14
gavin 3 年之前
committed by GitHub
父節點
當前提交
d78b496208
沒有發現已知的金鑰在資料庫的簽署中 GPG 金鑰 ID: 4AEE18F83AFDEB23
共有 1 個檔案被更改,包括 3 行新增0 行删除
  1. +3
    -0
      frappe/model/rename_doc.py

+ 3
- 0
frappe/model/rename_doc.py 查看文件

@@ -80,6 +80,7 @@ def rename_doc(

if doctype=='DocType':
rename_doctype(doctype, old, new, force)
update_customizations(old, new)

update_attachments(doctype, old, new)

@@ -174,6 +175,8 @@ def update_user_settings(old, new, link_fields):
else:
continue

def update_customizations(old: str, new: str) -> None:
frappe.db.set_value("Custom DocPerm", {"parent": old}, "parent", new, update_modified=False)

def update_attachments(doctype, old, new):
try:


Loading…
取消
儲存