🎯 Development
- Extended OrderOperation registration with isLocked function to check readonly/locked mode
- Added knownOperations.isLocked(type, entity) for checking readonly/locked mode of an entity
- Admin UI now supports customization of Readonly/Locked Mode for order operations. Operation extended with isLocked(entity) function for defining custom readonly rules.
Operation Registation
knownOperations.registerOperation({
type: 'CustomerOrder',
treeTemplateUrl: 'orderOperationDefault.tpl.html',
isLocked: function (entity) {
return entity.status === 'Completed' ||
entity.cancelledState === 'Completed' ||
entity.isCancelled;
},
detailBlade: {
id: 'orderDetail',
template: 'Modules/$(VirtoCommerce.Orders)/Scripts/blades/customerOrder-detail.tpl.html',
knownChildrenOperations: ['Shipment', 'PaymentIn'],
metaFields: [
...
Extension Samples - Deactivate Readonly
var orderOperation = knownOperations.getOperation('CustomerOrder');
// Override Readonly/Locked default logic for CustomerOrder
orderOperation.isLocked = function () {
return false;
};