diff --git a/cypress/integration/form.js b/cypress/integration/form.js index d83c304c71..c1b8f6126a 100644 --- a/cypress/integration/form.js +++ b/cypress/integration/form.js @@ -3,7 +3,7 @@ const jump_to_field = (field_label) => { .type("{esc}") // lose focus if any .type("{ctrl+j}") // jump to field .type(field_label) - .wait(500) + .wait(1000) .type("{enter}") .wait(200) .findByRole("button", { name: "Go" }) diff --git a/frappe/public/js/frappe/utils/utils.js b/frappe/public/js/frappe/utils/utils.js index 01636c32bc..2facd65c3b 100644 --- a/frappe/public/js/frappe/utils/utils.js +++ b/frappe/public/js/frappe/utils/utils.js @@ -1754,10 +1754,19 @@ Object.assign(frappe.utils, { // don't remove unless patch is created to convert all existing filters from object to array // backward compatibility if (Array.isArray(filters_json)) { - let filter = {}; - filters_json.forEach((arr) => { - filter[arr[1]] = [arr[2], arr[3]]; - }); + let filter = filters_json.reduce((acc, filter) => { + const field = filter[1]; + const value = [filter[2], filter[3]]; + + // if we have multiple filters for the same field, + // we convert it into an array + if (acc[field]) { + acc[field].push(value); + } else { + acc[field] = [value]; + } + return acc; + }, {}); return filter || []; } return filters_json || [];