mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
[PUI] Add more barcode actions (#7741)
- Add to ReturnOrder - Add to SalesOrder - Refactor for BuildOrder
This commit is contained in:
parent
86fb9f0a8c
commit
f92d734d80
@ -24,6 +24,7 @@ import { ItemDetailsGrid } from '../../components/details/ItemDetails';
|
||||
import NotesEditor from '../../components/editors/NotesEditor';
|
||||
import {
|
||||
ActionDropdown,
|
||||
BarcodeActionDropdown,
|
||||
CancelItemAction,
|
||||
DuplicateItemAction,
|
||||
EditItemAction,
|
||||
@ -366,9 +367,7 @@ export default function BuildDetail() {
|
||||
const buildActions = useMemo(() => {
|
||||
return [
|
||||
<AdminButton model={ModelType.build} pk={build.pk} />,
|
||||
<ActionDropdown
|
||||
tooltip={t`Barcode Actions`}
|
||||
icon={<IconQrcode />}
|
||||
<BarcodeActionDropdown
|
||||
actions={[
|
||||
ViewBarcodeAction({
|
||||
model: ModelType.build,
|
||||
|
@ -18,9 +18,13 @@ import { ItemDetailsGrid } from '../../components/details/ItemDetails';
|
||||
import NotesEditor from '../../components/editors/NotesEditor';
|
||||
import {
|
||||
ActionDropdown,
|
||||
BarcodeActionDropdown,
|
||||
CancelItemAction,
|
||||
DuplicateItemAction,
|
||||
EditItemAction
|
||||
EditItemAction,
|
||||
LinkBarcodeAction,
|
||||
UnlinkBarcodeAction,
|
||||
ViewBarcodeAction
|
||||
} from '../../components/items/ActionDropdown';
|
||||
import { PlaceholderPanel } from '../../components/items/Placeholder';
|
||||
import InstanceDetail from '../../components/nav/InstanceDetail';
|
||||
@ -290,6 +294,20 @@ export default function ReturnOrderDetail() {
|
||||
const orderActions = useMemo(() => {
|
||||
return [
|
||||
<AdminButton model={ModelType.returnorder} pk={order.pk} />,
|
||||
<BarcodeActionDropdown
|
||||
actions={[
|
||||
ViewBarcodeAction({
|
||||
model: ModelType.returnorder,
|
||||
pk: order.pk
|
||||
}),
|
||||
LinkBarcodeAction({
|
||||
hidden: order?.barcode_hash
|
||||
}),
|
||||
UnlinkBarcodeAction({
|
||||
hidden: !order?.barcode_hash
|
||||
})
|
||||
]}
|
||||
/>,
|
||||
<PrintingActions
|
||||
modelType={ModelType.returnorder}
|
||||
items={[order.pk]}
|
||||
|
@ -21,9 +21,13 @@ import { ItemDetailsGrid } from '../../components/details/ItemDetails';
|
||||
import NotesEditor from '../../components/editors/NotesEditor';
|
||||
import {
|
||||
ActionDropdown,
|
||||
BarcodeActionDropdown,
|
||||
CancelItemAction,
|
||||
DuplicateItemAction,
|
||||
EditItemAction
|
||||
EditItemAction,
|
||||
LinkBarcodeAction,
|
||||
UnlinkBarcodeAction,
|
||||
ViewBarcodeAction
|
||||
} from '../../components/items/ActionDropdown';
|
||||
import { PlaceholderPanel } from '../../components/items/Placeholder';
|
||||
import InstanceDetail from '../../components/nav/InstanceDetail';
|
||||
@ -298,6 +302,20 @@ export default function SalesOrderDetail() {
|
||||
const soActions = useMemo(() => {
|
||||
return [
|
||||
<AdminButton model={ModelType.salesorder} pk={order.pk} />,
|
||||
<BarcodeActionDropdown
|
||||
actions={[
|
||||
ViewBarcodeAction({
|
||||
model: ModelType.salesorder,
|
||||
pk: order.pk
|
||||
}),
|
||||
LinkBarcodeAction({
|
||||
hidden: order?.barcode_hash
|
||||
}),
|
||||
UnlinkBarcodeAction({
|
||||
hidden: !order?.barcode_hash
|
||||
})
|
||||
]}
|
||||
/>,
|
||||
<PrintingActions
|
||||
modelType={ModelType.salesorder}
|
||||
items={[order.pk]}
|
||||
|
Loading…
Reference in New Issue
Block a user