Skip to content
This repository has been archived by the owner on Nov 25, 2024. It is now read-only.

Commit

Permalink
feat: Add DisplayColumn value on Record_ID column. (#2976)
Browse files Browse the repository at this point in the history
  • Loading branch information
EdwinBetanc0urt authored Nov 13, 2024
1 parent 27ab5ac commit ea314aa
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/components/ADempiere/FieldDefinition/FieldButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ import fieldMixinDisplayColumn from '@/components/ADempiere/FieldDefinition/mixi
import {
TRUE_STRING, FALSE_STRING
} from '@/utils/ADempiere/formatValue/booleanFormat'
import { RECORD_ID } from '@/utils/ADempiere/constants/systemColumns'
import { COLUMNNAME_RECORD_ID } from '@/utils/ADempiere/constants/systemColumns'
import { IDENTIFIER_COLUMN_SUFFIX } from '@/utils/ADempiere/dictionaryUtils'

// Utils and Helpers Methods
Expand Down Expand Up @@ -105,7 +105,7 @@ export default {

computed: {
isDisabledButton() {
return (this.metadata.readonly || this.isDisableAction) && !['Posted', RECORD_ID].includes(this.metadata.columnName)
return (this.metadata.readonly || this.isDisableAction) && !['Posted', COLUMNNAME_RECORD_ID].includes(this.metadata.columnName)
},
isDisableAction() {
return this.actionAssociated.isEnabled && !this.actionAssociated.isEnabled()
Expand Down Expand Up @@ -169,7 +169,7 @@ export default {
return isShowAcct
}
}
} else if (this.metadata.columnName === RECORD_ID) {
} else if (this.metadata.columnName === COLUMNNAME_RECORD_ID) {
return {
// is: 'svg-icon',
// 'icon-class': 'zoom-in',
Expand Down Expand Up @@ -327,7 +327,7 @@ export default {
},

currentTableId() {
if (this.metadata.displayed && this.metadata.columnName === RECORD_ID) {
if (this.metadata.displayed && this.metadata.columnName === COLUMNNAME_RECORD_ID) {
const { containerUuid, inTable } = this.metadata
// table records values
if (inTable) {
Expand All @@ -353,7 +353,7 @@ export default {

watch: {
contextAttributes(newValue, oldValue) {
if (this.metadata.columnName === RECORD_ID && !isSameValues(newValue, oldValue)) {
if (this.metadata.columnName === COLUMNNAME_RECORD_ID && !isSameValues(newValue, oldValue)) {
if (!isEmptyValue(newValue)) {
this.setDefaultValue()
}
Expand All @@ -369,7 +369,7 @@ export default {
},

beforeMount() {
if (this.metadata.displayed && this.metadata.columnName === RECORD_ID) {
if (this.metadata.displayed && this.metadata.columnName === COLUMNNAME_RECORD_ID) {
if (!this.emptyValue && typeof this.value === 'number') {
if (isEmptyValue(this.displayedValue)) {
// request lookup
Expand Down
6 changes: 6 additions & 0 deletions src/utils/ADempiere/constants/systemColumns.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,13 @@ export const UUID = 'UUID'

export const ID = 'ID'

export const COLUMNNAME_AD_Table_ID = 'AD_Table_ID'

/**
* @deprecated
*/
export const RECORD_ID = 'Record_ID'
export const COLUMNNAME_RECORD_ID = 'Record_ID'

export const COUNTRY = 'C_Country_ID'

Expand Down
3 changes: 3 additions & 0 deletions src/utils/ADempiere/valueFormat.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
DATE, DATE_PLUS_TIME, TIME,
AMOUNT, COSTS_PLUS_PRICES, NUMBER, QUANTITY,
CHAR, MEMO, TEXT, TEXT_LONG,
BUTTON, ID,
ACCOUNT_ELEMENT, LOCATION_ADDRESS, // Custom lookups
LOCATOR_WAREHOUSE, PRODUCT_ATTRIBUTE, // Custom lookups of Producs
LIST, TABLE, TABLE_DIRECT, SEARCH, // Standard lookups
Expand Down Expand Up @@ -80,6 +81,8 @@ export function formatField({
let formattedValue
switch (displayType) {
case ACCOUNT_ELEMENT.id:
case BUTTON.id:
case ID.id:
case LIST.id:
case LOCATION_ADDRESS.id:
case LOCATOR_WAREHOUSE.id:
Expand Down

0 comments on commit ea314aa

Please sign in to comment.