|
|
@ -125,12 +125,6 @@ class Publish(Document): |
|
|
|
variant = self.variant_mapping_details.split('/n') |
|
|
|
|
|
|
|
|
|
|
|
# for v in variant: |
|
|
|
# frappe.log_error('v', str(v)) |
|
|
|
# if v: |
|
|
|
# update_publish_mapping( |
|
|
|
# self.vehicle, v, self.language, self.publish_module) |
|
|
|
|
|
|
|
def on_cancel(self): |
|
|
|
# Published document should not allow to cancel |
|
|
|
if self.publish_status == "Published": |
|
|
@ -782,7 +776,6 @@ def feature_finder_publish(vehicle=None, vehicle_id=None, |
|
|
|
vehi_data, new_variant_name, feature_finder_tmp) |
|
|
|
|
|
|
|
elif os.path.isfile(file_path) and publish_type == 'Global': |
|
|
|
frappe.msgprint(str('called')) |
|
|
|
with open(global_file_path) as f: |
|
|
|
published_data = json.load(f) |
|
|
|
for i in parent: |
|
|
@ -893,7 +886,6 @@ def qwik_service_publish(vehicle = None , vehicle_id = None,variant = None, |
|
|
|
vehi_data, new_variant_name, qwik_service_tmp) |
|
|
|
|
|
|
|
elif os.path.isfile(global_file_path) and publish_type == 'Global': |
|
|
|
frappe.msgprint(str('compare_internal')) |
|
|
|
with open(global_file_path) as f: |
|
|
|
published_data = json.load(f) |
|
|
|
for i in parent: |
|
|
@ -903,7 +895,7 @@ def qwik_service_publish(vehicle = None , vehicle_id = None,variant = None, |
|
|
|
publish_qwik_service = 1 |
|
|
|
qwik_service_tmp.append( |
|
|
|
qwik_service['data'][0]) |
|
|
|
frappe.log_error(str(qwik_service_tmp)) |
|
|
|
|
|
|
|
qwik_service_tmp = create_df(qwik_service_tmp) |
|
|
|
|
|
|
|
|
|
|
@ -944,13 +936,7 @@ def qwik_service_publish(vehicle = None , vehicle_id = None,variant = None, |
|
|
|
def special_tool_publish(vehicle, vehicle_id, |
|
|
|
publish_type, release_description, |
|
|
|
parent=None): |
|
|
|
# special_tool_publish(self.vehicle, self.vehicle_id, |
|
|
|
# self.publish_type, |
|
|
|
# self.release_description, |
|
|
|
# self.special_tool_publish_docs) |
|
|
|
|
|
|
|
try: |
|
|
|
frappe.log_error(str(parent)) |
|
|
|
logger_file = f'{vehicle} - {publish_type} - special tool' |
|
|
|
logger = frappe.logger(logger_file, allow_site=True, file_count=100) |
|
|
|
logger.info( |
|
|
@ -969,7 +955,7 @@ def special_tool_publish(vehicle, vehicle_id, |
|
|
|
vehicle.replace(' ', '-') + '-special_tool' + '.json' |
|
|
|
existing_global= folder_url + "/" + "Global" + "/" + \ |
|
|
|
vehicle.replace(' ', '-') + '-special_tool' + '.json' |
|
|
|
# frappe.msgprint(str(existing_global)) |
|
|
|
|
|
|
|
'''Append Published Data to Json''' |
|
|
|
logger.info( |
|
|
|
f'Special tool Data Append Start::{vehicle}-{publish_type}') |
|
|
@ -983,7 +969,6 @@ def special_tool_publish(vehicle, vehicle_id, |
|
|
|
|
|
|
|
'''update existing global json file''' |
|
|
|
if os.path.isfile(existing_global) and publish_type=='Internal': |
|
|
|
# frappe.msgprint(str('exiting')) |
|
|
|
with open(existing_global) as f: |
|
|
|
published_data = json.load(f) |
|
|
|
for i in parent: |
|
|
@ -992,11 +977,10 @@ def special_tool_publish(vehicle, vehicle_id, |
|
|
|
publish_special_tool = 1 |
|
|
|
special_tool_tmp.append( |
|
|
|
special_tool['data'][0]) |
|
|
|
frappe.log_error(str(special_tool_tmp)) |
|
|
|
|
|
|
|
special_tool_tmp = get_latest_data({'data': published_data['data']}, { |
|
|
|
'data': special_tool_tmp}) |
|
|
|
elif os.path.isfile(file_path) and publish_type=='Global': |
|
|
|
# frappe.msgprint(str('exiting Global')) |
|
|
|
with open(existing_global) as f: |
|
|
|
published_data = json.load(f) |
|
|
|
for i in parent: |
|
|
@ -1005,7 +989,7 @@ def special_tool_publish(vehicle, vehicle_id, |
|
|
|
publish_special_tool = 1 |
|
|
|
special_tool_tmp.append( |
|
|
|
special_tool['data'][0]) |
|
|
|
frappe.log_error(str(special_tool_tmp)) |
|
|
|
|
|
|
|
special_tool_tmp = get_latest_data({'data': published_data['data']}, { |
|
|
|
'data': special_tool_tmp}) |
|
|
|
|
|
|
@ -1013,13 +997,12 @@ def special_tool_publish(vehicle, vehicle_id, |
|
|
|
for i in parent: |
|
|
|
special_tool = special_tool_data( |
|
|
|
vehicle, publish_type, i.parent1) |
|
|
|
frappe.log_error(str(special_tool)) |
|
|
|
|
|
|
|
if special_tool['status'] == 1: |
|
|
|
publish_special_tool = 1 |
|
|
|
if len(special_tool['data'])>0: |
|
|
|
special_tool_tmp.append( |
|
|
|
special_tool['data'][0]) |
|
|
|
# frappe.msgprint(str(special_tool['data'][0])) |
|
|
|
special_tool_tmp = get_latest_data( |
|
|
|
{'data': special_tool_tmp}, {'data': []}) |
|
|
|
|
|
|
|