2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-06-12 10:15:32 +00:00

Make notes widget "generic" (#327)

* Make notes widget "generic"

- No longer tied to the "part" model
- Will allow us to use it elsewhere

* Update release notes

* Add helper methods for checking model permissions

* Refactoring of permissions checks

* Add notes to the "purchase order" widget

* Fix typos

* remove bom tab from part view

* linting fixes
This commit is contained in:
Oliver
2023-04-19 21:57:28 +10:00
committed by GitHub
parent 28ed1ed545
commit b9ffabd561
20 changed files with 192 additions and 168 deletions

View File

@ -57,10 +57,7 @@ class _SupplierPartDisplayState extends RefreshableState<SupplierPartDetailWidge
List<SpeedDialChild> barcodeButtons(BuildContext context) {
List<SpeedDialChild> actions = [];
if (api.checkPermission("purchase_order", "change") ||
api.checkPermission("sales_order", "change") ||
api.checkPermission("return_order", "change")) {
if (widget.supplierPart.canEdit) {
actions.add(
customBarcodeAction(
context, this,
@ -78,9 +75,7 @@ class _SupplierPartDisplayState extends RefreshableState<SupplierPartDetailWidge
List<Widget> appBarActions(BuildContext context) {
List<Widget> actions = [];
if (api.checkPermission("purchase_order", "change") ||
api.checkPermission("sales_order", "change") ||
api.checkPermission("return_order", "change")) {
if (widget.supplierPart.canEdit) {
actions.add(
IconButton(
icon: Icon(Icons.edit_square),