Merge pull request #24446 from deepeshgarg007/patch-fix-1-new

fix: Project Template patch
This commit is contained in:
Deepesh Garg 2021-01-25 10:37:43 +05:30 committed by GitHub
commit 164079127f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,16 +7,19 @@ import frappe
def execute(): def execute():
frappe.reload_doc("projects", "doctype", "project_template") frappe.reload_doc("projects", "doctype", "project_template")
frappe.reload_doc("projects", "doctype", "project_template_task") frappe.reload_doc("projects", "doctype", "project_template_task")
frappe.reload_doc("projects", "doctype", "project_template")
frappe.reload_doc("projects", "doctype", "task") frappe.reload_doc("projects", "doctype", "task")
for template_name in frappe.db.sql(""" # Update property setter status if any
select property_setter = frappe.db.get_value('Property Setter', {'doc_type': 'Task',
name 'field_name': 'status', 'property': 'options'})
from
`tabProject Template` """,
as_dict=1):
if property_setter:
property_setter_doc = frappe.get_doc('Property Setter', {'doc_type': 'Task',
'field_name': 'status', 'property': 'options'})
property_setter_doc.value += "\nTemplate"
property_setter_doc.save()
for template_name in frappe.get_all('Project Template'):
template = frappe.get_doc("Project Template", template_name.name) template = frappe.get_doc("Project Template", template_name.name)
replace_tasks = False replace_tasks = False
new_tasks = [] new_tasks = []