2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-12-14 16:29:57 +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:
persist-credentials: false
- 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:
python-version: ${{ env.python_version }}
- name: Version Check

View File

@@ -86,7 +86,7 @@ jobs:
with:
persist-credentials: false
- 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:
python-version: ${{ env.python_version }}
cache: "pip"
@@ -130,7 +130,7 @@ jobs:
with:
persist-credentials: false
- 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:
python-version: ${{ env.python_version }}
- name: Check Config

View File

@@ -12,6 +12,7 @@ from django.core.exceptions import ValidationError
from django.db import models, transaction
from django.db.models import QuerySet
from django.db.models.signals import post_save
from django.db.transaction import TransactionManagementError
from django.dispatch import receiver
from django.urls import resolve, reverse
from django.urls.exceptions import NoReverseMatch
@@ -915,7 +916,15 @@ class InvenTreeTree(ContentTypeMixin, MPTTModel):
if len(trees) > 0:
# A tree update was performed, so we need to refresh the instance
self.refresh_from_db()
try:
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:
"""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 [reportId, setReportId] = useState<number | undefined>(undefined);
const labelProgress = useDataOutput({
useDataOutput({
title: t`Printing Labels`,
id: labelId
});
const reportProgress = useDataOutput({
useDataOutput({
title: t`Printing Reports`,
id: reportId
});

View File

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

View File

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

View File

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

View File

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

View File

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