mirror of
https://github.com/inventree/InvenTree.git
synced 2025-12-20 03:03:30 +00:00
Fixes #10979 Co-authored-by: Matthias Mair <code@mjmair.com>
This commit is contained in:
@@ -1,10 +1,11 @@
|
|||||||
|
import { ModelType } from '@lib/index';
|
||||||
|
import type { ApiFormFieldSet } from '@lib/types/Forms';
|
||||||
import { t } from '@lingui/core/macro';
|
import { t } from '@lingui/core/macro';
|
||||||
import { IconBuildingStore, IconCopy, IconPackages } from '@tabler/icons-react';
|
import { IconBuildingStore, IconCopy, IconPackages } from '@tabler/icons-react';
|
||||||
import { useMemo, useState } from 'react';
|
import { useMemo, useState } from 'react';
|
||||||
|
|
||||||
import { ApiEndpoints } from '@lib/enums/ApiEndpoints';
|
import { ApiEndpoints } from '@lib/enums/ApiEndpoints';
|
||||||
import { apiUrl } from '@lib/functions/Api';
|
import { apiUrl } from '@lib/functions/Api';
|
||||||
import type { ApiFormFieldSet } from '@lib/types/Forms';
|
|
||||||
import { useApi } from '../contexts/ApiContext';
|
import { useApi } from '../contexts/ApiContext';
|
||||||
import { useGlobalSettingsState } from '../states/SettingsStates';
|
import { useGlobalSettingsState } from '../states/SettingsStates';
|
||||||
|
|
||||||
@@ -57,6 +58,13 @@ export function usePartFields({
|
|||||||
structural: false
|
structural: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
default_supplier: {
|
||||||
|
model: ModelType.company,
|
||||||
|
api_url: apiUrl(ApiEndpoints.company_list),
|
||||||
|
filters: {
|
||||||
|
is_supplier: true
|
||||||
|
}
|
||||||
|
},
|
||||||
default_expiry: {},
|
default_expiry: {},
|
||||||
minimum_stock: {},
|
minimum_stock: {},
|
||||||
responsible: {
|
responsible: {
|
||||||
|
|||||||
@@ -501,6 +501,13 @@ export default function PartDetail() {
|
|||||||
model: ModelType.stocklocation,
|
model: ModelType.stocklocation,
|
||||||
hidden: part.default_location || !part.category_default_location
|
hidden: part.default_location || !part.category_default_location
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
type: 'link',
|
||||||
|
name: 'default_supplier',
|
||||||
|
label: t`Default Supplier`,
|
||||||
|
model: ModelType.company,
|
||||||
|
hidden: !part.default_supplier
|
||||||
|
},
|
||||||
{
|
{
|
||||||
type: 'string',
|
type: 'string',
|
||||||
name: 'units',
|
name: 'units',
|
||||||
|
|||||||
Reference in New Issue
Block a user