Skip to content

Commit

Permalink
fix: Create record request with empty mandatory. (#1255)
Browse files Browse the repository at this point in the history
  • Loading branch information
EdwinBetanc0urt authored Oct 5, 2021
1 parent d717c57 commit b6bb0e9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
8 changes: 8 additions & 0 deletions src/store/modules/ADempiere/dictionary/window/getters.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ export default {
return undefined
},

getStoredFieldsFromTab: (state, getters) => (windowUuid, tabUuid) => {
const tab = getters.getStoredTab(windowUuid, tabUuid)
if (!isEmptyValue(tab)) {
return tab.fieldsList
}
return undefined
},

getCurrentTab: (state, getters) => (windowUuid) => {
const window = getters.getStoredWindow(windowUuid)

Expand Down
17 changes: 12 additions & 5 deletions src/store/modules/ADempiere/persistence.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,20 @@ const persistence = {
value
}) {
return new Promise((resolve, reject) => {
const { parentUuid, containerUuid } = field
commit('addChangeToPersistenceQueue', {
containerUuid: field.containerUuid,
containerUuid,
columnName: field.columnName,
value
})

// TODO: Add dictonary getter
const fieldsList = getters.getStoredFieldsFromTab(parentUuid, containerUuid)

const emptyFields = getters.getFieldsListEmptyMandatory({
containerUuid: field.containerUuid,
formatReturn: false
containerUuid,
formatReturn: false,
fieldsList
}).filter(itemField => {
return !LOG_COLUMNS_NAME_LIST.includes(itemField.columnName)
}).map(itemField => {
Expand All @@ -68,9 +72,12 @@ const persistence = {
return
}
const route = router.app._route
recordUuid = route.query.action === 'create-new' ? getters.getUuidOfContainer(field.containerUuid) : route.query.action
recordUuid = route.query.action === 'create-new'
? getters.getUuidOfContainer(field.containerUuid)
: route.query.action

dispatch('flushPersistenceQueue', {
containerUuid: field.containerUuid,
containerUuid,
tableName: field.tabTableName,
recordUuid
})
Expand Down

0 comments on commit b6bb0e9

Please sign in to comment.