mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Test result table tweaks (#7290)
* Update initialData for new build output * Table updates
This commit is contained in:
parent
acdf7f5ec0
commit
8df04cb916
@ -439,7 +439,8 @@ class PartTestTemplateFilter(rest_filters.FilterSet):
|
||||
def filter_part(self, queryset, name, part):
|
||||
"""Filter by the 'part' field.
|
||||
|
||||
Note that for the 'part' field, we also include any parts "above" the specified part.
|
||||
Note: If the 'include_inherited' query parameter is set,
|
||||
we also include any parts "above" the specified part.
|
||||
"""
|
||||
include_inherited = str2bool(
|
||||
self.request.query_params.get('include_inherited', True)
|
||||
|
@ -114,7 +114,8 @@ export default function BuildOutputTable({ build }: { build: any }) {
|
||||
title: t`Add Build Output`,
|
||||
fields: buildOutputFields,
|
||||
initialData: {
|
||||
batch_code: build.batch
|
||||
batch_code: build.batch,
|
||||
location: build.destination ?? build.part_detail?.default_location
|
||||
},
|
||||
table: table
|
||||
});
|
||||
|
@ -126,16 +126,14 @@ export default function StockItemTestResultTable({
|
||||
switchable: false,
|
||||
sortable: true,
|
||||
render: (record: any) => {
|
||||
let required = record.required ?? record.template_detail?.required;
|
||||
let enabled = record.enabled ?? record.template_detail?.enabled;
|
||||
let installed =
|
||||
const enabled = record.enabled ?? record.template_detail?.enabled;
|
||||
const installed =
|
||||
record.stock_item != undefined && record.stock_item != itemId;
|
||||
|
||||
return (
|
||||
<Group justify="space-between">
|
||||
<Group justify="space-between" wrap="nowrap">
|
||||
<Text
|
||||
style={{ fontStyle: installed ? 'italic' : undefined }}
|
||||
fw={required && 700}
|
||||
c={enabled ? undefined : 'red'}
|
||||
>
|
||||
{!record.templateId && '- '}
|
||||
|
Loading…
Reference in New Issue
Block a user