get_count=frappe.db.sql(f"""select name from `tabFeature Finder Specification` where parent='{doc_name}' and feature_type='{val.get('feature_type')}'""",as_dict=1)
get_count=len(get_count)+1
frappe.log_error("displayorder",str(get_count))
result=frappe.get_doc("Feature Finder",doc_name)
result.tab_ref=tab_ref
result.save()
frappe.db.commit()
ifval.get('name')!=None:
doc=frappe.get_doc("Feature Finder Specification",val['name'])
get_count=frappe.db.sql(f"""select name from `tabFeature Finder Images` where parent='{doc_name}' and feature_type='{val.get('feature_type')}'""",as_dict=1)
get_count=len(get_count)+1
result=frappe.get_doc("Feature Finder",doc_name)
result.tab_ref=tab_ref
result.save()
frappe.db.commit()
ifval.get('name')!=None:
doc=frappe.get_doc("Feature Finder Images",val['name'])
get_count=frappe.db.sql(f"""select name from `tabFeature Finder Content` where parent='{doc_name}' and feature_type='{val.get('feature_type')}'""",as_dict=1)
get_count=len(get_count)+1
result=frappe.get_doc("Feature Finder",doc_name)
result.tab_ref=tab_ref
result.save()
frappe.db.commit()
ifval.get('name')!=None:
doc=frappe.get_doc("Feature Finder Content",val['name'])
data=frappe.db.sql(f"""select * from `tabFeature Finder` where vehicle='{vehicle}' and variant_id='{variant}' and language='{language_label}' and is_published=0""",as_dict=1)
data=frappe.db.sql(
f"""select * from `tabFeature Finder` where vehicle='{vehicle}' and variant_id='{variant}' and language='{language_label}' and is_published=0""",as_dict=1)
ver=frappe.db.sql("""select max(creation) from {0}.tabPublish where vehicle = "{1}" and language = "{2}";""".format(
ver=frappe.db.sql("""select max(version) from {0}.tabPublish where vehicle = "{1}" and language = "{2}" and publish_module!="Automotive System";""".format(
ver=frappe.db.sql("""select max(version) from `tabPublish` where vehicle = "{vehi}" and language = "{lang}" and publish_module!="Automotive System";"""
.format(vehi=vehicle,lang=lang))
v=0.0
ifpublish_type=='Global':
ifver[0][0]==None:
v=1.0
else:
v=int(float(ver[0][0]))+1.0
# elif publish_type == 'Internal':
# if ver[0][0] == None:
# v = 0.01
# else:
# v = float(ver[0][0]) + 0.01
# v = "{:.2f}".format(v)
# doc.version = v
# frappe.db.sql("""update {0}.`tabPublish` set version = "{1}" where name = "{2}";""".format(
# current_db_name, v, doc.name))
# frappe.db.commit()
# return v
elifpublish_type=='Internal':
ifver[0][0]==None:
v=0.01
else:
v=float(ver[0][0])+0.01
v="{:.2f}".format(v)
doc.version=v
frappe.db.sql("""update {0}.`tabPublish` set version = "{1}" where name = "{2}";""".format(