Quote items reorder not working.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • clevercode
    Junior Member
    • Jun 2017
    • 6

    Quote items reorder not working.

    When you are tying to reorder items in a quote is working but after saving you will get the same itemList before reOrder. I have tested on demo.espocrm.de and it is the same issue. I think it's a BUG. Please advise me what to do. Thank you.
  • yuri
    Member
    • Mar 2014
    • 8443

    #2
    Could reproduce it. Will be fixed in the next release. Thanks.
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment

    • clevercode
      Junior Member
      • Jun 2017
      • 6

      #3
      Solved. Found this approach :
      file: /client/modules/advanced/src/views/quote/fields/item-list.js

      PHP Code:
      reOrder: function (idList) {
                  var orderedItemList = [];
                  var itemList = this.model.get('itemList') || [];
                  var i = 0;
      
                  idList.forEach(function (id) {
                      itemList.forEach(function (item) {
                          if (item.id === id) {
                              item.order = ++i;
                              orderedItemList.push(item);
                          }
                      }, this);
                  }, this);
                  this.model.set('itemList', orderedItemList);
              } 
      
      and is working.
      Last edited by clevercode; 06-14-2017, 08:51 AM.

      Comment

      • yuri
        Member
        • Mar 2014
        • 8443

        #4
        It's not proper fix. It will be fixed on server side in the next release. Soon.
        If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

        Comment

        Working...