2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-12-17 01:38:19 +00:00

Merge branch 'master' into generic-parameters

This commit is contained in:
Oliver
2025-12-02 18:17:08 +11:00
committed by GitHub
9 changed files with 20 additions and 17 deletions

View File

@@ -157,7 +157,7 @@ jobs:
with: with:
persist-credentials: false persist-credentials: false
- name: Set Up Python ${{ env.python_version }} - name: Set Up Python ${{ env.python_version }}
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # pin@v6.0.0 uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # pin@v6.1.0
with: with:
python-version: ${{ env.python_version }} python-version: ${{ env.python_version }}
- name: Version Check - name: Version Check

View File

@@ -86,7 +86,7 @@ jobs:
with: with:
persist-credentials: false persist-credentials: false
- name: Set up Python ${{ env.python_version }} - name: Set up Python ${{ env.python_version }}
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # pin@v6.0.0 uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # pin@v6.1.0
with: with:
python-version: ${{ env.python_version }} python-version: ${{ env.python_version }}
cache: "pip" cache: "pip"
@@ -130,7 +130,7 @@ jobs:
with: with:
persist-credentials: false persist-credentials: false
- name: Set up Python ${{ env.python_version }} - name: Set up Python ${{ env.python_version }}
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # pin@v6.0.0 uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # pin@v6.1.0
with: with:
python-version: ${{ env.python_version }} python-version: ${{ env.python_version }}
- name: Check Config - name: Check Config

View File

@@ -12,6 +12,7 @@ from django.core.exceptions import ValidationError
from django.db import models, transaction from django.db import models, transaction
from django.db.models import QuerySet from django.db.models import QuerySet
from django.db.models.signals import post_save from django.db.models.signals import post_save
from django.db.transaction import TransactionManagementError
from django.dispatch import receiver from django.dispatch import receiver
from django.urls import resolve, reverse from django.urls import resolve, reverse
from django.urls.exceptions import NoReverseMatch from django.urls.exceptions import NoReverseMatch
@@ -915,7 +916,15 @@ class InvenTreeTree(ContentTypeMixin, MPTTModel):
if len(trees) > 0: if len(trees) > 0:
# A tree update was performed, so we need to refresh the instance # A tree update was performed, so we need to refresh the instance
try:
self.refresh_from_db() self.refresh_from_db()
except TransactionManagementError:
# If we are inside a transaction block, we cannot refresh from db
pass
except Exception as e:
# Any other error is unexpected
InvenTree.sentry.report_exception(e)
InvenTree.exceptions.log_error(f'{self.__class__.__name__}.save')
def partial_rebuild(self, tree_id: int) -> bool: def partial_rebuild(self, tree_id: int) -> bool:
"""Perform a partial rebuild of the tree structure. """Perform a partial rebuild of the tree structure.

View File

@@ -52,12 +52,12 @@ export function PrintingActions({
const [labelId, setLabelId] = useState<number | undefined>(undefined); const [labelId, setLabelId] = useState<number | undefined>(undefined);
const [reportId, setReportId] = useState<number | undefined>(undefined); const [reportId, setReportId] = useState<number | undefined>(undefined);
const labelProgress = useDataOutput({ useDataOutput({
title: t`Printing Labels`, title: t`Printing Labels`,
id: labelId id: labelId
}); });
const reportProgress = useDataOutput({ useDataOutput({
title: t`Printing Reports`, title: t`Printing Reports`,
id: reportId id: reportId
}); });

View File

@@ -30,7 +30,7 @@ export default function useDataExport({
const [exportId, setExportId] = useState<number | undefined>(undefined); const [exportId, setExportId] = useState<number | undefined>(undefined);
const progress = useDataOutput({ useDataOutput({
title: t`Exporting Data`, title: t`Exporting Data`,
id: exportId id: exportId
}); });

View File

@@ -40,7 +40,7 @@ export default function useDataOutput({
} else setLoading(false); } else setLoading(false);
}, [id, title]); }, [id, title]);
const progress = useQuery({ useQuery({
enabled: !!id && loading && visibility === 'visible', enabled: !!id && loading && visibility === 'visible',
refetchInterval: 500, refetchInterval: 500,
queryKey: ['data-output', id, title], queryKey: ['data-output', id, title],

View File

@@ -49,7 +49,7 @@ export function useImportSession({
setInstance(data); setInstance(data);
}, []); }, []);
const importSessionStatus = useStatusCodes({ useStatusCodes({
modelType: ModelType.importsession modelType: ModelType.importsession
}); });

View File

@@ -72,11 +72,7 @@ export default function SalesOrderShipmentDetail() {
} }
}); });
const { const { instance: customer, instanceQuery: customerQuery } = useInstance({
instance: customer,
instanceQuery: customerQuery,
refreshInstance: refreshCustomer
} = useInstance({
endpoint: ApiEndpoints.company_list, endpoint: ApiEndpoints.company_list,
pk: shipment.order_detail?.customer, pk: shipment.order_detail?.customer,
hasPrimaryKey: true hasPrimaryKey: true

View File

@@ -103,9 +103,7 @@ export function MachineDriverTable({
function MachineTypeDrawer({ function MachineTypeDrawer({
machineTypeSlug machineTypeSlug
}: Readonly<{ machineTypeSlug: string }>) { }: Readonly<{ machineTypeSlug: string }>) {
const navigate = useNavigate(); const { machineTypes, isFetching } = useMachineTypeDriver({
const { machineTypes, refresh, isFetching } = useMachineTypeDriver({
includeDrivers: false includeDrivers: false
}); });
const machineType = useMemo( const machineType = useMemo(