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 NotesEditor from '../../components/editors/NotesEditor';
|
||||||
import {
|
import {
|
||||||
ActionDropdown,
|
ActionDropdown,
|
||||||
|
BarcodeActionDropdown,
|
||||||
CancelItemAction,
|
CancelItemAction,
|
||||||
DuplicateItemAction,
|
DuplicateItemAction,
|
||||||
EditItemAction,
|
EditItemAction,
|
||||||
@ -366,9 +367,7 @@ export default function BuildDetail() {
|
|||||||
const buildActions = useMemo(() => {
|
const buildActions = useMemo(() => {
|
||||||
return [
|
return [
|
||||||
<AdminButton model={ModelType.build} pk={build.pk} />,
|
<AdminButton model={ModelType.build} pk={build.pk} />,
|
||||||
<ActionDropdown
|
<BarcodeActionDropdown
|
||||||
tooltip={t`Barcode Actions`}
|
|
||||||
icon={<IconQrcode />}
|
|
||||||
actions={[
|
actions={[
|
||||||
ViewBarcodeAction({
|
ViewBarcodeAction({
|
||||||
model: ModelType.build,
|
model: ModelType.build,
|
||||||
|
@ -18,9 +18,13 @@ import { ItemDetailsGrid } from '../../components/details/ItemDetails';
|
|||||||
import NotesEditor from '../../components/editors/NotesEditor';
|
import NotesEditor from '../../components/editors/NotesEditor';
|
||||||
import {
|
import {
|
||||||
ActionDropdown,
|
ActionDropdown,
|
||||||
|
BarcodeActionDropdown,
|
||||||
CancelItemAction,
|
CancelItemAction,
|
||||||
DuplicateItemAction,
|
DuplicateItemAction,
|
||||||
EditItemAction
|
EditItemAction,
|
||||||
|
LinkBarcodeAction,
|
||||||
|
UnlinkBarcodeAction,
|
||||||
|
ViewBarcodeAction
|
||||||
} from '../../components/items/ActionDropdown';
|
} from '../../components/items/ActionDropdown';
|
||||||
import { PlaceholderPanel } from '../../components/items/Placeholder';
|
import { PlaceholderPanel } from '../../components/items/Placeholder';
|
||||||
import InstanceDetail from '../../components/nav/InstanceDetail';
|
import InstanceDetail from '../../components/nav/InstanceDetail';
|
||||||
@ -290,6 +294,20 @@ export default function ReturnOrderDetail() {
|
|||||||
const orderActions = useMemo(() => {
|
const orderActions = useMemo(() => {
|
||||||
return [
|
return [
|
||||||
<AdminButton model={ModelType.returnorder} pk={order.pk} />,
|
<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
|
<PrintingActions
|
||||||
modelType={ModelType.returnorder}
|
modelType={ModelType.returnorder}
|
||||||
items={[order.pk]}
|
items={[order.pk]}
|
||||||
|
@ -21,9 +21,13 @@ import { ItemDetailsGrid } from '../../components/details/ItemDetails';
|
|||||||
import NotesEditor from '../../components/editors/NotesEditor';
|
import NotesEditor from '../../components/editors/NotesEditor';
|
||||||
import {
|
import {
|
||||||
ActionDropdown,
|
ActionDropdown,
|
||||||
|
BarcodeActionDropdown,
|
||||||
CancelItemAction,
|
CancelItemAction,
|
||||||
DuplicateItemAction,
|
DuplicateItemAction,
|
||||||
EditItemAction
|
EditItemAction,
|
||||||
|
LinkBarcodeAction,
|
||||||
|
UnlinkBarcodeAction,
|
||||||
|
ViewBarcodeAction
|
||||||
} from '../../components/items/ActionDropdown';
|
} from '../../components/items/ActionDropdown';
|
||||||
import { PlaceholderPanel } from '../../components/items/Placeholder';
|
import { PlaceholderPanel } from '../../components/items/Placeholder';
|
||||||
import InstanceDetail from '../../components/nav/InstanceDetail';
|
import InstanceDetail from '../../components/nav/InstanceDetail';
|
||||||
@ -298,6 +302,20 @@ export default function SalesOrderDetail() {
|
|||||||
const soActions = useMemo(() => {
|
const soActions = useMemo(() => {
|
||||||
return [
|
return [
|
||||||
<AdminButton model={ModelType.salesorder} pk={order.pk} />,
|
<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
|
<PrintingActions
|
||||||
modelType={ModelType.salesorder}
|
modelType={ModelType.salesorder}
|
||||||
items={[order.pk]}
|
items={[order.pk]}
|
||||||
|
Loading…
Reference in New Issue
Block a user