Related to issue 18354
authorDavid Baz Fayos <david.baz@openbravo.com>
Tue, 06 Sep 2011 19:41:27 +0200
changeset 13666 5e9abd930a15
parent 13665 f70eb0ef28f6
child 13674 53760e719fc5
Related to issue 18354
modules/org.openbravo.client.application/src/org/openbravo/client/application/window/OBViewGridComponent.java
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/OBViewGridComponent.java	Tue Sep 06 17:39:44 2011 +0200
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/OBViewGridComponent.java	Tue Sep 06 19:41:27 2011 +0200
@@ -398,7 +398,14 @@
       if (property.isBoolean()) {
         return false;
       }
-      return property.isMandatory();
+
+      if (field.getColumn() != null) {
+        // Taking value from AD definition, mandatoriness of a column can be different in AD and in
+        // memory model, because memory model sets mandatoriness regarding physical DB definition.
+        return field.getColumn().isMandatory();
+      } else {
+        return property.isMandatory();
+      }
     }
 
     public boolean isReadOnly() {