mirror of
https://github.com/inventree/InvenTree.git
synced 2026-05-09 03:03:41 +00:00
* Lock notes on orders if they are completed
Fixes #11879
* also check setting
* use statuscode object
* remove build lock
(cherry picked from commit 610e275ca0)
Co-authored-by: Matthias Mair <code@mjmair.com>
This commit is contained in:
committed by
GitHub
parent
599bf16c32
commit
457e8b4325
@@ -209,7 +209,7 @@ export default function NotesEditor({
|
|||||||
const sibling =
|
const sibling =
|
||||||
mdeInstance?.codemirror.getWrapperElement()?.nextSibling;
|
mdeInstance?.codemirror.getWrapperElement()?.nextSibling;
|
||||||
|
|
||||||
if (sibling != null) {
|
if (sibling != null && editable != false) {
|
||||||
EasyMDE.togglePreview(mdeInstance);
|
EasyMDE.togglePreview(mdeInstance);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -410,7 +410,13 @@ export default function PurchaseOrderDetail() {
|
|||||||
NotesPanel({
|
NotesPanel({
|
||||||
model_type: ModelType.purchaseorder,
|
model_type: ModelType.purchaseorder,
|
||||||
model_id: order.pk,
|
model_id: order.pk,
|
||||||
has_note: !!order.notes
|
has_note: !!order.notes,
|
||||||
|
// TODO @matmair - change API to include a "locked" attribute that we can check here
|
||||||
|
editable:
|
||||||
|
order.status == poStatus.COMPLETE &&
|
||||||
|
!globalSettings.isSet('PURCHASEORDER_EDIT_COMPLETED_ORDERS')
|
||||||
|
? false
|
||||||
|
: undefined
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
}, [order, id, user]);
|
}, [order, id, user]);
|
||||||
|
|||||||
@@ -448,7 +448,13 @@ export default function SalesOrderDetail() {
|
|||||||
NotesPanel({
|
NotesPanel({
|
||||||
model_type: ModelType.salesorder,
|
model_type: ModelType.salesorder,
|
||||||
model_id: order.pk,
|
model_id: order.pk,
|
||||||
has_note: !!order.notes
|
has_note: !!order.notes,
|
||||||
|
// TODO @matmair - change API to include a "locked" attribute that we can check here
|
||||||
|
editable:
|
||||||
|
order.status == soStatus.COMPLETE &&
|
||||||
|
!globalSettings.isSet('SALESORDER_EDIT_COMPLETED_ORDERS')
|
||||||
|
? false
|
||||||
|
: undefined
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
}, [order, id, user, soStatus, user]);
|
}, [order, id, user, soStatus, user]);
|
||||||
|
|||||||
Reference in New Issue
Block a user