l)+' Procedure Status to be updated, Please check the Publish Documents table.')
draft_procedure_status=frappe.db.sql(
"""select name from {0}.`tabPublish_Docs` where parent = '{1}' and update_procedure_status = 'Draft' and procedure_link is not null""".format(current_db_name,doc.name),as_dict=True)
"""select name from {0}.`tabPublish_Docs` where parent = "{1}" and update_procedure_status = 'Draft' and
publish_record=frappe.db.sql("""select name from {0}.`tabPublish_Docs` where update_procedure_status != procedure_status and update_procedure_status != 'Publish Ready' and parent = '{1}'""".format(
current_db_name,doc.name),as_dict=True)
publish_record=frappe.db.sql("""select name from {0}.`tabPublish_Docs` where update_procedure_status != procedure_status and
frappe.db.sql("""update {0}.`tabPublish` set version = '{1}' where name = '{2}'""".format(
frappe.db.sql("""update {0}.`tabPublish` set version = "{1}" where name = "{2}";""".format(
current_db_name,v,doc.name))
frappe.db.commit()
returnv
@ -172,9 +176,11 @@ def global_publish(doc):
doc=frappe.get_doc("Publish",doc)
current_db_name=frappe.conf.get("db_name")
procedure=frappe.db.sql(
"""select parent,name from {0}.`tabPublish_Docs` where parent = '{1}' and update_procedure_status='Publish Ready' and procedure_link is not null""".format(current_db_name,doc.name))
asset=frappe.db.sql("""select parent,name from {0}.`tabPublish_Docs` where parent = '{1}' and variant_mapping is not null and procedure_link is null""".format(
current_db_name,doc.name))
"""select parent,name from {0}.`tabPublish_Docs` where parent = "{1}" and update_procedure_status='Publish Ready' and
frappe.throw("There is no item for global publish")
@ -217,12 +223,14 @@ def global_publish(doc):
@frappe.whitelist()
defold_publish(vehicle,language):
current_db_name=frappe.conf.get("db_name")
publish_record=frappe.db.sql("""select name,publish_type from {0}.`tabPublish` where vehicle = '{1}' and language = '{2}' and publish_status='To Publish' and publish_type = 'Internal' and docstatus != '2'""".format(
current_db_name,vehicle,language),as_dict=True)
publish_record=frappe.db.sql("""select name,publish_type from {0}.`tabPublish` where vehicle = "{1}" and language = "{2}"
global_publish_record=frappe.db.sql("""select name,publish_type from {0}.`tabPublish` where vehicle = '{1}' and language = '{2}' and publish_status='To Publish' and publish_type = 'Global' and docstatus != '2'""".format(
current_db_name,vehicle,language),as_dict=True)
global_publish_record=frappe.db.sql("""select name,publish_type from {0}.`tabPublish` where vehicle = "{1}" and language = "{2}"
frappe.db.sql("""update {0}.`tabSystem Mapping_Sub System` set procedure_is_published = '1' where parent = '{1}' and systems = '{2}' and sub_systems = '{3}'""".format(
frappe.db.sql("""update {0}.`tabSystem Mapping_Sub System` set procedure_is_published = '1' where parent = "{1}"
vm_assets=frappe.db.sql("""select category,language,attach_file,active_status from {0}.`tabVariant Mapping_Assets` where parent = '{1}' and published = '0'""".format(
current_db_name,doc.name),as_dict=True)
vm_assets=frappe.db.sql("""select category,language,attach_file,active_status from {0}.`tabVariant Mapping_Assets`
system_map=frappe.db.sql("""select name from {0}.`tabSystem Mapping` where variant_mapping='{1}' and name = '{2}'""".format(
current_db_name,doc,name),as_dict=True)
system_map=frappe.db.sql("""select name from {0}.`tabSystem Mapping` where variant_mapping="{1}" and name = "{2}"; """.format(
current_db_name,doc,name),as_dict=1)
ifsystem_map:
forsinsystem_map:
doc=frappe.get_doc("System Mapping",s.name)
system_asset=frappe.db.sql("""select systems,language,active_status,system_asset from {0}.`tabSystem Mapping_System Assets` where parent = '{1}' and published = '0'""".format(
current_db_name,s.name),as_dict=True)
system_asset=frappe.db.sql("""select systems,language,active_status,system_asset from {0}.`tabSystem Mapping_System Assets`
system_map=frappe.db.sql("""select name from {0}.`tabSystem Mapping` where variant_mapping='{1}' and name = '{2}'""".format(
current_db_name,doc,name),as_dict=True)
defget_system(doc,name,lang):
system_map=frappe.db.sql("""select name from {0}.`tabSystem Mapping` where variant_mapping="{1}" and name = "{2}" and language = "{3}";""".format(
current_db_name,doc,name,lang),as_dict=1)
ifsystem_map:
forsinsystem_map:
doc=frappe.get_doc("System Mapping",s.name)
system=frappe.db.sql("""select systems,sub_systems,active_status,symptom,component,estimate_time,rts,component,mat,procedure_status,`procedure` from {0}.`tabSystem Mapping_Sub System` where parent = '{1}' and procedure_is_published = '0'""".format(