How to lock closed opportunities/transactions?

How to lock closed opportunities/transactions?

Parents
  • You need to create a custom view record on Opportunities (custom/modules/Opportunities/clients/base/views/record/record.js)

    extendsFrom: 'OpportunitiesRecordView',

       initialize: function (options) {
          this._super('initialize', [options]);

          this.model.on("sync",function() {
             if(_.contains(['Closed Won', 'Closed Lost'], this.model.get('editable_c'))) {
                this.disableButton('edit_button');
                this.disableButton('cancel_button');
                this.disableButton('save_button');
                this.disableButton('delete_button');
             }
          }, this);

          this.context.on('button:aldar:click', this.executeMethod, this);
       },

       handleEdit: function(e, cell) {
        if(_.contains(['Closed Won', 'Closed Lost'], this.model.get('editable_c'))) this._super('handleEdit', [e, cell]);
       },

    Remember to run Quick Repair and Rebuild / Rebuild JS Grouping Files

    Regards

    André Lopes
    Lampada Global
    Skype: andre.lampada
Reply
  • You need to create a custom view record on Opportunities (custom/modules/Opportunities/clients/base/views/record/record.js)

    extendsFrom: 'OpportunitiesRecordView',

       initialize: function (options) {
          this._super('initialize', [options]);

          this.model.on("sync",function() {
             if(_.contains(['Closed Won', 'Closed Lost'], this.model.get('editable_c'))) {
                this.disableButton('edit_button');
                this.disableButton('cancel_button');
                this.disableButton('save_button');
                this.disableButton('delete_button');
             }
          }, this);

          this.context.on('button:aldar:click', this.executeMethod, this);
       },

       handleEdit: function(e, cell) {
        if(_.contains(['Closed Won', 'Closed Lost'], this.model.get('editable_c'))) this._super('handleEdit', [e, cell]);
       },

    Remember to run Quick Repair and Rebuild / Rebuild JS Grouping Files

    Regards

    André Lopes
    Lampada Global
    Skype: andre.lampada
Children