Browse Source

mst category master

version2
venkata akhil 1 year ago
parent
commit
e25cfac609
  1. 2
      smart_service/apis/v2/master.py
  2. 4
      smart_service/phase_2/doctype/instructions/instructions.json
  3. 22
      smart_service/phase_2/doctype/special_tool_information/special_tool_information.json
  4. 0
      smart_service/phase_2/doctype/special_tool_information_category_master/__init__.py
  5. 8
      smart_service/phase_2/doctype/special_tool_information_category_master/special_tool_information_category_master.js
  6. 62
      smart_service/phase_2/doctype/special_tool_information_category_master/special_tool_information_category_master.json
  7. 15
      smart_service/phase_2/doctype/special_tool_information_category_master/special_tool_information_category_master.py
  8. 8
      smart_service/phase_2/doctype/special_tool_information_category_master/test_special_tool_information_category_master.py
  9. 1
      smart_service/transactions/doctype/publish/publish.py

2
smart_service/apis/v2/master.py

@ -335,7 +335,7 @@ def new_publish1():
def get_special_tool_information(vehicle):
try:
special_tool_information = frappe.db.sql('''select name,vehicle,tool_type,category,aggregate_name,tool_name,aggregate_image as 'tool_image',
pdf,image,video,keywords,display_order,my_id,active_status from `tabSpecial Tool Information`
pdf,image,video,keywords,display_order,category_display_order,my_id,active_status from `tabSpecial Tool Information`
where vehicle= '%s' ;''' % (vehicle), as_dict=1)
for s in special_tool_information:
s['instructions'] = frappe.db.sql('''select idx as 'display_order',step_name, content_type, content,attach_file,title

4
smart_service/phase_2/doctype/instructions/instructions.json

@ -32,7 +32,7 @@
"fieldtype": "Small Text",
"in_list_view": 1,
"label": "Content",
"mandatory_depends_on": "eval:doc.step_name && doc.content_type !='Image' ||doc.content_type !='Video'||doc.content_type !='PDF'"
"mandatory_depends_on": "eval:doc.step_name && doc.content_type !='Image'||doc.content_type !='Video'||doc.content_type !='PDF';"
},
{
"fieldname": "attach_file",
@ -50,7 +50,7 @@
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
"modified": "2023-10-18 14:57:50.775053",
"modified": "2023-10-19 16:33:47.404474",
"modified_by": "Administrator",
"module": "Phase-2",
"name": "Instructions",

22
smart_service/phase_2/doctype/special_tool_information/special_tool_information.json

@ -25,7 +25,8 @@
"image_preview",
"my_id",
"section_break_e91wx",
"instructions"
"instructions",
"category_display_order"
],
"fields": [
{
@ -100,13 +101,12 @@
},
{
"fieldname": "category",
"fieldtype": "Select",
"fieldtype": "Link",
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Category",
"options": "Maintenance Service Category (MS)\nRepair Service Category (RS)\nOverhaul Service Category (OS)\nTEB",
"reqd": 1,
"set_only_once": 1
"options": "Special Tool Information Category Master",
"reqd": 1
},
{
"depends_on": "eval:doc.category !='TEB';",
@ -137,7 +137,7 @@
"fieldname": "image",
"fieldtype": "Attach Image",
"label": "Image",
"reqd": 1
"mandatory_depends_on": "eval:doc.category!=\"TEB\";"
},
{
"fieldname": "column_break_m3p9i",
@ -168,12 +168,18 @@
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Tool Name",
"reqd": 1
"mandatory_depends_on": "eval:doc.category!=\"TEB\";"
},
{
"fetch_from": "category.display_order",
"fieldname": "category_display_order",
"fieldtype": "Int",
"label": "Category Display Order"
}
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2023-10-18 12:43:38.818592",
"modified": "2023-10-19 16:14:57.349719",
"modified_by": "Administrator",
"module": "Phase-2",
"name": "Special Tool Information",

0
smart_service/phase_2/doctype/special_tool_information_category_master/__init__.py

8
smart_service/phase_2/doctype/special_tool_information_category_master/special_tool_information_category_master.js

@ -0,0 +1,8 @@
// Copyright (c) 2023, Hard n Soft Technologies Pvt Ltd and contributors
// For license information, please see license.txt
frappe.ui.form.on('Special Tool Information Category Master', {
// refresh: function(frm) {
// }
});

62
smart_service/phase_2/doctype/special_tool_information_category_master/special_tool_information_category_master.json

@ -0,0 +1,62 @@
{
"actions": [],
"allow_rename": 1,
"autoname": "format:{category_name}",
"creation": "2023-10-19 15:53:02.286633",
"doctype": "DocType",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"category_name",
"display_order",
"my_id",
"active_status"
],
"fields": [
{
"fieldname": "category_name",
"fieldtype": "Data",
"label": "Category Name",
"unique": 1
},
{
"fieldname": "display_order",
"fieldtype": "Int",
"label": "Display Order"
},
{
"fieldname": "my_id",
"fieldtype": "Int",
"label": "My Id"
},
{
"fieldname": "active_status",
"fieldtype": "Select",
"label": "Active Status",
"options": "Active\nInactive"
}
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2023-10-19 15:56:03.355802",
"modified_by": "Administrator",
"module": "Phase-2",
"name": "Special Tool Information Category Master",
"owner": "Administrator",
"permissions": [
{
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "System Manager",
"share": 1,
"write": 1
}
],
"sort_field": "modified",
"sort_order": "DESC"
}

15
smart_service/phase_2/doctype/special_tool_information_category_master/special_tool_information_category_master.py

@ -0,0 +1,15 @@
# Copyright (c) 2023, Hard n Soft Technologies Pvt Ltd and contributors
# For license information, please see license.txt
import frappe
from frappe.model.document import Document
class SpecialToolInformationCategoryMaster(Document):
def autoname(self):
count = frappe.db.sql(
'''select max(my_id) as max_count from `tabSpecial Tool Information Category Master`;''')
if count[0][0] is not None:
self.my_id = count[0][0] + 1
else:
self.my_id = 1

8
smart_service/phase_2/doctype/special_tool_information_category_master/test_special_tool_information_category_master.py

@ -0,0 +1,8 @@
# Copyright (c) 2023, Hard n Soft Technologies Pvt Ltd and Contributors
# See license.txt
# import frappe
import unittest
class TestSpecialToolInformationCategoryMaster(unittest.TestCase):
pass

1
smart_service/transactions/doctype/publish/publish.py

@ -125,7 +125,6 @@ class Publish(Document):
"""update `tabPublish` set publish_status='Published' where name='{0}'""".format(self.name))
variant = self.variant_mapping_details.split('/n')
frappe.log_error('publish type', str(self.publish_type))
update_publish_mapping(self.vehicle, self.variant_mapping,
self.language, self.publish_module, self.publish_type)

Loading…
Cancel
Save