[enhancement] document management system
diff --git a/erpnext/hr/doctype/employee/employee.py b/erpnext/hr/doctype/employee/employee.py
index a2bb10c..0d619c2 100644
--- a/erpnext/hr/doctype/employee/employee.py
+++ b/erpnext/hr/doctype/employee/employee.py
@@ -89,7 +89,7 @@
user.user_image = self.image
try:
frappe.get_doc({
- "doctype": "File Data",
+ "doctype": "File",
"file_name": self.image,
"attached_to_doctype": "User",
"attached_to_name": self.user_id
diff --git a/erpnext/patches/v4_0/reset_permissions_for_masters.py b/erpnext/patches/v4_0/reset_permissions_for_masters.py
index b1b56b3..a718cb4 100644
--- a/erpnext/patches/v4_0/reset_permissions_for_masters.py
+++ b/erpnext/patches/v4_0/reset_permissions_for_masters.py
@@ -9,7 +9,7 @@
"Blog Category", "Blog Settings", "Blogger", "Branch", "Brand", "Buying Settings",
"Comment", "Communication", "Company", "Contact Us Settings",
"Country", "Currency", "Currency Exchange", "Deduction Type", "Department",
- "Designation", "Earning Type", "Event", "Feed", "File Data", "Fiscal Year",
+ "Designation", "Earning Type", "Event", "Feed", "File", "Fiscal Year",
"HR Settings", "Industry Type", "Leave Type", "Letter Head",
"Mode of Payment", "Module Def", "Naming Series", "POS Setting", "Print Heading",
"Report", "Role", "Selling Settings", "Stock Settings", "Supplier Type", "UOM"):
diff --git a/erpnext/patches/v5_0/execute_on_doctype_update.py b/erpnext/patches/v5_0/execute_on_doctype_update.py
index 4fc640e..98cbd29 100644
--- a/erpnext/patches/v5_0/execute_on_doctype_update.py
+++ b/erpnext/patches/v5_0/execute_on_doctype_update.py
@@ -4,5 +4,5 @@
import frappe
def execute():
- for dt in ("Stock Ledger Entry", "Communication", "Comment", "DefaultValue", "DocShare", "File Data", "ToDo", "Feed"):
+ for dt in ("Stock Ledger Entry", "Communication", "Comment", "DefaultValue", "DocShare", "File", "ToDo", "Feed"):
frappe.get_doc("DocType", dt).run_module_method("on_doctype_update")
\ No newline at end of file
diff --git a/erpnext/patches/v5_4/fix_missing_item_images.py b/erpnext/patches/v5_4/fix_missing_item_images.py
index d782cd1..1dffc21 100644
--- a/erpnext/patches/v5_4/fix_missing_item_images.py
+++ b/erpnext/patches/v5_4/fix_missing_item_images.py
@@ -37,7 +37,7 @@
frappe.db.set_value(row.doctype, row.name, "image", new_file_url, update_modified=False)
# set it as attachment of this item code
- file_data = frappe.get_doc("File Data", unlinked_files[file_url]["file"])
+ file_data = frappe.get_doc("File", unlinked_files[file_url]["file"])
file_data.attached_to_doctype = "Item"
file_data.attached_to_name = item_code
file_data.save()
@@ -65,20 +65,20 @@
# set content hash if missing
file_data_name = unlinked_files[file_url]["file"]
- if not frappe.db.get_value("File Data", file_data_name, "content_hash"):
+ if not frappe.db.get_value("File", file_data_name, "content_hash"):
with open(new_filename, "r") as f:
content_hash = get_content_hash(f.read())
- frappe.db.set_value("File Data", file_data_name, "content_hash", content_hash)
+ frappe.db.set_value("File", file_data_name, "content_hash", content_hash)
def get_unlinked_files(files_path):
- # find files that have the same name as a File Data doc
- # and the file_name mentioned in that File Data doc doesn't exist
+ # find files that have the same name as a File doc
+ # and the file_name mentioned in that File doc doesn't exist
# and it isn't already attached to a doc
unlinked_files = {}
files = os.listdir(files_path)
for file in files:
- if not frappe.db.exists("File Data", {"file_name": file}):
- file_data = frappe.db.get_value("File Data", {"name": file},
+ if not frappe.db.exists("File", {"file_name": file}):
+ file_data = frappe.db.get_value("File", {"name": file},
["file_name", "attached_to_doctype", "attached_to_name"], as_dict=True)
if (file_data