diff --git a/src/api/ADempiere/window.js b/src/api/ADempiere/window.js index 86e87ec4..f4fde50f 100644 --- a/src/api/ADempiere/window.js +++ b/src/api/ADempiere/window.js @@ -16,7 +16,6 @@ // Get Instance for connection import { request } from '@/utils/ADempiere/request' - import { isEmptyValue } from '@/utils/ADempiere/valueUtils.js' /** @@ -31,12 +30,10 @@ export function requestLookup({ directQuery, value }) { - let filters = [] - if (!isEmptyValue(value)) { - filters = [{ - value - }] - } + const filters = [{ + value + }] + return request({ url: '/user-interface/window/lookup-item', method: 'get', diff --git a/src/components/ADempiere/Field/FieldSelect.vue b/src/components/ADempiere/Field/FieldSelect.vue index 425f5e76..b9a3cda3 100644 --- a/src/components/ADempiere/Field/FieldSelect.vue +++ b/src/components/ADempiere/Field/FieldSelect.vue @@ -337,11 +337,14 @@ export default { value: this.value }) .then(responseLookupItem => { - this.displayedValue = responseLookupItem.label - this.uuidValue = responseLookupItem.uuid - this.$nextTick(() => { - this.optionsList = this.getterLookupAll - }) + // with value response update local component list + if (!this.isEmptyValue(responseLookupItem)) { + this.displayedValue = responseLookupItem.label + this.uuidValue = responseLookupItem.uuid + this.$nextTick(() => { + this.optionsList = this.getterLookupAll + }) + } }) .finally(() => { this.isLoading = false diff --git a/src/store/modules/ADempiere/lookup.js b/src/store/modules/ADempiere/lookup.js index 39b4e032..8d630522 100644 --- a/src/store/modules/ADempiere/lookup.js +++ b/src/store/modules/ADempiere/lookup.js @@ -1,6 +1,22 @@ +// ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution +// Copyright (C) 2017-Present E.R.P. Consultores y Asociados, C.A. +// Contributor(s): Edwin Betancourt EdwinBetanc0urt@outlook.com www.erpya.com +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + import { requestLookup, requestLookupList } from '@/api/ADempiere/window.js' import { getToken as getSession } from '@/utils/auth' -import { isEmptyValue } from '@/utils/ADempiere/valueUtils' +import { isEmptyValue } from '@/utils/ADempiere/valueUtils.js' import { parseContext } from '@/utils/ADempiere/contextUtils' const initStateLookup = { @@ -54,9 +70,7 @@ const lookup = { isBooleanToString: true }).value } - if (parsedDirectQuery.includes('?')) { - parsedDirectQuery = directQuery.replace('?', value) - } + return requestLookup({ tableName, directQuery: parsedDirectQuery,