IDEMPIERE-974 Issue with Quick Entry editor when a checkbox is added and a new record is created / peer review
This commit is contained in:
parent
210bb251c4
commit
f4c50410dc
|
@ -348,7 +348,7 @@ public class GridField
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Numeric Keys and Created/Updated as well as
|
// Numeric Keys and Created/Updated as well as
|
||||||
// DocumentNo/Value/ASI ars not mandatory (persistency layer manages them)
|
// DocumentNo/Value/ASI are not mandatory (persistence layer manages them)
|
||||||
if (m_gridTab != null && // if gridtab doesn't exist then it's not a window field (probably a process parameter field)
|
if (m_gridTab != null && // if gridtab doesn't exist then it's not a window field (probably a process parameter field)
|
||||||
( (m_vo.IsKey && m_vo.ColumnName.endsWith("_ID"))
|
( (m_vo.IsKey && m_vo.ColumnName.endsWith("_ID"))
|
||||||
|| m_vo.ColumnName.startsWith("Created") || m_vo.ColumnName.startsWith("Updated")
|
|| m_vo.ColumnName.startsWith("Created") || m_vo.ColumnName.startsWith("Updated")
|
||||||
|
|
|
@ -298,10 +298,8 @@ public class WQuickEntry extends Window implements EventListener<Event>, ValueCh
|
||||||
{
|
{
|
||||||
log.config("");
|
log.config("");
|
||||||
boolean anyChange = false;
|
boolean anyChange = false;
|
||||||
List<WEditor> specialQuickEditors = new ArrayList<WEditor>();
|
|
||||||
WEditor editor=null;
|
|
||||||
for (int idxf = 0; idxf < quickEditors.size(); idxf++) {
|
for (int idxf = 0; idxf < quickEditors.size(); idxf++) {
|
||||||
editor = quickEditors.get(idxf);
|
WEditor editor = quickEditors.get(idxf);
|
||||||
Object value = editor.getValue();
|
Object value = editor.getValue();
|
||||||
Object initialValue = initialValues.get(idxf);
|
Object initialValue = initialValues.get(idxf);
|
||||||
|
|
||||||
|
@ -327,7 +325,7 @@ public class WQuickEntry extends Window implements EventListener<Event>, ValueCh
|
||||||
int parentID = 0;
|
int parentID = 0;
|
||||||
String parentColumn = null;
|
String parentColumn = null;
|
||||||
String tabZeroName=null;
|
String tabZeroName=null;
|
||||||
boolean isParentSave=false;
|
boolean isParentSave = (getRecord_ID() > 0);
|
||||||
for (int idxt = 0; idxt < quickTabs.size(); idxt++) {
|
for (int idxt = 0; idxt < quickTabs.size(); idxt++) {
|
||||||
GridTab gridtab = quickTabs.get(idxt);
|
GridTab gridtab = quickTabs.get(idxt);
|
||||||
PO po = quickPOs.get(idxt);
|
PO po = quickPOs.get(idxt);
|
||||||
|
@ -344,20 +342,13 @@ public class WQuickEntry extends Window implements EventListener<Event>, ValueCh
|
||||||
if (field.getGridTab() != gridtab)
|
if (field.getGridTab() != gridtab)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
editor = quickEditors.get(idxf);
|
WEditor editor = quickEditors.get(idxf);
|
||||||
Object value = editor.getValue();
|
Object value = editor.getValue();
|
||||||
Object initialValue = initialValues.get(idxf);
|
Object initialValue = initialValues.get(idxf);
|
||||||
|
|
||||||
boolean changed = (value != null && initialValue == null)
|
boolean changed = (value != null && initialValue == null)
|
||||||
|| (value == null && initialValue != null)
|
|| (value == null && initialValue != null)
|
||||||
|| (value != null && initialValue != null && !value.equals(initialValue));
|
|| (value != null && initialValue != null && !value.equals(initialValue));
|
||||||
if(field.getColumnName().equals("Value")
|
|
||||||
||field.getColumnName().equals("DocumentNo")
|
|
||||||
||field.getColumnName().equals("M_AttributeSetInstance_ID")){
|
|
||||||
if(!specialQuickEditors.contains(field)){
|
|
||||||
specialQuickEditors.add(editor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
boolean thisMandatoryError = false;
|
boolean thisMandatoryError = false;
|
||||||
if (field.isMandatory(true)) {
|
if (field.isMandatory(true)) {
|
||||||
if (value == null || value.toString().length() == 0) {
|
if (value == null || value.toString().length() == 0) {
|
||||||
|
@ -387,14 +378,19 @@ public class WQuickEntry extends Window implements EventListener<Event>, ValueCh
|
||||||
}
|
}
|
||||||
if(gridtab.getTabLevel()>0 && !isParentSave){
|
if(gridtab.getTabLevel()>0 && !isParentSave){
|
||||||
FDialog.error(m_WindowNo, this, "FillMinimumInfo",tabZeroName);
|
FDialog.error(m_WindowNo, this, "FillMinimumInfo",tabZeroName);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
po.saveEx();
|
po.saveEx();
|
||||||
if(gridtab.getTabLevel()==0){
|
if(gridtab.getTabLevel()==0){
|
||||||
isParentSave=true;
|
isParentSave=true;
|
||||||
}
|
}
|
||||||
for(WEditor we:specialQuickEditors){
|
for (int idxf = 0; idxf < quickFields.size(); idxf++) {
|
||||||
if(po.get_Value(we.getColumnName())!=null){
|
GridField field = quickFields.get(idxf);
|
||||||
|
if (field.getGridTab() != gridtab)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
WEditor we = quickEditors.get(idxf);
|
||||||
|
if (po.get_Value(we.getColumnName()) != null) {
|
||||||
we.setValue(po.get_Value(we.getColumnName()));
|
we.setValue(po.get_Value(we.getColumnName()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue