IDEMPIERE-3405 When Window Preference doesn't exists then Default Doctype Taken - also from another client / IDEMPIERE-2672
This commit is contained in:
parent
5fee4bf291
commit
822453941d
|
@ -0,0 +1,43 @@
|
||||||
|
SET SQLBLANKLINES ON
|
||||||
|
SET DEFINE OFF
|
||||||
|
|
||||||
|
-- IDEMPIERE-3405
|
||||||
|
-- Jun 24, 2017 11:48:25 PM CEST
|
||||||
|
UPDATE AD_Val_Rule SET Name='C_DocTypeTarget PO or SO',Updated=TO_DATE('2017-06-24 23:48:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=133
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Jun 24, 2017 11:48:48 PM CEST
|
||||||
|
UPDATE AD_Val_Rule SET Description='Document Type for orders',Updated=TO_DATE('2017-06-24 23:48:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=133
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Jun 24, 2017 11:49:44 PM CEST
|
||||||
|
INSERT INTO AD_Val_Rule (AD_Val_Rule_ID,Name,Description,Type,Code,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,EntityType,AD_Val_Rule_UU) VALUES (200096,'C_DocType PO or SO','Document Type for orders','S','(C_DocType.DocBaseType IN (''SOO'', ''POO'') AND C_DocType.IsSOTrx=''@IsSOTrx@'' AND COALESCE(C_DocType.DocSubTypeSO,'' '')<>''RM'' AND C_DocType.AD_Client_ID=@#AD_Client_ID@) OR C_DocType_ID=0',0,0,'Y',TO_DATE('2017-06-24 23:49:43','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2017-06-24 23:49:43','YYYY-MM-DD HH24:MI:SS'),100,'D','7f54de3d-a0cb-4649-aeff-6c8dfa5bd991')
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Jun 24, 2017 11:50:01 PM CEST
|
||||||
|
UPDATE AD_Val_Rule SET Description='Target Document Type for orders',Updated=TO_DATE('2017-06-24 23:50:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=133
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Jun 24, 2017 11:50:13 PM CEST
|
||||||
|
UPDATE AD_Val_Rule SET Name='C_DocTypeTarget AR/AP Invoices and Credit Memos', Description='Target Document Type AR/AP Invoice and Credit Memos',Updated=TO_DATE('2017-06-24 23:50:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=124
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Jun 24, 2017 11:50:29 PM CEST
|
||||||
|
INSERT INTO AD_Val_Rule (AD_Val_Rule_ID,Name,Description,Type,Code,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,EntityType,AD_Val_Rule_UU) VALUES (200097,'C_DocTypeTarget AR/AP Invoices and Credit Memos','Target Document Type AR/AP Invoice and Credit Memos','S','(C_DocType.DocBaseType IN (''ARI'', ''API'',''ARC'',''APC'') AND C_DocType.IsSOTrx=''@IsSOTrx@'' AND C_DocType.AD_Client_ID=@#AD_Client_ID@) OR C_DocType_ID=0',0,0,'Y',TO_DATE('2017-06-24 23:50:29','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2017-06-24 23:50:29','YYYY-MM-DD HH24:MI:SS'),100,'D','62aa64dd-3808-4871-954a-783b60943758')
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Jun 24, 2017 11:50:59 PM CEST
|
||||||
|
UPDATE AD_Column SET AD_Val_Rule_ID=200096,Updated=TO_DATE('2017-06-24 23:50:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=2172
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Jun 24, 2017 11:52:31 PM CEST
|
||||||
|
UPDATE AD_Val_Rule SET Name='C_DocType AR/AP Invoices and Credit Memos', Description='Document Type AR/AP Invoice and Credit Memos',Updated=TO_DATE('2017-06-24 23:52:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=200097
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Jun 24, 2017 11:52:43 PM CEST
|
||||||
|
UPDATE AD_Column SET AD_Val_Rule_ID=200097,Updated=TO_DATE('2017-06-24 23:52:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=3493
|
||||||
|
;
|
||||||
|
|
||||||
|
SELECT register_migration_script('201706242353_IDEMPIERE-3405.sql') FROM dual
|
||||||
|
;
|
||||||
|
|
|
@ -0,0 +1,40 @@
|
||||||
|
-- IDEMPIERE-3405
|
||||||
|
-- Jun 24, 2017 11:48:25 PM CEST
|
||||||
|
UPDATE AD_Val_Rule SET Name='C_DocTypeTarget PO or SO',Updated=TO_TIMESTAMP('2017-06-24 23:48:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=133
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Jun 24, 2017 11:48:48 PM CEST
|
||||||
|
UPDATE AD_Val_Rule SET Description='Document Type for orders',Updated=TO_TIMESTAMP('2017-06-24 23:48:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=133
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Jun 24, 2017 11:49:44 PM CEST
|
||||||
|
INSERT INTO AD_Val_Rule (AD_Val_Rule_ID,Name,Description,Type,Code,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,EntityType,AD_Val_Rule_UU) VALUES (200096,'C_DocType PO or SO','Document Type for orders','S','(C_DocType.DocBaseType IN (''SOO'', ''POO'') AND C_DocType.IsSOTrx=''@IsSOTrx@'' AND COALESCE(C_DocType.DocSubTypeSO,'' '')<>''RM'' AND C_DocType.AD_Client_ID=@#AD_Client_ID@) OR C_DocType_ID=0',0,0,'Y',TO_TIMESTAMP('2017-06-24 23:49:43','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2017-06-24 23:49:43','YYYY-MM-DD HH24:MI:SS'),100,'D','7f54de3d-a0cb-4649-aeff-6c8dfa5bd991')
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Jun 24, 2017 11:50:01 PM CEST
|
||||||
|
UPDATE AD_Val_Rule SET Description='Target Document Type for orders',Updated=TO_TIMESTAMP('2017-06-24 23:50:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=133
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Jun 24, 2017 11:50:13 PM CEST
|
||||||
|
UPDATE AD_Val_Rule SET Name='C_DocTypeTarget AR/AP Invoices and Credit Memos', Description='Target Document Type AR/AP Invoice and Credit Memos',Updated=TO_TIMESTAMP('2017-06-24 23:50:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=124
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Jun 24, 2017 11:50:29 PM CEST
|
||||||
|
INSERT INTO AD_Val_Rule (AD_Val_Rule_ID,Name,Description,Type,Code,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,EntityType,AD_Val_Rule_UU) VALUES (200097,'C_DocTypeTarget AR/AP Invoices and Credit Memos','Target Document Type AR/AP Invoice and Credit Memos','S','(C_DocType.DocBaseType IN (''ARI'', ''API'',''ARC'',''APC'') AND C_DocType.IsSOTrx=''@IsSOTrx@'' AND C_DocType.AD_Client_ID=@#AD_Client_ID@) OR C_DocType_ID=0',0,0,'Y',TO_TIMESTAMP('2017-06-24 23:50:29','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2017-06-24 23:50:29','YYYY-MM-DD HH24:MI:SS'),100,'D','62aa64dd-3808-4871-954a-783b60943758')
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Jun 24, 2017 11:50:59 PM CEST
|
||||||
|
UPDATE AD_Column SET AD_Val_Rule_ID=200096,Updated=TO_TIMESTAMP('2017-06-24 23:50:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=2172
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Jun 24, 2017 11:52:31 PM CEST
|
||||||
|
UPDATE AD_Val_Rule SET Name='C_DocType AR/AP Invoices and Credit Memos', Description='Document Type AR/AP Invoice and Credit Memos',Updated=TO_TIMESTAMP('2017-06-24 23:52:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=200097
|
||||||
|
;
|
||||||
|
|
||||||
|
-- Jun 24, 2017 11:52:43 PM CEST
|
||||||
|
UPDATE AD_Column SET AD_Val_Rule_ID=200097,Updated=TO_TIMESTAMP('2017-06-24 23:52:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=3493
|
||||||
|
;
|
||||||
|
|
||||||
|
SELECT register_migration_script('201706242353_IDEMPIERE-3405.sql') FROM dual
|
||||||
|
;
|
||||||
|
|
|
@ -80,11 +80,10 @@ import org.idempiere.util.ParseSeq;
|
||||||
public class GridField
|
public class GridField
|
||||||
implements Serializable, Evaluatee, Cloneable
|
implements Serializable, Evaluatee, Cloneable
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private static final long serialVersionUID = -7739433012288022819L;
|
private static final long serialVersionUID = 2703129833179761682L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Field Constructor.
|
* Field Constructor.
|
||||||
|
@ -1069,6 +1068,7 @@ public class GridField
|
||||||
*/
|
*/
|
||||||
public boolean validateValueNoDirect()
|
public boolean validateValueNoDirect()
|
||||||
{
|
{
|
||||||
|
refreshLookup();
|
||||||
// null
|
// null
|
||||||
if (m_value == null || m_value.toString().length() == 0)
|
if (m_value == null || m_value.toString().length() == 0)
|
||||||
{
|
{
|
||||||
|
@ -1118,12 +1118,13 @@ public class GridField
|
||||||
setValue(null, m_inserting);
|
setValue(null, m_inserting);
|
||||||
m_error = true;
|
m_error = true;
|
||||||
return false;
|
return false;
|
||||||
} // validateValue
|
} // validateValueNoDirect
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Validate initial Field Value. Push direct value if it doesn't exist
|
* Validate initial Field Value. Push direct value if it doesn't exist
|
||||||
* Called from GridTab.setCurrentRow when inserting
|
* Called from GridTab.setCurrentRow when inserting
|
||||||
* @return true if valid
|
* @return true if valid
|
||||||
|
* @deprecated use validateValueNoDirect instead
|
||||||
*/
|
*/
|
||||||
public boolean validateValue()
|
public boolean validateValue()
|
||||||
{
|
{
|
||||||
|
@ -1166,7 +1167,7 @@ public class GridField
|
||||||
setValue(null, m_inserting);
|
setValue(null, m_inserting);
|
||||||
m_error = true;
|
m_error = true;
|
||||||
return false;
|
return false;
|
||||||
} // validateValuePushDirect
|
} // validateValue
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* Is the Column Visible ?
|
* Is the Column Visible ?
|
||||||
|
|
|
@ -1179,11 +1179,6 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
|
||||||
return retValue;
|
return retValue;
|
||||||
setCurrentRow(m_currentRow + 1, true);
|
setCurrentRow(m_currentRow + 1, true);
|
||||||
|
|
||||||
// check validity of defaults
|
|
||||||
for (GridField field : getFields()) {
|
|
||||||
field.refreshLookup();
|
|
||||||
field.validateValueNoDirect();
|
|
||||||
}
|
|
||||||
// process all Callouts (no dependency check - assumed that settings are valid)
|
// process all Callouts (no dependency check - assumed that settings are valid)
|
||||||
for (int i = 0; i < getFieldCount(); i++)
|
for (int i = 0; i < getFieldCount(); i++)
|
||||||
processCallout(getField(i));
|
processCallout(getField(i));
|
||||||
|
@ -2567,8 +2562,6 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
|
||||||
{
|
{
|
||||||
Object value = m_mTable.getValueAt(m_currentRow, i);
|
Object value = m_mTable.getValueAt(m_currentRow, i);
|
||||||
mField.setValue(value, m_mTable.isInserting());
|
mField.setValue(value, m_mTable.isInserting());
|
||||||
if (m_mTable.isInserting()) // set invalid values to null
|
|
||||||
mField.validateValue();
|
|
||||||
if (mField.isKey())
|
if (mField.isKey())
|
||||||
keyCalloutDelayed = mField;
|
keyCalloutDelayed = mField;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2618,11 +2618,17 @@ public class GridTable extends AbstractTableModel
|
||||||
|| (hasDocTypeTargetField && field.getColumnName().equals("C_DocType_ID"))
|
|| (hasDocTypeTargetField && field.getColumnName().equals("C_DocType_ID"))
|
||||||
|| ! field.isAllowCopy())
|
|| ! field.isAllowCopy())
|
||||||
{
|
{
|
||||||
rowData[i] = field.getDefault();
|
Object value = field.getDefault();
|
||||||
field.setValue(rowData[i], m_inserting);
|
field.setValue(value, m_inserting);
|
||||||
|
field.validateValueNoDirect();
|
||||||
|
rowData[i] = field.getValue();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Object value = origData[i];
|
||||||
|
field.setValue(value, m_inserting);
|
||||||
|
field.validateValueNoDirect();
|
||||||
|
rowData[i] = field.getValue();
|
||||||
}
|
}
|
||||||
else
|
|
||||||
rowData[i] = origData[i];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else // new
|
else // new
|
||||||
|
@ -2630,8 +2636,10 @@ public class GridTable extends AbstractTableModel
|
||||||
for (int i = 0; i < size; i++)
|
for (int i = 0; i < size; i++)
|
||||||
{
|
{
|
||||||
GridField field = (GridField)m_fields.get(i);
|
GridField field = (GridField)m_fields.get(i);
|
||||||
rowData[i] = field.getDefault();
|
Object value = field.getDefault();
|
||||||
field.setValue(rowData[i], m_inserting);
|
field.setValue(value, m_inserting);
|
||||||
|
field.validateValueNoDirect();
|
||||||
|
rowData[i] = field.getValue();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue