From 81ba662052e817680d950123bca4af1c1faa10de Mon Sep 17 00:00:00 2001 From: venkataakhil Date: Mon, 12 Jun 2023 14:16:02 +0530 Subject: [PATCH] Remove print, test procedure --- smart_service/apis/support.py | 18 +++++++++--------- .../doctype/procedure/procedure.js | 2 +- .../doctype/procedure/procedure.py | 6 +----- .../transactions/doctype/publish/publish.json | 4 +++- 4 files changed, 14 insertions(+), 16 deletions(-) diff --git a/smart_service/apis/support.py b/smart_service/apis/support.py index 83a574d..8b35d5e 100644 --- a/smart_service/apis/support.py +++ b/smart_service/apis/support.py @@ -24,15 +24,15 @@ base_url = os.path.expanduser( # return str(e) # return True - -@frappe.whitelist(allow_guest=1) -def reset_all_publish_assets(): - try: - frappe.db.sql( - 'update `tabSystem Mapping_System Assets` set published=0;') - except Exception as e: - return str(e) - return True +""" Working """ +# @frappe.whitelist(allow_guest=1) +# def reset_all_publish_assets(): +# try: +# frappe.db.sql( +# 'update `tabSystem Mapping_System Assets` set published=0;') +# except Exception as e: +# return str(e) +# return True @frappe.whitelist(allow_guest=1) diff --git a/smart_service/transactions/doctype/procedure/procedure.js b/smart_service/transactions/doctype/procedure/procedure.js index 679aec8..abf3127 100644 --- a/smart_service/transactions/doctype/procedure/procedure.js +++ b/smart_service/transactions/doctype/procedure/procedure.js @@ -225,7 +225,7 @@ frappe.ui.form.on('Procedure', { } }, - before_workflow_action: (frm) => { + before_workflow_action1: (frm) => { if ((frm.doc.workflow_state == 'Review Pending' || frm.doc.workflow_state == 'Publish Ready') && (frm.selected_workflow_action == 'Revoke')) { frappe.call({ "method": "smart_service.transactions.doctype.procedure.procedure.get_publish_details", diff --git a/smart_service/transactions/doctype/procedure/procedure.py b/smart_service/transactions/doctype/procedure/procedure.py index 106337e..b4d861e 100644 --- a/smart_service/transactions/doctype/procedure/procedure.py +++ b/smart_service/transactions/doctype/procedure/procedure.py @@ -228,9 +228,7 @@ def update_system_id(name): doc = frappe.get_doc("Procedure", name) for table in doc.get("procedure_details"): if table.content_type == "Link": - procedure = table.temp_cnt - frappe.msgprint("call" + str(procedure)) system_mapping = frappe.db.sql("""select name from {0}.`tabSystem Mapping` where variant_mapping = '{1}' and language = '{2}'""".format( current_db_name, doc.variant_mapping, doc.language), as_dict=True) if system_mapping: @@ -238,14 +236,12 @@ def update_system_id(name): sys_procedure = frappe.db.sql("""select systems,sub_systems,system_id,sub_system_id,`procedure` from {0}.`tabSystem Mapping_Sub System` where parent = '{1}' and `procedure` = '{2}'""".format( current_db_name, sm, table.temp_cnt), as_dict=True) if sys_procedure: - frappe.msgprint("sys_procedure" + str(sys_procedure[0]['procedure']) +"DATA " + str(table.temp_cnt)) if str(table.temp_cnt) == str(sys_procedure[0]['procedure']): - frappe.msgprint("inside " + str(sys_procedure[0]['system_id']) + ' ' +str(sys_procedure[0]['sub_system_id'])) + sys_id = doc.variant_mapping + ',' + \ str(sys_procedure[0]['system_id']) + ',' + \ str(sys_procedure[0]['sub_system_id']) table.system_id = sys_id - frappe.msgprint("ID " + str(sys_id)) frappe.db.sql("""update {0}.`tabProcedure_Details` set system_id = '{1}' where parent = '{2}' and temp_cnt = '{3}'""".format( current_db_name, sys_id, doc.name, table.temp_cnt)) frappe.db.commit() diff --git a/smart_service/transactions/doctype/publish/publish.json b/smart_service/transactions/doctype/publish/publish.json index 16fdd2d..3d2ede1 100644 --- a/smart_service/transactions/doctype/publish/publish.json +++ b/smart_service/transactions/doctype/publish/publish.json @@ -130,6 +130,8 @@ { "fieldname": "language", "fieldtype": "Link", + "in_filter": 1, + "in_list_view": 1, "label": "Language", "options": "Custom Languages", "read_only_depends_on": "eval:doc.publish_documents", @@ -309,7 +311,7 @@ "index_web_pages_for_search": 1, "is_submittable": 1, "links": [], - "modified": "2023-05-20 12:35:06.604859", + "modified": "2023-06-12 14:10:56.665241", "modified_by": "Administrator", "module": "Transactions", "name": "Publish",