Hi,
When inserting items in quotes I need to make listPrice unmodifiable for a certain group of users.
So I started tweaking inside quote/record/item-list.js. When setup() builds the layout of a single item row I set readOnly when it's listPrice turn. Unfortunately it seems not to affect currency field type. Is is right? I need to subclass currency to proper handle readonly that in fact I see in params. Or am I missing something else?
thanks, regards,
Miche
When inserting items in quotes I need to make listPrice unmodifiable for a certain group of users.
So I started tweaking inside quote/record/item-list.js. When setup() builds the layout of a single item row I set readOnly when it's listPrice turn. Unfortunately it seems not to affect currency field type. Is is right? I need to subclass currency to proper handle readonly that in fact I see in params. Or am I missing something else?
Code:
this.getHelper().layoutManager.get(this.itemEntityType, 'listItem', function (listLayout) { this.listLayout = Espo.Utils.cloneDeep(listLayout); this.listLayout.forEach(function (item) {[INDENT]item.key = item.name + 'Field'; if (item.name == 'quantity') { [/INDENT][INDENT=2]item.customLabel = this.translate('qty', 'fields', this.itemEntityType); [/INDENT][INDENT]} [B]if (item.name == 'listPrice') { [/B][/INDENT][INDENT=2][B]item.readOnly = true; [/B][/INDENT][INDENT][B]} [/B] [/INDENT] }, this);
Miche
Comment