Browse Source

fule issue

master
hns 3 years ago
parent
commit
4c83daf078
  1. 53
      smart_service/fixtures/custom_field.json
  2. 223
      smart_service/fixtures/server_script.json
  3. 8
      smart_service/hooks.py
  4. 40
      smart_service/masters/doctype/fuel/fuel.json

53
smart_service/fixtures/custom_field.json

@ -51,58 +51,5 @@
"translatable": 0,
"unique": 0,
"width": null
},
{
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"collapsible_depends_on": null,
"columns": 0,
"default": null,
"depends_on": null,
"description": null,
"docstatus": 0,
"doctype": "Custom Field",
"dt": "User",
"fetch_from": null,
"fetch_if_empty": 0,
"fieldname": "pwd",
"fieldtype": "Data",
"hidden": 1,
"hide_border": 0,
"hide_days": 0,
"hide_seconds": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_preview": 0,
"in_standard_filter": 0,
"insert_after": "new_password",
"label": "PWD",
"length": 0,
"mandatory_depends_on": null,
"modified": "2022-02-11 19:13:04.645496",
"name": "User-pwd",
"no_copy": 0,
"non_negative": 0,
"options": "",
"parent": null,
"parentfield": null,
"parenttype": null,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"print_width": null,
"read_only": 0,
"read_only_depends_on": null,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"translatable": 0,
"unique": 0,
"width": null
}
]

223
smart_service/fixtures/server_script.json

@ -0,0 +1,223 @@
[
{
"allow_guest": 0,
"api_method": null,
"disabled": 0,
"docstatus": 0,
"doctype": "Server Script",
"doctype_event": "Before Insert",
"event_frequency": "All",
"modified": "2021-11-23 15:01:29.749648",
"name": "Siva-Insert",
"parent": null,
"parentfield": null,
"parenttype": null,
"reference_doctype": "Siva",
"script": "doclist = frappe.get_list(\"Siva\", fields=['myid'], order_by='creation desc', as_list=True)\nnumber = doclist[0][0] if doclist else 999\ndoc.myid = int(number) + 1",
"script_type": "DocType Event"
},
{
"allow_guest": 0,
"api_method": null,
"disabled": 0,
"docstatus": 0,
"doctype": "Server Script",
"doctype_event": "Before Insert",
"event_frequency": "All",
"modified": "2021-11-24 11:20:08.903462",
"name": "Vehicle Segment_Insert",
"parent": null,
"parentfield": null,
"parenttype": null,
"reference_doctype": "Vehicle Segment",
"script": "doclist = frappe.get_list(\"Vehicle Segment\", fields=['myid'], order_by='creation desc', as_list=True)\r\nnumber = doclist[0][0] if doclist else 999\r\ndoc.myid = int(number) + 1",
"script_type": "DocType Event"
},
{
"allow_guest": 0,
"api_method": null,
"disabled": 0,
"docstatus": 0,
"doctype": "Server Script",
"doctype_event": "Before Insert",
"event_frequency": "All",
"modified": "2021-11-24 11:32:28.824220",
"name": "Service Kilometers_Insert",
"parent": null,
"parentfield": null,
"parenttype": null,
"reference_doctype": "Service Kilometers",
"script": "doclist = frappe.get_list(\"Service Kilometers\", fields=['myid'], order_by='creation desc', as_list=True)\r\nnumber = doclist[0][0] if doclist else 999\r\ndoc.myid = int(number) + 1",
"script_type": "DocType Event"
},
{
"allow_guest": 0,
"api_method": null,
"disabled": 0,
"docstatus": 0,
"doctype": "Server Script",
"doctype_event": "Before Insert",
"event_frequency": "All",
"modified": "2021-11-24 11:55:20.259219",
"name": "Vehicle_Insert",
"parent": null,
"parentfield": null,
"parenttype": null,
"reference_doctype": "Vehicle",
"script": "doclist = frappe.get_list(\"Vehicle\", fields=['myid'], order_by='creation desc', as_list=True)\r\nnumber = doclist[0][0] if doclist else 999\r\ndoc.myid = int(number) + 1",
"script_type": "DocType Event"
},
{
"allow_guest": 0,
"api_method": null,
"disabled": 0,
"docstatus": 0,
"doctype": "Server Script",
"doctype_event": "Before Insert",
"event_frequency": "All",
"modified": "2021-11-24 12:11:52.883566",
"name": "Variant_Insert",
"parent": null,
"parentfield": null,
"parenttype": null,
"reference_doctype": "Variant",
"script": "doclist = frappe.get_list(\"Variant\", fields=['myid'], order_by='creation desc', as_list=True)\r\nnumber = doclist[0][0] if doclist else 999\r\ndoc.myid = int(number) + 1",
"script_type": "DocType Event"
},
{
"allow_guest": 0,
"api_method": null,
"disabled": 0,
"docstatus": 0,
"doctype": "Server Script",
"doctype_event": "Before Insert",
"event_frequency": "All",
"modified": "2021-11-24 12:57:51.283964",
"name": "Fuel_Insert",
"parent": null,
"parentfield": null,
"parenttype": null,
"reference_doctype": "Fuel",
"script": "doclist = frappe.get_list(\"Fuel\", fields=['myid'], order_by='creation desc', as_list=True)\r\nnumber = doclist[0][0] if doclist else 999\r\ndoc.myid = int(number) + 1",
"script_type": "DocType Event"
},
{
"allow_guest": 0,
"api_method": null,
"disabled": 0,
"docstatus": 0,
"doctype": "Server Script",
"doctype_event": "Before Insert",
"event_frequency": "All",
"modified": "2021-11-24 13:02:55.333502",
"name": "Transmission_Insert",
"parent": null,
"parentfield": null,
"parenttype": null,
"reference_doctype": "Transmission",
"script": "doclist = frappe.get_list(\"Transmission\", fields=['myid'], order_by='creation desc', as_list=True)\r\nnumber = doclist[0][0] if doclist else 999\r\ndoc.myid = int(number) + 1",
"script_type": "DocType Event"
},
{
"allow_guest": 0,
"api_method": null,
"disabled": 0,
"docstatus": 0,
"doctype": "Server Script",
"doctype_event": "Before Insert",
"event_frequency": "All",
"modified": "2021-11-24 13:05:20.240515",
"name": "Drive",
"parent": null,
"parentfield": null,
"parenttype": null,
"reference_doctype": "Drive",
"script": "doclist = frappe.get_list(\"Drive\", fields=['myid'], order_by='creation desc', as_list=True)\r\nnumber = doclist[0][0] if doclist else 999\r\ndoc.myid = int(number) + 1",
"script_type": "DocType Event"
},
{
"allow_guest": 0,
"api_method": null,
"disabled": 0,
"docstatus": 0,
"doctype": "Server Script",
"doctype_event": "Before Insert",
"event_frequency": "All",
"modified": "2021-11-24 13:12:41.361844",
"name": "Systems_Insert",
"parent": null,
"parentfield": null,
"parenttype": null,
"reference_doctype": "Systems",
"script": "doclist = frappe.get_list(\"Systems\", fields=['myid'], order_by='creation desc', as_list=True)\r\nnumber = doclist[0][0] if doclist else 999\r\ndoc.myid = int(number) + 1",
"script_type": "DocType Event"
},
{
"allow_guest": 0,
"api_method": null,
"disabled": 0,
"docstatus": 0,
"doctype": "Server Script",
"doctype_event": "Before Insert",
"event_frequency": "All",
"modified": "2021-11-24 13:14:32.225549",
"name": "Sub Systems_Insert",
"parent": null,
"parentfield": null,
"parenttype": null,
"reference_doctype": "Sub Systems",
"script": "doclist = frappe.get_list(\"Sub Systems\", fields=['myid'], order_by='creation desc', as_list=True)\r\nnumber = doclist[0][0] if doclist else 999\r\ndoc.myid = int(number) + 1",
"script_type": "DocType Event"
},
{
"allow_guest": 0,
"api_method": null,
"disabled": 0,
"docstatus": 0,
"doctype": "Server Script",
"doctype_event": "Before Insert",
"event_frequency": "All",
"modified": "2021-12-27 18:19:26.411283",
"name": "Custom Languages_Insert",
"parent": null,
"parentfield": null,
"parenttype": null,
"reference_doctype": "Custom Languages",
"script": "doclist = frappe.get_list(\"Custom Languages\", fields=['myid'], order_by='creation desc', as_list=True)\r\nnumber = doclist[0][0] if doclist else 999\r\ndoc.myid = int(number) + 1",
"script_type": "DocType Event"
},
{
"allow_guest": 0,
"api_method": null,
"disabled": 0,
"docstatus": 0,
"doctype": "Server Script",
"doctype_event": "Before Insert",
"event_frequency": "All",
"modified": "2022-01-10 17:18:46.901349",
"name": "Application Menu_Insert",
"parent": null,
"parentfield": null,
"parenttype": null,
"reference_doctype": "Application Menu",
"script": "doclist = frappe.get_list(\"Application Menu\", fields=['myid'], order_by='creation desc', as_list=True)\r\nnumber = doclist[0][0] if doclist else 999\r\ndoc.myid = int(number) + 1",
"script_type": "DocType Event"
},
{
"allow_guest": 0,
"api_method": null,
"disabled": 1,
"docstatus": 0,
"doctype": "Server Script",
"doctype_event": "Before Insert",
"event_frequency": "Hourly",
"modified": "2022-01-31 17:12:43.653700",
"name": "Replant Apple",
"parent": null,
"parentfield": null,
"parenttype": null,
"reference_doctype": null,
"script": "#import frappe\r\n\r\n#def generate_keys(user):\r\nuser = \"ponkebhap@hnsonline.com\"\r\nuser_details = frappe.get_doc('User', user)\r\napi_secret = frappe.generate_hash(length=15)\r\nif not user_details.api_key:\r\n api_key = frappe.generate_hash(length=15)\r\n user_details.api_key = api_key\r\nuser_details.api_secret = api_secret\r\nuser_details.save()\r\ntoken = user_details.api_key+':'+api_secret\r\n\r\nnew_tok = generate_keys('cms@guidedsmartservice.com')\r\nwater = frappe.get_doc(\"numlock\", 'N-0001')\r\nwater.pwd = new_tok\r\nwater.save()",
"script_type": "Scheduler Event"
}
]

8
smart_service/hooks.py

@ -189,8 +189,10 @@ user_data_fields = [
# "smart_service.auth.validate"
# ]
fixtures = [
"Custom Field",
"Property Setter",
"Client Script"
#"Custom Field",
#"Property Setter",
#"Client Script"
"Server Script"
]

40
smart_service/masters/doctype/fuel/fuel.json

@ -1,25 +1,49 @@
{
"actions": [],
"autoname": "format:{fuel_type}",
"creation": "2022-02-13 05:21:49.396717",
"allow_import": 1,
"allow_rename": 1,
"autoname": "format: {fuel}",
"creation": "2021-10-28 13:06:03.207653",
"doctype": "DocType",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"fuel_type"
"fuel",
"active_status",
"myid"
],
"fields": [
{
"fieldname": "fuel_type",
"allow_in_quick_entry": 1,
"bold": 1,
"fieldname": "fuel",
"fieldtype": "Data",
"in_list_view": 1,
"label": "Fuel Type",
"in_preview": 1,
"in_standard_filter": 1,
"label": "Fuel",
"reqd": 1
},
{
"fieldname": "active_status",
"fieldtype": "Select",
"hidden": 1,
"label": "Active Status",
"options": "Active\nInactive"
},
{
"fieldname": "myid",
"fieldtype": "Int",
"hidden": 1,
"in_list_view": 1,
"in_standard_filter": 1,
"label": "myID",
"set_only_once": 1
}
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2022-02-13 05:21:49.396717",
"modified": "2022-02-17 19:07:08.832628",
"modified_by": "Administrator",
"module": "Masters",
"name": "Fuel",
@ -38,7 +62,9 @@
"write": 1
}
],
"search_fields": "fuel",
"sort_field": "modified",
"sort_order": "DESC",
"title_field": "fuel_type"
"title_field": "fuel",
"track_changes": 1
}
Loading…
Cancel
Save