chore(installed-applications): renamed doctype and docfields
This commit is contained in:
parent
ed74f52e20
commit
b48d2921bb
5 changed files with 28 additions and 27 deletions
|
|
@ -4,27 +4,11 @@
|
|||
"doctype": "DocType",
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"application_name",
|
||||
"application_version",
|
||||
"app_name",
|
||||
"app_version",
|
||||
"git_branch"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"fieldname": "application_name",
|
||||
"fieldtype": "Data",
|
||||
"in_list_view": 1,
|
||||
"label": "Application Name",
|
||||
"read_only": 1,
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "application_version",
|
||||
"fieldtype": "Data",
|
||||
"in_list_view": 1,
|
||||
"label": "Application Version",
|
||||
"read_only": 1,
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "git_branch",
|
||||
"fieldtype": "Data",
|
||||
|
|
@ -32,14 +16,30 @@
|
|||
"label": "Git Branch",
|
||||
"read_only": 1,
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "app_name",
|
||||
"fieldtype": "Data",
|
||||
"in_list_view": 1,
|
||||
"label": "Application Name",
|
||||
"read_only": 1,
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "app_version",
|
||||
"fieldtype": "Data",
|
||||
"in_list_view": 1,
|
||||
"label": "Application Version",
|
||||
"read_only": 1,
|
||||
"reqd": 1
|
||||
}
|
||||
],
|
||||
"istable": 1,
|
||||
"links": [],
|
||||
"modified": "2020-05-11 19:54:07.141641",
|
||||
"modified": "2020-05-12 10:09:49.148087",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Core",
|
||||
"name": "Installed Application Details",
|
||||
"name": "Installed Application",
|
||||
"owner": "Administrator",
|
||||
"permissions": [],
|
||||
"quick_entry": 1,
|
||||
|
|
@ -6,5 +6,5 @@ from __future__ import unicode_literals
|
|||
# import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
class InstalledApplicationDetails(Document):
|
||||
class InstalledApplication(Document):
|
||||
pass
|
||||
|
|
@ -12,13 +12,13 @@
|
|||
"fieldname": "installed_applications",
|
||||
"fieldtype": "Table",
|
||||
"label": "Installed Applications",
|
||||
"options": "Installed Application Details",
|
||||
"options": "Installed Application",
|
||||
"read_only": 1
|
||||
}
|
||||
],
|
||||
"issingle": 1,
|
||||
"links": [],
|
||||
"modified": "2020-05-11 19:52:47.775562",
|
||||
"modified": "2020-05-12 10:09:14.310622",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Core",
|
||||
"name": "Installed Applications",
|
||||
|
|
|
|||
|
|
@ -7,11 +7,12 @@ import frappe
|
|||
from frappe.model.document import Document
|
||||
|
||||
class InstalledApplications(Document):
|
||||
def before_save(self):
|
||||
def update_versions(self):
|
||||
self.delete_key("installed_applications")
|
||||
for app in frappe.utils.get_installed_apps_info():
|
||||
self.append("installed_applications", {
|
||||
"application_name": app.get("app_name"),
|
||||
"application_version": app.get("version"),
|
||||
"app_name": app.get("app_name"),
|
||||
"app_version": app.get("version"),
|
||||
"git_branch": app.get("branch")
|
||||
})
|
||||
})
|
||||
self.save()
|
||||
Loading…
Add table
Reference in a new issue