浏览代码

fix: Rename Property Setter on Print Format Rename

This fixes the default print format set when Custom Print Formats are
renamed
version-14
Gavin D'souza 3 年前
父节点
当前提交
7a68d797e9
共有 1 个文件被更改,包括 12 次插入1 次删除
  1. +12
    -1
      frappe/printing/doctype/print_format/print_format.py

+ 12
- 1
frappe/printing/doctype/print_format/print_format.py 查看文件

@@ -71,8 +71,19 @@ class PrintFormat(Document):

self.export_doc()

def after_rename(self, old: str, new: str, *args, **kwargs):
if self.doc_type:
frappe.clear_cache(doctype=self.doc_type)

# update property setter default_print_format if set
frappe.db.set_value("Property Setter", {
"doctype_or_field": "DocType",
"doc_type": self.doc_type,
"property": "default_print_format",
"value": old,
}, "value", new)

def export_doc(self):
# export
from frappe.modules.utils import export_module_json
export_module_json(self, self.standard == 'Yes', self.module)



正在加载...
取消
保存