From 02a17197a1837e65aa57d29ba3421e282e758535 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Tue, 24 May 2022 13:14:49 +0000 Subject: [PATCH] global publish throw comment --- smart_service/transactions/doctype/publish/publish.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/smart_service/transactions/doctype/publish/publish.py b/smart_service/transactions/doctype/publish/publish.py index 73c9e78..a7e2bcb 100644 --- a/smart_service/transactions/doctype/publish/publish.py +++ b/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")