Skip to content

Commit

Permalink
fix: Smart Browse process selection with decimal values. (PanJiaChen#…
Browse files Browse the repository at this point in the history
  • Loading branch information
EdwinBetanc0urt authored Jun 27, 2024
1 parent 9068dee commit a80b6ce
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions src/store/modules/ADempiere/browserManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,13 @@ import {
} from '@/utils/ADempiere/dictionaryUtils'

// Utils and Helper Methods
import { isEmptyValue } from '@/utils/ADempiere/valueUtils'
import { isEmptyValue, getTypeOfValue } from '@/utils/ADempiere/valueUtils'
import { getContextAttributes } from '@/utils/ADempiere/contextUtils/contextAttributes'
import { showMessage, showNotification } from '@/utils/ADempiere/notification'
import { isReadOnlyColumn, containerManager } from '@/utils/ADempiere/dictionary/browser'
import { generatePageToken } from '@/utils/ADempiere/dataUtils'
import { getUuidv4 } from '@/utils/ADempiere/recordUtil'
import { isDateField, isDecimalField } from '@/utils/ADempiere/references'

const initState = {
browserData: {}
Expand Down Expand Up @@ -685,7 +686,7 @@ const browserControl = {
.map(itemField => {
return {
columnName: itemField.columnName,
valueType: itemField.valueType
display_type: itemField.display_type
}
})

Expand All @@ -700,12 +701,22 @@ const browserControl = {
// evaluate metadata attributes before to convert
if (!isEmptyValue(currentField)) {
const value = itemRow[columnName]
// attributesList.push({
// columnName,
// valueType: currentField.valueType,
// value: value
// })
attributesList[columnName] = value
let serverValue = value
// types `decimal` and `date` is a object struct
if (getTypeOfValue(value) !== 'OBJECT' || isEmptyValue(value.type)) {
if (isDateField(currentField.display_type)) {
serverValue = {
type: 'date',
value: value
}
} else if (isDecimalField(currentField.display_type)) {
serverValue = {
type: 'decimal',
value: value
}
}
}
attributesList[columnName] = serverValue
}
}
})
Expand Down

0 comments on commit a80b6ce

Please sign in to comment.