commit
4c795a248d
5 changed files with 25 additions and 22 deletions
|
|
@ -40,7 +40,8 @@ frappe.ui.form.on('Data Import', {
|
|||
|
||||
if (frm.doc.import_status==="In Progress") {
|
||||
frm.dashboard.add_progress("Data Import Progress", "0");
|
||||
frm.set_read_only(true);
|
||||
frm.set_read_only();
|
||||
frm.refresh_fields();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -438,7 +438,7 @@
|
|||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Import Status",
|
||||
"length": 0,
|
||||
|
|
@ -621,7 +621,7 @@
|
|||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 1,
|
||||
"modified": "2017-12-14 16:27:37.683505",
|
||||
"modified": "2017-12-15 14:49:24.622128",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Core",
|
||||
"name": "Data Import",
|
||||
|
|
|
|||
|
|
@ -1,16 +1,24 @@
|
|||
frappe.listview_settings['Data Import'] = {
|
||||
add_fields: ["import_status"],
|
||||
has_indicator_for_draft: 1,
|
||||
get_indicator: function(doc) {
|
||||
if (doc.import_status=="Successful") {
|
||||
return [__("Data imported"), "blue", "import_status,=,Successful"];
|
||||
} else if(doc.import_status == "Partially Successful") {
|
||||
return [__("Data partially imported"), "blue", "import_status,=,Partially Successful"];
|
||||
} else if(doc.import_status == "In Process") {
|
||||
return [__("Data import in progress"), "orange", "import_status,=,In Process"];
|
||||
} else if(doc.import_status == "Failed") {
|
||||
return [__("Data import failed"), "red", "import_status,=,Failed"];
|
||||
} else {
|
||||
return [__("Data import pending"), "green", "import_status,=,"];
|
||||
|
||||
let status = {
|
||||
'Successful': [__("Success"), "green", "import_status,=,Successful"],
|
||||
'Partially Successful': [__("Partial Success"), "blue", "import_status,=,Partially Successful"],
|
||||
'In Progress': [__("In Progress"), "orange", "import_status,=,In Progress"],
|
||||
'Failed': [__("Failed"), "red", "import_status,=,Failed"],
|
||||
'Pending': [__("Pending"), "orange", "import_status,=,"]
|
||||
}
|
||||
|
||||
if (doc.import_status) {
|
||||
return status[doc.import_status];
|
||||
}
|
||||
|
||||
if (doc.docstatus == 0) {
|
||||
return status['Pending'];
|
||||
}
|
||||
|
||||
return status['Pending'];
|
||||
}
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -972,6 +972,7 @@ li.user-progress .progress-bar {
|
|||
}
|
||||
input[type="checkbox"] {
|
||||
position: relative;
|
||||
height: 16px;
|
||||
}
|
||||
input[type="checkbox"]:before {
|
||||
position: absolute;
|
||||
|
|
|
|||
|
|
@ -359,7 +359,7 @@ _f.Frm.prototype.get_field = function(field) {
|
|||
};
|
||||
|
||||
|
||||
_f.Frm.prototype.set_read_only = function(refresh_fields = false) {
|
||||
_f.Frm.prototype.set_read_only = function() {
|
||||
var perm = [];
|
||||
var docperms = frappe.perm.get_perm(this.doc.doctype);
|
||||
for (var i=0, l=docperms.length; i<l; i++) {
|
||||
|
|
@ -367,13 +367,6 @@ _f.Frm.prototype.set_read_only = function(refresh_fields = false) {
|
|||
perm[p.permlevel || 0] = {read:1, print:1, cancel:1};
|
||||
}
|
||||
this.perm = perm;
|
||||
|
||||
if (refresh_fields) {
|
||||
this.fields.map(f => {
|
||||
f.perm = this.perm;
|
||||
f.refresh();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
_f.Frm.prototype.trigger = function(event) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue