fix(minor): set default app in module and workspace

This commit is contained in:
Rushabh Mehta 2024-09-23 20:42:38 +05:30
parent 895c589034
commit 5437e895de
3 changed files with 12 additions and 0 deletions

View file

@ -26,6 +26,12 @@ class ModuleDef(Document):
restrict_to_domain: DF.Link | None
# end: auto-generated types
def validate(self):
from frappe.modules.utils import get_module_app
if not self.app_name:
self.app_name = get_module_app(self.name)
def on_update(self):
"""If in `developer_mode`, create folder for module and
add in `modules.txt` of app if missing."""

View file

@ -85,6 +85,11 @@ class Workspace(Document):
if d.link_type == "Report" and d.is_query_report != 1:
d.report_ref_doctype = frappe.get_value("Report", d.link_to, "ref_doctype")
if not self.app and self.module:
from frappe.modules.utils import get_module_app
self.app = get_module_app(self.module)
def clear_cache(self):
super().clear_cache()
if self.for_user:

View file

@ -240,3 +240,4 @@ frappe.patches.v16_0.switch_default_sort_order
frappe.integrations.doctype.oauth_client.patches.set_default_allowed_role_in_oauth_client
execute:frappe.db.set_single_value("Workspace Settings", "workspace_setup_completed", 1)
frappe.patches.v16_0.add_app_launcher_in_navbar_settings
frappe.desk.doctype.workspace.patches.update_app