fix: controller path for exporting types (#28251)
This commit is contained in:
parent
46a0814287
commit
ce01f8ada8
1 changed files with 7 additions and 1 deletions
|
|
@ -17,6 +17,7 @@ from keyword import iskeyword
|
|||
from pathlib import Path
|
||||
|
||||
import frappe
|
||||
from frappe import scrub
|
||||
from frappe.types import DF
|
||||
|
||||
field_template = "{field}: {type}"
|
||||
|
|
@ -59,7 +60,12 @@ class TypeExporter:
|
|||
|
||||
self.imports = {"from frappe.types import DF"}
|
||||
self.indent = "\t"
|
||||
self.controller_path = Path(inspect.getfile(get_controller(self.doctype)))
|
||||
self.controller_path = (
|
||||
Path(frappe.get_module_path(doc.module))
|
||||
/ "doctype"
|
||||
/ scrub(self.doctype)
|
||||
/ f"{scrub(self.doctype)}.py"
|
||||
)
|
||||
|
||||
def export_types(self):
|
||||
self._guess_indentation()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue