mirror of
https://github.com/inventree/InvenTree.git
synced 2025-12-19 18:53:29 +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 { IconBuildingStore, IconCopy, IconPackages } from '@tabler/icons-react';
|
||||
import { useMemo, useState } from 'react';
|
||||
|
||||
import { ApiEndpoints } from '@lib/enums/ApiEndpoints';
|
||||
import { apiUrl } from '@lib/functions/Api';
|
||||
import type { ApiFormFieldSet } from '@lib/types/Forms';
|
||||
import { useApi } from '../contexts/ApiContext';
|
||||
import { useGlobalSettingsState } from '../states/SettingsStates';
|
||||
|
||||
@@ -57,6 +58,13 @@ export function usePartFields({
|
||||
structural: false
|
||||
}
|
||||
},
|
||||
default_supplier: {
|
||||
model: ModelType.company,
|
||||
api_url: apiUrl(ApiEndpoints.company_list),
|
||||
filters: {
|
||||
is_supplier: true
|
||||
}
|
||||
},
|
||||
default_expiry: {},
|
||||
minimum_stock: {},
|
||||
responsible: {
|
||||
|
||||
@@ -501,6 +501,13 @@ export default function PartDetail() {
|
||||
model: ModelType.stocklocation,
|
||||
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',
|
||||
name: 'units',
|
||||
|
||||
Reference in New Issue
Block a user