[RM]Only set return reason and condition goods if previous value is empty.
authorGorka Ion Damián <gorkaion.damian@openbravo.com>
Wed, 23 Nov 2011 16:42:43 +0100
changeset 14703 410e986539d4
parent 14702 eabc6e2b71c0
child 14708 aa9f3fe74669
child 14709 6e9d73319ece
[RM]Only set return reason and condition goods if previous value is empty.
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/return-material/ob-return-material.js
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/return-material/ob-return-material.js	Wed Nov 23 16:31:38 2011 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/return-material/ob-return-material.js	Wed Nov 23 16:42:43 2011 +0100
@@ -41,7 +41,9 @@
   var contextInfo = null;
   if (state) {
     contextInfo = grid.view.parentWindow.activeView.getContextInfo(false, true, true, true);
-    record.returnReason = contextInfo.inpcReturnReasonId;
+    if (!record.returnReason) {
+      record.returnReason = contextInfo.inpcReturnReasonId;
+    }
   }
 };
 /**
@@ -65,7 +67,9 @@
     record.receiving = record.pending;
     contextInfo = grid.view.parentWindow.activeView.getContextInfo(false, true, true, true);
     record.storageBin = contextInfo.ReturnLocator;
-    record.conditionGoods = contextInfo.inpmConditionGoodsId;
+    if (!record.conditionGoods) {
+      record.conditionGoods = contextInfo.inpmConditionGoodsId;
+    }
   }
 };