2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-05-03 13:58:47 +00:00

[UI] Edit fix (#9367) (#9368)

* Fix for editing stock location

* Fix for editing part category

(cherry picked from commit 8997f193c925e5b31e4deace56167ac45cf599d2)

Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
This commit is contained in:
github-actions[bot] 2025-03-24 20:45:58 +11:00 committed by GitHub
parent ff4df83ccd
commit 02876f3c54
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 2 deletions

View File

@ -341,7 +341,9 @@ export default function CategoryDetail() {
}}
actions={categoryActions}
editAction={editCategory.open}
editEnabled={user.hasChangePermission(ModelType.partcategory)}
editEnabled={
!!category?.pk && user.hasChangePermission(ModelType.partcategory)
}
/>
<PanelGroup
pageKey='partcategory'

View File

@ -381,7 +381,10 @@ export default function Stock() {
icon={location?.icon && <ApiIcon name={location?.icon} />}
actions={locationActions}
editAction={editLocation.open}
editEnabled={user.hasChangePermission(ModelType.stocklocation)}
editEnabled={
!!location?.pk &&
user.hasChangePermission(ModelType.stocklocation)
}
breadcrumbs={breadcrumbs}
breadcrumbAction={() => {
setTreeOpen(true);