Browse Source

Role master doc fields update

version2
venkataakhil 1 year ago
parent
commit
ef64008c0b
  1. 4
      smart_service/masters/doctype/role_master/role_master.js
  2. 38
      smart_service/masters/doctype/role_master/role_master.json
  3. 18
      smart_service/phase_2/doctype/publish_test/publish_test.py

4
smart_service/masters/doctype/role_master/role_master.js

@ -56,11 +56,11 @@ frappe.ui.form.on('Role Master', {
module_html ="<div class='row' style='margin-left:5px !important;'>"
r.message.map(val => {
if (!frm.is_new() &&frm.doc.modules &&frm.doc.modules.includes(val.module_name) ) {
module_html += "<div class='col-2' style='padding-left:0px !important;padding-right:0px !important'>"
module_html += "<div class='col-3' style='padding-left:0px !important;padding-right:0px !important'>"
module_html += "<input type='checkbox' id=" +"'"+ val.name +"'"+ " name='vehicle1' value=" +"'"+ val.module_name +"'"+ " checked>"
module_html += "<label for=" + val.name + " style='padding-right:20px'>" + val.module_name + "</label></div>"
} else {
module_html += "<div class='col-2' style='padding-left:0px !important;padding-right:0px !important'>"
module_html += "<div class='col-3' style='padding-left:0px !important;padding-right:0px !important'>"
module_html += "<input type='checkbox' id=" +"'"+ val.name +"'"+ " name='vehicle1' value=" +"'"+ val.module_name +"'"+ " >"
module_html += "<label for=" + val.name + " style='padding-right:20px'>" + val.module_name + "</label></div>"
}

38
smart_service/masters/doctype/role_master/role_master.json

@ -9,14 +9,12 @@
"engine": "InnoDB",
"field_order": [
"role",
"module_name_configuration",
"module_master_html",
"column_break_ffrrr",
"active_status",
"display_order",
"my_id",
"modules",
"skill_id"
"skill_id",
"section_break_bkwnr",
"module_name_configuration",
"module_master_html"
],
"fields": [
{
@ -31,28 +29,6 @@
"fieldname": "column_break_ffrrr",
"fieldtype": "Column Break"
},
{
"fieldname": "active_status",
"fieldtype": "Select",
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Active Status",
"options": "Active\nInactive"
},
{
"fieldname": "display_order",
"fieldtype": "Int",
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Display Order"
},
{
"fieldname": "my_id",
"fieldtype": "Int",
"hidden": 1,
"in_list_view": 1,
"label": "My ID"
},
{
"fieldname": "module_master_html",
"fieldtype": "HTML",
@ -73,11 +49,15 @@
"fieldname": "skill_id",
"fieldtype": "Data",
"label": "Skill Id"
},
{
"fieldname": "section_break_bkwnr",
"fieldtype": "Section Break"
}
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2023-08-14 12:33:27.319600",
"modified": "2023-08-16 14:50:58.500228",
"modified_by": "Administrator",
"module": "Masters",
"name": "Role Master",

18
smart_service/phase_2/doctype/publish_test/publish_test.py

@ -51,9 +51,13 @@ class PublishTest(Document):
def on_submit(self):
if self.docstatus == 1 and self.publish_status == 'To Publish' and self.publish_module == 'Others' and self.publish_type == 'Internal':
if len(self.repair_checksheet_publish)>0:
repair_checksheet_publish(self.vehicle, self.vehicle_id, self.language, self.publish_type,
self.release_description, self.variant, self.repair_checksheet_publish)
feature_finder_publish(self.vehicle, self.vehicle_id, self.language, self.publish_type,
repair_checksheet_publish(self.vehicle, self.vehicle_id,
self.language, self.publish_type,
self.release_description, self.variant,
self.repair_checksheet_publish)
feature_finder_publish(self.vehicle, self.vehicle_id,
self.language, self.publish_type,
self.release_description,self.feature_finder_publish)
update_publish_status = frappe.db.sql(
"""update `tabPublish Test` set publish_status='Published' where name='{0}'""".format(self.name))
@ -591,7 +595,7 @@ def feature_finder_publish(vehicle=None,vehicle_id=None,
for i in parent:
feature_finder = feature_finder_data(
vehicle, language, publish_type, i.parent)
vehicle, language, publish_type, i.parent1)
if feature_finder['status'] == 1:
@ -600,14 +604,14 @@ def feature_finder_publish(vehicle=None,vehicle_id=None,
if len(feature_finder['data']):
feature_finder_tmp.append(
feature_finder['data'][0])
frappe.msgprint(str(feature_finder_tmp))
feature_finder_tmp=get_latest_data({'data':feature_finder_tmp},{'data':[]})
# if publish_feature_finder == 1:
""" Save publish file """
vehicle_data['data'] = feature_finder_tmp
frappe.msgprint(str(file_path))
with open(file_path, 'w') as outfile:
outfile.write(json.dumps(vehicle_data, indent=4, default=str))
@ -725,7 +729,7 @@ def repair_checksheet_data(vehicle=None, language=None,
def feature_finder_data(vehicle=None, language=None,
publish_type=None, parent=None):
try:
frappe.msgprint(str(parent))
logger_file = f'{vehicle} - {language} - {publish_type} - {module_name} - fetch data'
logger = frappe.logger(logger_file,
allow_site=True, file_count=100)

Loading…
Cancel
Save