diff --git a/src/components/ADempiere/PanelDefinition/StandardPanel.vue b/src/components/ADempiere/PanelDefinition/StandardPanel.vue index d102ad3e0bd..f3c8c12e8b0 100644 --- a/src/components/ADempiere/PanelDefinition/StandardPanel.vue +++ b/src/components/ADempiere/PanelDefinition/StandardPanel.vue @@ -159,9 +159,7 @@ export default defineComponent({ }) const recordUuid = computed(() => { - // TODO: Change query name 'action' - const { action } = root.$route.query - return action + return store.getters.getUuidOfContainer(props.containerUuid) }) const shadowGroup = computed(() => { diff --git a/src/store/modules/ADempiere/persistence.js b/src/store/modules/ADempiere/persistence.js index 6d3635dc187..2c5494e33d0 100644 --- a/src/store/modules/ADempiere/persistence.js +++ b/src/store/modules/ADempiere/persistence.js @@ -256,7 +256,7 @@ const persistence = { return true } // prevent `PO.set_Value: Column not updateable` - if (!isEmptyValue(recordUuid) && !field.isUpdateable) { + if (!isEmptyValue(recordUuid) && recordUuid !== 'create-new' && !field.isUpdateable) { return false } if (LOG_COLUMNS_NAME_LIST.includes(columnName)) { @@ -275,7 +275,7 @@ const persistence = { }) if (!isEmptyValue(attributesList)) { - if (!isEmptyValue(recordUuid)) { + if (!isEmptyValue(recordUuid) && recordUuid !== 'create-new') { // Update existing entity if (currentTab.keyColumns.length > 1) { reccordId = 0 @@ -463,7 +463,11 @@ const persistence = { const changes = state.persistence[key] if (!isEmptyValue(changes)) { - return Object.values(changes) + const valuesList = Object.values(changes) + if (isEmptyValue(recordUuid) || recordUuid === 'create-new') { + return valuesList + } + return valuesList // only changes .filter(attribute => { const { value, oldValue } = attribute @@ -489,7 +493,8 @@ const persistence = { const changes = state.persistence[key] if (!isEmptyValue(changes)) { - if (isEmptyValue(recordUuid)) { + const valuesList = Object.values(changes) + if (isEmptyValue(recordUuid) || recordUuid === 'create-new') { const defaultRow = rootGetters.getTabParsedDefaultValue({ parentUuid, containerUuid, @@ -497,7 +502,7 @@ const persistence = { formatToReturn: 'object' }) - return Object.values(changes) + return valuesList // only changes with default value .filter(attribute => { const { value, columnName } = attribute @@ -505,7 +510,7 @@ const persistence = { }) } - return Object.values(changes) + return valuesList // only changes .filter(attribute => { const { value, oldValue } = attribute diff --git a/src/utils/ADempiere/dictionary/window.js b/src/utils/ADempiere/dictionary/window.js index 57add813b08..1656783273c 100644 --- a/src/utils/ADempiere/dictionary/window.js +++ b/src/utils/ADempiere/dictionary/window.js @@ -244,6 +244,7 @@ export function evaluateDefaultFieldShowed({ VALUE, DOCUMENT_NO, CURRENCY, 'DateInvoiced', 'DateOrdered', 'DatePromised', 'DateTrx', 'MovementDate', 'M_Product_ID', 'QtyEntered', + 'ValidTo', // TODO: Remove this columns with fixes default value 'UserLevel' ] diff --git a/src/utils/ADempiere/formatValue/numberFormat.js b/src/utils/ADempiere/formatValue/numberFormat.js index dbbdcb36ad2..f609e0a0e5e 100644 --- a/src/utils/ADempiere/formatValue/numberFormat.js +++ b/src/utils/ADempiere/formatValue/numberFormat.js @@ -41,7 +41,7 @@ export function isNumber(value) { if (isNaN(value)) { return false } - true + return true } /**