hunk.code_window:         assert self.browse(cr, uid, sale_record.procurement_group_id.id).procurement_ids[0].product_qty == 200
   - 
       Check a quotation was created to a certain vendor and confirm so it becomes a confirmed purchase order
   -
       !python {model: purchase.order}: |
           from openerp import netsvc, workflow
           sale_record = self.pool.get("sale.order").browse(cr, uid, ref('sale_order_drp_shpng'))
           procurement_order = self.pool.get("procurement.group").browse(cr, uid, sale_record.procurement_group_id.id).procurement_ids[0]
           purchase_id = procurement_order.purchase_line_id.order_id.id
  
hunk.labels: keep keep keep keep keep replace keep keep keep
hunk.after_edit:         from openerp import netsvc
  
hunk.file_path: addons/stock_dropshipping/test/dropship.yml
hunk.type: replace
file: define(['summernote/core/func'], function (func) {
    /**
     * list utils
     */
    var list = (function () {
      /**
       * returns the first item of an array.
       *
       * @param {Array} array
       */
      var head = function (array) {
        return array[0];
      };
  
      /**
       * returns the last item of an array.
       *
       * @param {Array} array
       */
      var last = function (array) {
        return array[array.length - 1];
      };
  
      /**
       * returns everything but the last entry of the array.
       *
       * @param {Array} array
       */
      var initial = function (array) {
        return array.slice(0, array.length - 1);
      };
  
      /**
       * returns the rest of the items in an array.
       *
       * @param {Array} array
       */
      var tail = function (array) {
        return array.slice(1);
      };
  
      /**
       * returns item of array
       */
      var find = function (array, pred) {
        for (var idx = 0, len = array.length; idx < len; idx ++) {
          var item = array[idx];
          if (pred(item)) {
            return item;
          }
        }
      };
  
      /**
       * returns true if all of the values in the array pass the predicate truth test.
       */
      var all = function (array, pred) {
        for (var idx = 0, len = array.length; idx < len; idx ++) {
          if (!pred(array[idx])) {
            return false;
          }
        }
        return true;
      };
  
      /**
       * returns true if the value is present in the list.
       */
      var contains = function (array, item) {
        return $.inArray(item, array) !== -1;
      };
  
      /**
       * get sum from a list
       *
       * @param {Array} array - array
       * @param {Function} fn - iterator
       */
      var sum = function (array, fn) {
        fn = fn || func.self;
        return array.reduce(function (memo, v) {
          return memo + fn(v);
        }, 0);
      };
    
      /**
       * returns a copy of the collection with array type.
       * @param {Collection} collection - collection eg) node.childNodes, ...
       */
      var from = function (collection) {
        var result = [], idx = -1, length = collection.length;
        while (++idx < length) {
          result[idx] = collection[idx];
        }
        return result;
      };
    
      /**
       * cluster elements by predicate function.
       *
       * @param {Array} array - array
       * @param {Function} fn - predicate function for cluster rule
       * @param {Array[]}
       */
      var clusterBy = function (array, fn) {
        if (!array.length) { return []; }
        var aTail = tail(array);
        return aTail.reduce(function (memo, v) {
          var aLast = last(memo);
          if (fn(last(aLast), v)) {
            aLast[aLast.length] = v;
          } else {
            memo[memo.length] = [v];
          }
          return memo;
        }, [[head(array)]]);
      };
    
      /**
       * returns a copy of the array with all falsy values removed
       *
       * @param {Array} array - array
       * @param {Function} fn - predicate function for cluster rule
       */
      var compact = function (array) {
        var aResult = [];
        for (var idx = 0, len = array.length; idx < len; idx ++) {
          if (array[idx]) { aResult.push(array[idx]); }
        }
        return aResult;
      };
  
      /**
       * produces a duplicate-free version of the array
       *
       * @param {Array} array
       */
      var unique = function (array) {
        var results = [];
  
        for (var idx = 0, len = array.length; idx < len; idx ++) {
          if (!contains(results, array[idx])) {
            results.push(array[idx]);
          }
        }
  
        return results;
      };
  
      /**
       * returns next item.
       * @param {Array} array
       */
      var next = function (array, item) {
        var idx = array.indexOf(item);
        if (idx === -1) { return null; }
  
        return array[idx + 1];
      };
  
      /**
       * returns prev item.
       * @param {Array} array
       */
      var prev = function (array, item) {
        var idx = array.indexOf(item);
        if (idx === -1) { return null; }
  
        return array[idx - 1];
      };
  
    
      return { head: head, last: last, initial: initial, tail: tail,
               prev: prev, next: next, find: find, contains: contains,
               all: all, sum: sum, from: from,
               clusterBy: clusterBy, compact: compact, unique: unique };
    })();
  
    return list;
  });
  