Skip to content

Commit

Permalink
fix: Refresh parent tab with refresh line.
Browse files Browse the repository at this point in the history
  • Loading branch information
EdwinBetanc0urt committed Oct 8, 2024
1 parent e5e9fe4 commit 01353c8
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,11 @@ export default defineComponent({
// refresh parent tab on document window
if (!tabAttributes.value.isParentTab) {
const { firstTabUuid } = tabAttributes.value
const firstTab = store.getters.getStoredTab(
const storedFirstTab = store.getters.getStoredTab(
props.parentUuid,
firstTabUuid
)
if (!isEmptyValue(firstTab) && firstTab.is_document) {
if (!isEmptyValue(storedFirstTab) && storedFirstTab.table.is_document) {
refreshRecord.refreshRecord({
parentUuid: props.parentUuid,
containerUuid: firstTabUuid
Expand Down
2 changes: 1 addition & 1 deletion src/components/ADempiere/TabManager/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1040,7 +1040,7 @@ export default defineComponent({
currentTab.parentUuid,
firstTabUuid
)
if (!isEmptyValue(firstTab) && firstTab.is_document) {
if (!isEmptyValue(firstTab) && firstTab.table.is_document) {
refreshRecord.refreshRecord({
parentUuid: currentTab.parentUuid,
containerUuid: firstTabUuid
Expand Down
26 changes: 22 additions & 4 deletions src/utils/ADempiere/dictionary/window/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -755,13 +755,19 @@ export const deleteRecord = {
return false
}

const tab = store.getters.getStoredTab(parentUuid, containerUuid)
if (!tab.table.is_deleteable) {
const storedTab = store.getters.getStoredTab(parentUuid, containerUuid)
if (isEmptyValue(storedTab)) {
return false
}
const {
isShowedTableRecords, table, isParentTab, firstTabUuid
} = storedTab
if (!table.is_deleteable) {
return false
}

// delete selection of records on table
if (tab.isShowedTableRecords) {
if (isShowedTableRecords) {
const selectionsRecords = store.getters.getTabSelectionsList({
containerUuid
})
Expand All @@ -787,6 +793,18 @@ export const deleteRecord = {
message: language.t('recordManager.deleteRecordSuccessful'),
type: 'success'
})
if (!isParentTab) {
const storedFirstTab = store.getters.getStoredTab(
parentUuid,
firstTabUuid
)
if (!isEmptyValue(storedFirstTab) && storedFirstTab.table.is_document) {
refreshRecord.refreshRecord({
parentUuid: parentUuid,
containerUuid: firstTabUuid
})
}
}
})
.catch(error => {
showMessage({
Expand Down Expand Up @@ -1006,7 +1024,7 @@ export const refreshRecord = {
if (isEmptyValue(recordId)) {
recordId = store.getters.getIdOfContainer({
containerUuid: containerUuid,
tableName: tabDefinition.tableName
tableName: tabDefinition.table_name
})
}

Expand Down

0 comments on commit 01353c8

Please sign in to comment.