Browse Source

Remove print, test procedure

master
venkataakhil 1 year ago
parent
commit
81ba662052
  1. 18
      smart_service/apis/support.py
  2. 2
      smart_service/transactions/doctype/procedure/procedure.js
  3. 6
      smart_service/transactions/doctype/procedure/procedure.py
  4. 4
      smart_service/transactions/doctype/publish/publish.json

18
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)

2
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",

6
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()

4
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",

Loading…
Cancel
Save