Skip to content

Commit

Permalink
fix: Empty mandatory fields. (#699)
Browse files Browse the repository at this point in the history
Co-authored-by: EdwinBetanc0urt <EdwinBetanco0urt@outlook.com>
  • Loading branch information
EdwinBetanc0urt and EdwinBetanc0urt authored Mar 30, 2021
1 parent 0d30213 commit 2e39e18
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
3 changes: 2 additions & 1 deletion src/store/modules/ADempiere/panel/getters.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,9 @@ const getters = {
}
})

if (!isEmptyValue(formatReturn)) {
if (formatReturn) {
return fieldsNameEmpty.map(fieldItem => {
// fieldItem.name by default
return fieldItem[formatReturn]
})
}
Expand Down
22 changes: 12 additions & 10 deletions src/store/modules/ADempiere/windowControl/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -842,20 +842,22 @@ export default {
}).value
}

if (isReference) {
if (!isEmptyValue(parsedWhereClause)) {
parsedWhereClause += ` AND ${referenceWhereClause}`
} else {
parsedWhereClause += referenceWhereClause
const addWhereClause = (currentWhereClause, newWhereClause) => {
if (isEmptyValue(currentWhereClause)) {
return newWhereClause
}
if (isEmptyValue(newWhereClause)) {
return currentWhereClause
}
return `${currentWhereClause} AND ${newWhereClause}`
}

if (isReference) {
parsedWhereClause = addWhereClause(parsedWhereClause, referenceWhereClause)
}

if (!isEmptyValue(criteria)) {
if (!isEmptyValue(parsedWhereClause)) {
parsedWhereClause += ` AND ${criteria.whereClause}`
} else {
parsedWhereClause += criteria.whereClause
}
parsedWhereClause = addWhereClause(parsedWhereClause, criteria.whereClause)
}

const conditionsList = []
Expand Down

0 comments on commit 2e39e18

Please sign in to comment.