mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-01-13 03:26:24 +00:00
Allow stock items to be created from top-level location (#338)
(cherry picked from commit fd85abf9d8)
This commit is contained in:
parent
e23a8b4d5e
commit
bb781aaed5
1 changed files with 2 additions and 7 deletions
|
|
@ -157,7 +157,7 @@ class _LocationDisplayState extends RefreshableState<LocationDisplayWidget> {
|
|||
}
|
||||
|
||||
// Create new item
|
||||
if (location != null && InvenTreeStockItem().canCreate) {
|
||||
if (InvenTreeStockItem().canCreate) {
|
||||
actions.add(
|
||||
SpeedDialChild(
|
||||
child: FaIcon(FontAwesomeIcons.boxesStacked),
|
||||
|
|
@ -243,11 +243,6 @@ class _LocationDisplayState extends RefreshableState<LocationDisplayWidget> {
|
|||
* Launch a dialog form to create a new stock item
|
||||
*/
|
||||
Future<void> _newStockItem(BuildContext context) async {
|
||||
int pk = location?.pk ?? -1;
|
||||
|
||||
if (location != null && pk <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
var fields = InvenTreeStockItem().formFields();
|
||||
|
||||
|
|
@ -258,7 +253,7 @@ class _LocationDisplayState extends RefreshableState<LocationDisplayWidget> {
|
|||
context,
|
||||
L10().stockItemCreate,
|
||||
data: {
|
||||
"location": location != null ? pk : null,
|
||||
"location": location != null ? location!.pk : null,
|
||||
},
|
||||
fields: fields,
|
||||
onSuccess: (result) async {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue