From 57f1d351be61ac175514500704c39d8c0b854f39 Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Tue, 8 Aug 2017 11:32:57 +0530 Subject: [PATCH 1/3] [Fix] Workflow is not working even if the user has permission to submit the record (#3871) --- frappe/public/js/legacy/form.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } From bb750d5739faf11f1ae14a94011b1d11c5d5e02e Mon Sep 17 00:00:00 2001 From: Makarand Bauskar Date: Tue, 8 Aug 2017 12:23:32 +0530 Subject: [PATCH 2/3] [test] test_customize_form.js (#3875) --- .../customize_form/test_customize_form.js | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/frappe/custom/doctype/customize_form/test_customize_form.js b/frappe/custom/doctype/customize_form/test_customize_form.js index 144d11a9ae..a1431fdb5a 100644 --- a/frappe/custom/doctype/customize_form/test_customize_form.js +++ b/frappe/custom/doctype/customize_form/test_customize_form.js @@ -8,13 +8,24 @@ QUnit.test("test customize form", function(assert) { frappe.run_serially([ () => frappe.set_route('Form', 'Customize Form'), () => cur_frm.set_value('doc_type', 'ToDo'), - () => frappe.timeout(2), - - () => assert.equal(cur_frm.doc.fields[1].fieldname, 'status'), - + () => { + // 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 +36,8 @@ QUnit.test("test customize form", function(assert) { () => frappe.timeout(0.5), // status still exists - () => assert.equal(cur_frm.doc.fields[1].fieldname, 'status'), + () => assert.equal(cur_frm.doc.fields[frappe.row_idx].fieldname, 'status', + 'check if selected field is still "status"'), () => done() ]); }); From 7b90a9a9e96427b6997bd0f35b5c2cd3b21f71e8 Mon Sep 17 00:00:00 2001 From: mbauskar Date: Tue, 8 Aug 2017 13:21:32 +0600 Subject: [PATCH 3/3] bumped to version 8.6.8 --- frappe/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/__init__.py b/frappe/__init__.py index a7bcb38324..2c7e0ca64b 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()