Browse Source

global publish throw comment

master
Ubuntu 2 years ago
parent
commit
02a17197a1
  1. 10
      smart_service/transactions/doctype/publish/publish.py

10
smart_service/transactions/doctype/publish/publish.py

@ -168,11 +168,11 @@ def global_publish(doc):
if not procedure:
frappe.throw("There is no item for global publish")
max_internal_ver = frappe.db.sql('''SELECT max(version) as max_version,name as name,publish_status as p FROM {}.tabPublish where vehicle='{}' and language ='{}' and publish_status = 'To Publish' and publish_type ='Internal';'''.format(current_db_name,doc.vehicle,doc.language),as_dict=True)
if max_internal_ver:
for v in max_internal_ver:
if str(doc.version) < str(v.max_version):
frappe.throw('Please publish Internal Publish Version ' + str(v.max_version) + ' for ' + str(v.name))
# max_internal_ver = frappe.db.sql('''SELECT max(version) as max_version,name as name,publish_status as p FROM {}.tabPublish where vehicle='{}' and language ='{}' and publish_status = 'To Publish' and publish_type ='Internal';'''.format(current_db_name,doc.vehicle,doc.language),as_dict=True)
# if max_internal_ver:
# for v in max_internal_ver:
# if str(doc.version) < str(v.max_version):
# frappe.throw('Please publish Internal Publish Version ' + str(v.max_version) + ' for ' + str(v.name))
publish_type = "Global"
publish_record = frappe.new_doc("Publish")

Loading…
Cancel
Save