# HG changeset patch
# User Inigo Sanchez <inigo.sanchez@openbravo.com>
# Date 1446207308 -3600
#      Fri Oct 30 13:15:08 2015 +0100
# Node ID 723416623674d7e22df7e95f5a5d1184218cecfb
# Parent  e1c26dc9a8193314108653fbb3088f98cf89a677
Fixed bug 31198:RO logic doesn't work properly in grid view with combo fields

The problem was that Read Only logic did not work properly in grid view with
combo type fields. If there were two fields on a grid, one having 'List' as
a reference and the second one been a 'TableDir' and the second one had a read
only logic based on the value of the first one, the second one did not work
properly. This happend when 'List' field was next to (leftside) of the
'TableDir' field or if there were intermediate fields between 'List' and
'TableDir' fields that were not editables (RO).

The problem has been fixed overriding a 'refreshCell()' method to use
'allowEditCellRefresh' parameter. This parameter is taking into account in
'refreshCellValue()' method of SC and if there is a visible editor in the
cell with the focus on it, redrawing and update it's value.

This fix take into account when 'refreshCell()' method is called with a value
in 'allowEditCellRefresh' parameter and in this case it will not be called
the overridden method to avoid delete some preexisting  correct fluxes.

diff -r e1c26dc9a819 -r 723416623674 modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js	Fri Oct 23 13:28:16 2015 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js	Fri Oct 30 13:15:08 2015 +0100
@@ -3720,6 +3720,14 @@
     }
   },
 
+  // Set "allowEditCellRefresh" parameter to force a completely
+  // redrawn in combo type fields when refreshing an editing cell
+  // with the the focus on it.
+  // See issue https://issues.openbravo.com/view.php?id=31198
+  refreshCell: function (rowNum, colNum, refreshingRow) {
+    return this.Super('refreshCell', [rowNum, colNum, refreshingRow, true]);
+  },
+
   // having a valueMap property results in setValueMap to be called
   // on an item. On items with a picklist this causes calls to the
   // server side
