diff --git a/frappe/__init__.py b/frappe/__init__.py index cc6e7cb32a..a0eb02d432 100644 --- a/frappe/__init__.py +++ b/frappe/__init__.py @@ -14,7 +14,7 @@ import os, sys, importlib, inspect, json from .exceptions import * from .utils.jinja import get_jenv, get_template, render_template, get_email_from_template -__version__ = '8.6.7' +__version__ = '8.6.8' __title__ = "Frappe Framework" local = Local() diff --git a/frappe/custom/doctype/customize_form/test_customize_form.js b/frappe/custom/doctype/customize_form/test_customize_form.js index cac3cc15e6..5d2be73e0b 100644 --- a/frappe/custom/doctype/customize_form/test_customize_form.js +++ b/frappe/custom/doctype/customize_form/test_customize_form.js @@ -10,11 +10,23 @@ QUnit.test("test customize form", function(assert) { () => frappe.timeout(2), () => cur_frm.set_value('doc_type', 'ToDo'), () => frappe.timeout(2), - - () => assert.equal(cur_frm.doc.fields[1].fieldname, 'status', "Status Field"), - + () => { + // find the status column as there may be other custom fields like + // kanban etc. + frappe.row_idx = 0; + cur_frm.doc.fields.every((d, i) => { + if(d.fieldname==='status') { + frappe.row_idx = i; + return false; + } else { + return true; + } + }); + assert.equal(cur_frm.doc.fields[frappe.row_idx].fieldname, 'status', + 'check if selected field is "status"'); + }, // open "status" row - () => cur_frm.fields_dict.fields.grid.grid_rows[1].toggle_view(), + () => cur_frm.fields_dict.fields.grid.grid_rows[frappe.row_idx].toggle_view(), () => frappe.timeout(0.5), // try deleting it @@ -25,7 +37,8 @@ QUnit.test("test customize form", function(assert) { () => frappe.timeout(0.5), // status still exists - () => assert.equal(cur_frm.doc.fields[1].fieldname, 'status', "Status Field Still Exists"), + () => assert.equal(cur_frm.doc.fields[frappe.row_idx].fieldname, 'status', + 'check if selected field is still "status"'), () => done() ]); }); diff --git a/frappe/public/js/legacy/form.js b/frappe/public/js/legacy/form.js index b431446fd3..e5ac26c2f9 100644 --- a/frappe/public/js/legacy/form.js +++ b/frappe/public/js/legacy/form.js @@ -941,7 +941,7 @@ _f.Frm.prototype.validate_form_action = function(action, resolve) { // Allow submit, write, cancel and create permissions for read only documents that are assigned by // workflows if the user already have those permissions. This is to allow for users to // continue through the workflow states and to allow execution of functions like Duplicate. - if (frappe.workflow.is_read_only(this.doctype, this.docname) && (perms["write"] || + if (!frappe.workflow.is_read_only(this.doctype, this.docname) && (perms["write"] || perms["create"] || perms["submit"] || perms["cancel"])) { var allowed_for_workflow = true; }