mirror of
https://github.com/inventree/inventree-app.git
synced 2025-06-15 19:55:27 +00:00
Add support for company attachments (#261)
* Add support for company attachments - Add API version check - Add new class - Add link to company detail page - Assorted refactoring * linting fixes
This commit is contained in:
@ -2,7 +2,6 @@ import "package:flutter/material.dart";
|
||||
|
||||
import "package:font_awesome_flutter/font_awesome_flutter.dart";
|
||||
|
||||
import "package:inventree/api.dart";
|
||||
import "package:inventree/app_colors.dart";
|
||||
import "package:inventree/barcode.dart";
|
||||
import "package:inventree/l10.dart";
|
||||
@ -51,7 +50,7 @@ class _LocationDisplayState extends RefreshableState<LocationDisplayWidget> {
|
||||
if (location != null) {
|
||||
|
||||
// Add "locate" button
|
||||
if (InvenTreeAPI().supportsMixin("locate")) {
|
||||
if (api.supportsMixin("locate")) {
|
||||
actions.add(
|
||||
IconButton(
|
||||
icon: FaIcon(FontAwesomeIcons.magnifyingGlassLocation),
|
||||
@ -64,7 +63,7 @@ class _LocationDisplayState extends RefreshableState<LocationDisplayWidget> {
|
||||
}
|
||||
|
||||
// Add "edit" button
|
||||
if (InvenTreeAPI().checkPermission("stock_location", "change")) {
|
||||
if (api.checkPermission("stock_location", "change")) {
|
||||
actions.add(
|
||||
IconButton(
|
||||
icon: FaIcon(FontAwesomeIcons.penToSquare),
|
||||
@ -86,7 +85,7 @@ class _LocationDisplayState extends RefreshableState<LocationDisplayWidget> {
|
||||
final _loc = location;
|
||||
|
||||
if (_loc != null) {
|
||||
InvenTreeAPI().locateItemOrLocation(context, location: _loc.pk);
|
||||
api.locateItemOrLocation(context, location: _loc.pk);
|
||||
}
|
||||
}
|
||||
|
||||
@ -372,7 +371,7 @@ class _LocationDisplayState extends RefreshableState<LocationDisplayWidget> {
|
||||
|
||||
tiles.add(locationDescriptionCard(includeActions: false));
|
||||
|
||||
if (InvenTreeAPI().checkPermission("stock", "add")) {
|
||||
if (api.checkPermission("stock", "add")) {
|
||||
|
||||
tiles.add(
|
||||
ListTile(
|
||||
@ -403,7 +402,7 @@ class _LocationDisplayState extends RefreshableState<LocationDisplayWidget> {
|
||||
if (location != null) {
|
||||
|
||||
// Scan stock item into location
|
||||
if (InvenTreeAPI().checkPermission("stock", "change")) {
|
||||
if (api.checkPermission("stock", "change")) {
|
||||
tiles.add(
|
||||
ListTile(
|
||||
title: Text(L10().barcodeScanItem),
|
||||
@ -429,7 +428,7 @@ class _LocationDisplayState extends RefreshableState<LocationDisplayWidget> {
|
||||
);
|
||||
|
||||
// Scan this location into another one
|
||||
if (InvenTreeAPI().checkPermission("stock_location", "change")) {
|
||||
if (api.checkPermission("stock_location", "change")) {
|
||||
tiles.add(
|
||||
ListTile(
|
||||
title: Text(L10().transferStockLocation),
|
||||
@ -454,7 +453,7 @@ class _LocationDisplayState extends RefreshableState<LocationDisplayWidget> {
|
||||
);
|
||||
}
|
||||
|
||||
if (InvenTreeAPI().supportModernBarcodes) {
|
||||
if (api.supportModernBarcodes) {
|
||||
tiles.add(
|
||||
customBarcodeActionTile(context, this, location!.customBarcode, "stocklocation", location!.pk)
|
||||
);
|
||||
|
Reference in New Issue
Block a user