awsss 2 years ago
parent
commit
23f3a84293
  1. 12
      smart_service/overrides/overrides/override_file.py
  2. 11
      smart_service/transactions/doctype/fish/fish.json
  3. 11
      smart_service/transactions/doctype/procedure/procedure.js

12
smart_service/overrides/overrides/override_file.py

@ -3,8 +3,10 @@ import frappe, json
import json import json
from frappe.utils import cstr, flt, cint from frappe.utils import cstr, flt, cint
def validate(doc=None,method=None): def validate(doc=None,method=None):
f = doc.file_name data = ['.jpg', '.png','.mp4', '.docx','.xls', '.pdf','.tiff','.ppt','.m4v','.doc','.pps','.pptx']
file_split = f.split('.') file_name = doc.file_name
file_length = len(file_split) total_count = 0
if file_length > 2: for i in data:
frappe.throw("Double Extension file not allowed") total_count += file_name.count(i)
if total_count > 1:
frappe.throw('Double Extension file not allowed')

11
smart_service/transactions/doctype/fish/fish.json

@ -6,19 +6,26 @@
"editable_grid": 1, "editable_grid": 1,
"engine": "InnoDB", "engine": "InnoDB",
"field_order": [ "field_order": [
"apple" "apple",
"path"
], ],
"fields": [ "fields": [
{ {
"fieldname": "apple", "fieldname": "apple",
"fieldtype": "Data", "fieldtype": "Data",
"label": "Apple" "label": "Apple"
},
{
"fieldname": "path",
"fieldtype": "Select",
"label": "Path",
"options": "https\nhttp"
} }
], ],
"index_web_pages_for_search": 1, "index_web_pages_for_search": 1,
"issingle": 1, "issingle": 1,
"links": [], "links": [],
"modified": "2022-02-12 13:41:59.230075", "modified": "2022-05-27 13:46:42.150311",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Transactions", "module": "Transactions",
"name": "Fish", "name": "Fish",

11
smart_service/transactions/doctype/procedure/procedure.js

@ -18,6 +18,17 @@ cur_frm.fields_dict['procedure_details'].grid.get_field('step_name').get_query =
frappe.ui.form.on('Procedure', { frappe.ui.form.on('Procedure', {
onload: function (frm) { onload: function (frm) {
if(frm.doc.procedure_details){
var url = window.location.host;
frappe.db.get_value('Fish', {name: "Fish"}, 'path' , (r) =>{
for (var i=0;i<frm.doc.procedure_details.length;i++){
if(frm.doc.procedure_details[i].content && r.path){
var x = "<a href=" + '"' + r.path + "://" + url + "/app/procedure/" + frm.doc.procedure_details[i].content
frm.doc.procedure_details[i].content = x + '"' + 'target="_blank"' + '>' + frm.doc.procedure_details[i].content + '</a>';
}
}
})
}
if (frm.doc.workflow_state == 'Publish Ready'){ if (frm.doc.workflow_state == 'Publish Ready'){
frm.set_read_only(); frm.set_read_only();
} }

Loading…
Cancel
Save