diff --git a/frappe/modules/import_file.py b/frappe/modules/import_file.py index eb8f53d0b6..e0f9abe2ad 100644 --- a/frappe/modules/import_file.py +++ b/frappe/modules/import_file.py @@ -248,7 +248,7 @@ def load_code_properties(doc, path): if hasattr(doc, "get_code_fields"): dirname, filename = os.path.split(path) for key, extn in doc.get_code_fields().items(): - codefile = os.path.join(dirname, filename.split(".", 1)[0] + "." + extn) + codefile = os.path.join(dirname, filename[: filename.rfind(".")] + "." + extn) if os.path.exists(codefile): with open(codefile) as txtfile: doc.set(key, txtfile.read())