2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-06-15 19:55:27 +00:00

Project code support (#336)

* Determine if project codes are supported

* Add helpers for boolean functions

* Adds helper methods for generic "model" class

- Will allow us to do some good refactoring

* Refactor the refactor

* Add debug support and getMap function

* Major refactoring for model data accessors

* Handle null values

* Add sentry reporting if key is used incorrectly

* Fix typo

* Refactor createFromJson function

* Add model for ProjectCode

* Display and edit project code for purchase orders
This commit is contained in:
Oliver
2023-04-21 21:12:22 +10:00
committed by GitHub
parent 95573a2784
commit e23a8b4d5e
13 changed files with 383 additions and 299 deletions

View File

@ -15,6 +15,7 @@ import "package:inventree/l10.dart";
import "package:inventree/inventree/company.dart";
import "package:inventree/inventree/part.dart";
import "package:inventree/inventree/project_code.dart";
import "package:inventree/inventree/sentry.dart";
import "package:inventree/inventree/stock.dart";
@ -667,6 +668,13 @@ class APIFormField {
height: 40
)
);
case "projectcode":
var project_code = InvenTreeProjectCode.fromJson(data);
return ListTile(
title: Text(project_code.code),
subtitle: Text(project_code.description),
leading: FaIcon(FontAwesomeIcons.list)
);
default:
return ListTile(
title: Text(