From cb724afbbe9eba8b5d559d98097eba3928f10115 Mon Sep 17 00:00:00 2001 From: Elsio Sanchez <45974454+elsiosanchez@users.noreply.github.com> Date: Thu, 2 Nov 2023 14:56:48 -0400 Subject: [PATCH] Fix: Context Attributes (Lookup List Transcoding) (#1594) * Fix: Context Attributes (Lookup List Transcoding) * minimal changes * remove change --- src/api/ADempiere/userInterface/browserList.ts | 2 ++ src/store/modules/ADempiere/browserManager.js | 5 +++-- src/store/modules/ADempiere/lookupManager.js | 10 ++++++++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/api/ADempiere/userInterface/browserList.ts b/src/api/ADempiere/userInterface/browserList.ts index 06c0919a437..b51cea1d27b 100644 --- a/src/api/ADempiere/userInterface/browserList.ts +++ b/src/api/ADempiere/userInterface/browserList.ts @@ -28,6 +28,7 @@ export function requestBrowserSearch({ id, filters, pageToken, + contextAttributes, pageSize = RECORD_ROWS_BY_LIST }) { return request({ @@ -35,6 +36,7 @@ export function requestBrowserSearch({ method: 'get', params: { filters, + context_attributes: contextAttributes, page_token: pageToken, page_size: pageSize } diff --git a/src/store/modules/ADempiere/browserManager.js b/src/store/modules/ADempiere/browserManager.js index 3e781cebe7b..78dc1e63ff6 100644 --- a/src/store/modules/ADempiere/browserManager.js +++ b/src/store/modules/ADempiere/browserManager.js @@ -183,7 +183,8 @@ const browserControl = { // get context values const contextAttributesList = getContextAttributes({ containerUuid, - contextColumnNames + contextColumnNames, + format: 'object' }) // const isWithoutValues = contextAttributesList.find(attribute => isEmptyValue(attribute.value)) @@ -219,7 +220,7 @@ const browserControl = { requestBrowserSearch({ id: containerUuid, - contextAttributesList, + contextAttributes: JSON.stringify(contextAttributesList), filters: '[' + filters + ']', nextPageToken: pageToken, pageSize diff --git a/src/store/modules/ADempiere/lookupManager.js b/src/store/modules/ADempiere/lookupManager.js index ed3abe75783..8ad01777681 100644 --- a/src/store/modules/ADempiere/lookupManager.js +++ b/src/store/modules/ADempiere/lookupManager.js @@ -153,7 +153,8 @@ const lookupManager = { parentUuid, containerUuid, contextColumnNames, - isBooleanToString: true + isBooleanToString: true, + format: 'object' }) const clientId = rootGetters.getSessionContextClientId @@ -173,9 +174,14 @@ const lookupManager = { const contextKey = generateContextKey(contextAttributesList) key += contextKey + let contextAttributes + + if (!isEmptyValue(contextAttributesList)) { + contextAttributes = JSON.stringify(contextAttributesList) + } requestLookupList({ - contextAttributesList, + contextAttributesList: contextAttributes, browseFieldId, processParameterId, fieldId,