Announcement

Collapse
No announcement yet.

Advanced Pack - quotes: making listPrice read only in item List.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Advanced Pack - quotes: making listPrice read only in item List.

    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?

    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);
    thanks, regards,
    Miche

  • #2
    Hi,
    You better create a team of users, then create a rule for this team where should be defined "Field Level" restriction for the "Products" --> field "List Price". Choose "Read" --> "yes", "Edit" --> "no".
    Last edited by Maximus; 01-03-2019, 05:41 AM.

    Comment


    • #3
      Originally posted by Maximus View Post
      Hi,
      You better create a team of users, then create a rule for this team where should be defined "Field Level" restriction for the "Products" --> field "List Price". Choose "Read" --> "yes", "Edit" --> "no".
      Hi Maximus,

      Did you test this? It does not work for me...

      thanks
      Michele

      Comment

      Working...
      X