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

Commit

Permalink
fix: Payment Rule field with Button as List display type. (#2699)
Browse files Browse the repository at this point in the history
  • Loading branch information
EdwinBetanc0urt authored Sep 27, 2024
1 parent 66f8f70 commit d9b4950
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/utils/ADempiere/dictionaryUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import lang from '@/lang'

// Constants
import REFERENCES, { YES_NO, DEFAULT_SIZE } from '@/utils/ADempiere/references'
import REFERENCES, { YES_NO, DEFAULT_SIZE, BUTTON, LIST } from '@/utils/ADempiere/references'
import {
FIELD_OPERATORS_LIST, OPERATOR_EQUAL,
OPERATOR_LIKE, OPERATOR_GREATER_EQUAL, OPERATOR_LESS_EQUAL, OPERATOR_BETWEEN
Expand Down Expand Up @@ -113,7 +113,16 @@ export function generateField({
let valueIsReadOnlyForm

let isColumnDocumentStatus = false
const componentReference = evalutateTypeField(fieldToGenerate.display_type)
let componentReference = evalutateTypeField(fieldToGenerate.display_type)
// overwrite `Button` to `List` display type on `PaymentRule`.
if ([columnName, fieldToGenerate.element_name].includes('PaymentRule') && fieldToGenerate.display_type === BUTTON.id) {
componentReference = LIST
fieldToGenerate.display_type = LIST.id
fieldToGenerate.reference = {
table_name: 'AD_Ref_List',
context_column_names: []
}
}

// evaluate logics (diplayed, mandatory, readOnly)
let evaluatedLogics = getEvaluatedFieldLogics({
Expand Down

0 comments on commit d9b4950

Please sign in to comment.