IDEMPIERE-67 ProcessedOn should not be copied by MOrder.copyFrom

This commit is contained in:
Carlos Ruiz 2011-09-18 15:55:50 -05:00
parent 628b436cdf
commit 85bbd9d621
18 changed files with 661 additions and 138 deletions

View File

@ -1,10 +1,4 @@
CREATE OR REPLACE VIEW AD_FIELD_V CREATE OR REPLACE VIEW AD_FIELD_V AS
(AD_WINDOW_ID, AD_TAB_ID, AD_FIELD_ID, AD_TABLE_ID, AD_COLUMN_ID, NAME, DESCRIPTION, HELP, ISDISPLAYED,
DISPLAYLOGIC, DISPLAYLENGTH, SEQNO, SORTNO, ISSAMELINE, ISHEADING, ISFIELDONLY, ISREADONLY, ISENCRYPTEDFIELD,
OBSCURETYPE, COLUMNNAME, COLUMNSQL, FIELDLENGTH, VFORMAT, DEFAULTVALUE, ISKEY, ISPARENT, ISMANDATORY, ISIDENTIFIER,
ISTRANSLATED, AD_REFERENCE_VALUE_ID, CALLOUT, AD_REFERENCE_ID, AD_VAL_RULE_ID, AD_PROCESS_ID, ISALWAYSUPDATEABLE,
READONLYLOGIC, MANDATORYLOGIC, ISUPDATEABLE, ISENCRYPTEDCOLUMN, ISSELECTIONCOLUMN, TABLENAME, VALUEMIN, VALUEMAX,
FIELDGROUP, VALIDATIONCODE, INCLUDED_TAB_ID, FIELDGROUPTYPE, ISCOLLAPSEDBYDEFAULT, INFOFACTORYCLASS, ISAUTOCOMPLETE) AS
SELECT t.AD_Window_ID, f.AD_Tab_ID, f.AD_Field_ID, tbl.AD_Table_ID, f.AD_Column_ID, SELECT t.AD_Window_ID, f.AD_Tab_ID, f.AD_Field_ID, tbl.AD_Table_ID, f.AD_Column_ID,
f.NAME, f.Description, f.Help, f.IsDisplayed, f.DisplayLogic, f.DisplayLength, f.NAME, f.Description, f.Help, f.IsDisplayed, f.DisplayLogic, f.DisplayLength,
f.SeqNo, f.SortNo, f.IsSameLine, f.IsHeading, f.IsFieldOnly, f.IsReadOnly, f.SeqNo, f.SortNo, f.IsSameLine, f.IsHeading, f.IsFieldOnly, f.IsReadOnly,
@ -22,7 +16,7 @@
fg.NAME AS FieldGroup, vr.Code AS ValidationCode, fg.NAME AS FieldGroup, vr.Code AS ValidationCode,
f.Included_Tab_ID, fg.FieldGroupType, fg.IsCollapsedByDefault, f.Included_Tab_ID, fg.FieldGroupType, fg.IsCollapsedByDefault,
COALESCE(f.InfoFactoryClass, c.InfoFactoryClass) as InfoFactoryClass, COALESCE(f.InfoFactoryClass, c.InfoFactoryClass) as InfoFactoryClass,
c.IsAutocomplete c.IsAutocomplete, COALESCE(f.IsAllowCopy, c.IsAllowCopy) AS IsAllowCopy
FROM AD_FIELD f FROM AD_FIELD f
INNER JOIN AD_TAB t ON (f.AD_Tab_ID = t.AD_Tab_ID) INNER JOIN AD_TAB t ON (f.AD_Tab_ID = t.AD_Tab_ID)
LEFT OUTER JOIN AD_FIELDGROUP fg ON (f.AD_FieldGroup_ID = fg.AD_FieldGroup_ID) LEFT OUTER JOIN AD_FIELDGROUP fg ON (f.AD_FieldGroup_ID = fg.AD_FieldGroup_ID)
@ -31,4 +25,4 @@ FROM AD_FIELD f
INNER JOIN AD_REFERENCE r ON (c.AD_Reference_ID = r.AD_Reference_ID) INNER JOIN AD_REFERENCE r ON (c.AD_Reference_ID = r.AD_Reference_ID)
LEFT OUTER JOIN AD_VAL_RULE vr ON (vr.AD_Val_Rule_ID = COALESCE(f.AD_Val_Rule_ID, c.AD_Val_Rule_ID)) LEFT OUTER JOIN AD_VAL_RULE vr ON (vr.AD_Val_Rule_ID = COALESCE(f.AD_Val_Rule_ID, c.AD_Val_Rule_ID))
WHERE f.IsActive = 'Y' WHERE f.IsActive = 'Y'
AND c.IsActive = 'Y'; AND c.IsActive = 'Y';

View File

@ -1,10 +1,4 @@
CREATE OR REPLACE VIEW AD_FIELD_VT (AD_LANGUAGE, AD_WINDOW_ID, AD_TAB_ID, AD_FIELD_ID, AD_TABLE_ID, CREATE OR REPLACE VIEW AD_FIELD_VT AS
AD_COLUMN_ID, NAME, DESCRIPTION, HELP, ISDISPLAYED, DISPLAYLOGIC, DISPLAYLENGTH, SEQNO, SORTNO, ISSAMELINE,
ISHEADING, ISFIELDONLY, ISREADONLY, ISENCRYPTEDFIELD, OBSCURETYPE, COLUMNNAME, COLUMNSQL, FIELDLENGTH, VFORMAT,
DEFAULTVALUE, ISKEY, ISPARENT, ISMANDATORY, ISIDENTIFIER, ISTRANSLATED, AD_REFERENCE_VALUE_ID, CALLOUT,
AD_REFERENCE_ID, AD_VAL_RULE_ID, AD_PROCESS_ID, ISALWAYSUPDATEABLE, READONLYLOGIC, MANDATORYLOGIC, ISUPDATEABLE,
ISENCRYPTEDCOLUMN, ISSELECTIONCOLUMN, TABLENAME, VALUEMIN, VALUEMAX, FIELDGROUP, VALIDATIONCODE, INCLUDED_TAB_ID,
FIELDGROUPTYPE, ISCOLLAPSEDBYDEFAULT, INFOFACTORYCLASS, ISAUTOCOMPLETE) AS
SELECT trl.AD_LANGUAGE, t.AD_Window_ID, f.AD_Tab_ID, f.AD_Field_ID, tbl.AD_Table_ID, f.AD_Column_ID, SELECT trl.AD_LANGUAGE, t.AD_Window_ID, f.AD_Tab_ID, f.AD_Field_ID, tbl.AD_Table_ID, f.AD_Column_ID,
trl.NAME, trl.Description, trl.Help, f.IsDisplayed, f.DisplayLogic, f.DisplayLength, trl.NAME, trl.Description, trl.Help, f.IsDisplayed, f.DisplayLogic, f.DisplayLength,
f.SeqNo, f.SortNo, f.IsSameLine, f.IsHeading, f.IsFieldOnly, f.IsReadOnly, f.SeqNo, f.SortNo, f.IsSameLine, f.IsHeading, f.IsFieldOnly, f.IsReadOnly,
@ -21,7 +15,7 @@
fgt.NAME AS FieldGroup, vr.Code AS ValidationCode, fgt.NAME AS FieldGroup, vr.Code AS ValidationCode,
f.Included_Tab_ID, fg.FieldGroupType, fg.IsCollapsedByDefault, f.Included_Tab_ID, fg.FieldGroupType, fg.IsCollapsedByDefault,
COALESCE(f.InfoFactoryClass, c.InfoFactoryClass) as InfoFactoryClass, COALESCE(f.InfoFactoryClass, c.InfoFactoryClass) as InfoFactoryClass,
c.IsAutocomplete c.IsAutocomplete, COALESCE(f.IsAllowCopy, c.IsAllowCopy) AS IsAllowCopy
FROM AD_FIELD f FROM AD_FIELD f
INNER JOIN AD_FIELD_TRL trl ON (f.AD_Field_ID = trl.AD_Field_ID) INNER JOIN AD_FIELD_TRL trl ON (f.AD_Field_ID = trl.AD_Field_ID)
INNER JOIN AD_TAB t ON (f.AD_Tab_ID = t.AD_Tab_ID) INNER JOIN AD_TAB t ON (f.AD_Tab_ID = t.AD_Tab_ID)
@ -33,4 +27,4 @@
INNER JOIN AD_REFERENCE r ON (c.AD_Reference_ID = r.AD_Reference_ID) INNER JOIN AD_REFERENCE r ON (c.AD_Reference_ID = r.AD_Reference_ID)
LEFT OUTER JOIN AD_VAL_RULE vr ON (vr.AD_Val_Rule_ID=COALESCE(f.AD_Val_Rule_ID, c.AD_Val_Rule_ID)) LEFT OUTER JOIN AD_VAL_RULE vr ON (vr.AD_Val_Rule_ID=COALESCE(f.AD_Val_Rule_ID, c.AD_Val_Rule_ID))
WHERE f.IsActive = 'Y' WHERE f.IsActive = 'Y'
AND c.IsActive = 'Y'; AND c.IsActive = 'Y';

View File

@ -11,7 +11,8 @@ CREATE OR REPLACE VIEW ad_field_v AS
c.isalwaysupdateable, c.readonlylogic, c.mandatorylogic, c.isupdateable, c.isalwaysupdateable, c.readonlylogic, c.mandatorylogic, c.isupdateable,
c.isencrypted AS isencryptedcolumn, c.isselectioncolumn, tbl.tablename, c.valuemin, c.valuemax, c.isencrypted AS isencryptedcolumn, c.isselectioncolumn, tbl.tablename, c.valuemin, c.valuemax,
fg.name AS fieldgroup, vr.code AS validationcode, f.included_tab_id, fg.fieldgrouptype, fg.iscollapsedbydefault, fg.name AS fieldgroup, vr.code AS validationcode, f.included_tab_id, fg.fieldgrouptype, fg.iscollapsedbydefault,
COALESCE(f.infofactoryclass, c.infofactoryclass) AS infofactoryclass, c.isautocomplete COALESCE(f.infofactoryclass, c.infofactoryclass) AS infofactoryclass, c.isautocomplete,
COALESCE(f.IsAllowCopy, c.IsAllowCopy) AS IsAllowCopy
FROM ad_field f FROM ad_field f
JOIN ad_tab t ON f.ad_tab_id = t.ad_tab_id JOIN ad_tab t ON f.ad_tab_id = t.ad_tab_id
LEFT JOIN ad_fieldgroup fg ON f.ad_fieldgroup_id = fg.ad_fieldgroup_id LEFT JOIN ad_fieldgroup fg ON f.ad_fieldgroup_id = fg.ad_fieldgroup_id
@ -19,4 +20,4 @@ CREATE OR REPLACE VIEW ad_field_v AS
JOIN ad_table tbl ON c.ad_table_id = tbl.ad_table_id JOIN ad_table tbl ON c.ad_table_id = tbl.ad_table_id
JOIN ad_reference r ON c.ad_reference_id = r.ad_reference_id JOIN ad_reference r ON c.ad_reference_id = r.ad_reference_id
LEFT JOIN ad_val_rule vr ON vr.ad_val_rule_id = COALESCE(f.ad_val_rule_id, c.ad_val_rule_id) LEFT JOIN ad_val_rule vr ON vr.ad_val_rule_id = COALESCE(f.ad_val_rule_id, c.ad_val_rule_id)
WHERE f.isactive = 'Y'::bpchar AND c.isactive = 'Y'::bpchar; WHERE f.isactive = 'Y'::bpchar AND c.isactive = 'Y'::bpchar;

View File

@ -6,7 +6,8 @@ CREATE OR REPLACE VIEW ad_field_vt AS
COALESCE(f.ad_reference_value_id, c.ad_reference_value_id) AS ad_reference_value_id, c.callout, COALESCE(f.ad_reference_id, c.ad_reference_id) AS ad_reference_id, COALESCE(f.ad_reference_value_id, c.ad_reference_value_id) AS ad_reference_value_id, c.callout, COALESCE(f.ad_reference_id, c.ad_reference_id) AS ad_reference_id,
COALESCE(f.ad_val_rule_id, c.ad_val_rule_id) AS ad_val_rule_id, c.ad_process_id, c.isalwaysupdateable, c.readonlylogic, c.mandatorylogic, c.isupdateable, COALESCE(f.ad_val_rule_id, c.ad_val_rule_id) AS ad_val_rule_id, c.ad_process_id, c.isalwaysupdateable, c.readonlylogic, c.mandatorylogic, c.isupdateable,
c.isencrypted AS isencryptedcolumn, c.isselectioncolumn, tbl.tablename, c.valuemin, c.valuemax, fgt.name AS fieldgroup, vr.code AS validationcode, c.isencrypted AS isencryptedcolumn, c.isselectioncolumn, tbl.tablename, c.valuemin, c.valuemax, fgt.name AS fieldgroup, vr.code AS validationcode,
f.included_tab_id, fg.fieldgrouptype, fg.iscollapsedbydefault, COALESCE(f.infofactoryclass, c.infofactoryclass) AS infofactoryclass, c.isautocomplete f.included_tab_id, fg.fieldgrouptype, fg.iscollapsedbydefault, COALESCE(f.infofactoryclass, c.infofactoryclass) AS infofactoryclass, c.isautocomplete,
COALESCE(f.IsAllowCopy, c.IsAllowCopy) AS IsAllowCopy
FROM ad_field f FROM ad_field f
JOIN ad_field_trl trl ON f.ad_field_id = trl.ad_field_id JOIN ad_field_trl trl ON f.ad_field_id = trl.ad_field_id
JOIN ad_tab t ON f.ad_tab_id = t.ad_tab_id JOIN ad_tab t ON f.ad_tab_id = t.ad_tab_id
@ -16,4 +17,4 @@ CREATE OR REPLACE VIEW ad_field_vt AS
JOIN ad_table tbl ON c.ad_table_id = tbl.ad_table_id JOIN ad_table tbl ON c.ad_table_id = tbl.ad_table_id
JOIN ad_reference r ON c.ad_reference_id = r.ad_reference_id JOIN ad_reference r ON c.ad_reference_id = r.ad_reference_id
LEFT JOIN ad_val_rule vr ON vr.ad_val_rule_id = COALESCE(f.ad_val_rule_id, c.ad_val_rule_id) LEFT JOIN ad_val_rule vr ON vr.ad_val_rule_id = COALESCE(f.ad_val_rule_id, c.ad_val_rule_id)
WHERE f.isactive = 'Y'::bpchar AND c.isactive = 'Y'::bpchar; WHERE f.isactive = 'Y'::bpchar AND c.isactive = 'Y'::bpchar;

View File

@ -0,0 +1,205 @@
-- Sep 9, 2011 10:58:03 AM COT
-- IDEMPIERE-67 ProcessedOn should not be copied by MOrder.copyFrom
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,55297,0,'IsAllowCopy',TO_DATE('2011-09-09 10:58:02','YYYY-MM-DD HH24:MI:SS'),100,'Determine if a column must be copied when pushing the button to copy record','D','Y','Allow Copy','Allow Copy',TO_DATE('2011-09-09 10:58:02','YYYY-MM-DD HH24:MI:SS'),100)
;
-- Sep 9, 2011 10:58:04 AM COT
-- IDEMPIERE-67 ProcessedOn should not be copied by MOrder.copyFrom
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=55297 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID)
;
-- Sep 9, 2011 10:58:35 AM COT
-- IDEMPIERE-67 ProcessedOn should not be copied by MOrder.copyFrom
UPDATE AD_Element_Trl SET IsTranslated='Y',Name='Permitir copia',PrintName='Permitir copia',Description='Determina si una columna debe ser copiada cuando se selecciona copiar registro',Updated=TO_DATE('2011-09-09 10:58:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=55297 AND AD_Language LIKE 'es_%'
;
-- Sep 9, 2011 10:59:43 AM COT
-- IDEMPIERE-67 ProcessedOn should not be copied by MOrder.copyFrom
INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,DefaultValue,Description,EntityType,FieldLength,IsActive,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,62199,55297,0,20,101,'IsAllowCopy',TO_DATE('2011-09-09 10:59:42','YYYY-MM-DD HH24:MI:SS'),100,'Y','Determine if a column must be copied when pushing the button to copy record','D',1,'Y','Y','N','N','N','N','N','Y','N','N','N','N','Y','Allow Copy',0,TO_DATE('2011-09-09 10:59:42','YYYY-MM-DD HH24:MI:SS'),100,0)
;
-- Sep 9, 2011 10:59:43 AM COT
-- IDEMPIERE-67 ProcessedOn should not be copied by MOrder.copyFrom
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=62199 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- Sep 9, 2011 11:00:47 AM COT
-- IDEMPIERE-67 ProcessedOn should not be copied by MOrder.copyFrom
UPDATE AD_Field SET IsSameLine='N', SeqNo=390,Updated=TO_DATE('2011-09-09 11:00:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=5122
;
-- Sep 9, 2011 11:01:22 AM COT
-- IDEMPIERE-67 ProcessedOn should not be copied by MOrder.copyFrom
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,SortNo,Updated,UpdatedBy) VALUES (0,62199,62467,0,101,TO_DATE('2011-09-09 11:01:22','YYYY-MM-DD HH24:MI:SS'),100,'Determine if a column must be copied when pushing the button to copy record',10,'D','Y','Y','Y','N','N','N','N','Y','Allow Copy',380,0,TO_DATE('2011-09-09 11:01:22','YYYY-MM-DD HH24:MI:SS'),100)
;
-- Sep 9, 2011 11:01:22 AM COT
-- IDEMPIERE-67 ProcessedOn should not be copied by MOrder.copyFrom
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=62467 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- Sep 9, 2011 11:01:35 AM COT
-- IDEMPIERE-67 ProcessedOn should not be copied by MOrder.copyFrom
UPDATE AD_Field SET DisplayLength=10,Updated=TO_DATE('2011-09-09 11:01:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56317
;
-- Sep 9, 2011 11:19:47 AM COT
-- IDEMPIERE-67 ProcessedOn should not be copied by MOrder.copyFrom
ALTER TABLE AD_Column ADD IsAllowCopy CHAR(1) DEFAULT 'Y' CHECK (IsAllowCopy IN ('Y','N')) NOT NULL
;
-- Sep 11, 2011 11:49:44 AM COT
-- IDEMPIERE-67 ProcessedOn should not be copied by MOrder.copyFrom
INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,62200,55297,0,17,319,107,'IsAllowCopy',TO_DATE('2011-09-11 11:49:42','YYYY-MM-DD HH24:MI:SS'),100,'Determine if a column must be copied when pushing the button to copy record','D',1,'Y','Y','N','N','N','N','N','N','N','N','N','N','Y','Allow Copy',0,TO_DATE('2011-09-11 11:49:42','YYYY-MM-DD HH24:MI:SS'),100,0)
;
-- Sep 11, 2011 11:49:44 AM COT
-- IDEMPIERE-67 ProcessedOn should not be copied by MOrder.copyFrom
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=62200 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- Sep 11, 2011 11:52:39 AM COT
-- IDEMPIERE-67 ProcessedOn should not be copied by MOrder.copyFrom
ALTER TABLE AD_Field ADD IsAllowCopy CHAR(1) DEFAULT NULL
;
-- Sep 11, 2011 11:51:12 AM COT
-- IDEMPIERE-67 ProcessedOn should not be copied by MOrder.copyFrom
UPDATE AD_Field SET SeqNo=290,Updated=TO_DATE('2011-09-11 11:51:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=53280
;
-- Sep 11, 2011 11:51:25 AM COT
-- IDEMPIERE-67 ProcessedOn should not be copied by MOrder.copyFrom
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,SortNo,Updated,UpdatedBy) VALUES (0,62200,62468,0,107,TO_DATE('2011-09-11 11:51:24','YYYY-MM-DD HH24:MI:SS'),100,'Determine if a column must be copied when pushing the button to copy record',0,'D','Y','Y','Y','N','N','N','N','Y','Allow Copy',280,0,TO_DATE('2011-09-11 11:51:24','YYYY-MM-DD HH24:MI:SS'),100)
;
-- Sep 11, 2011 11:56:01 AM COT
-- IDEMPIERE-67 ProcessedOn should not be copied by MOrder.copyFrom
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=62468 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- Backward compatibility with old PO copyValues method
UPDATE AD_Column SET IsAllowCopy='N' WHERE ColumnName IN (
'Created',
'Created',
'CreatedBy',
'Updated',
'UpdatedBy',
'IsActive',
'AD_Client_ID',
'AD_Org_ID',
'Processing'
);
-- additional from GridTable (on AD_Field for better backward compatibility)
UPDATE AD_Field SET IsAllowCopy='N' WHERE AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE ColumnName IN (
'EntityType',
'DocumentNo',
'Processed',
'IsSelfService',
'DocAction',
'DocStatus',
'Posted',
'IsReconciled',
'IsApproved',
'IsGenerated',
'GrandTotal',
'TotalLines',
'C_CashLine_ID',
'C_Payment_ID',
'IsPaid',
'IsAllocated',
'Line'
));
-- Ref_ from GridTable
UPDATE AD_Field SET IsAllowCopy='N' WHERE AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE ColumnName LIKE 'Ref_%');
-- C_DocType_ID if there is DocTypeTarget from GridTable
UPDATE AD_Field SET IsAllowCopy='N' WHERE AD_Column_ID IN
(SELECT AD_Column_ID FROM AD_Column cdt
WHERE cdt.ColumnName = 'C_DocType_ID' AND EXISTS
(SELECT 1 FROM AD_Column cdtt
WHERE cdtt.AD_Table_ID=cdt.AD_Table_ID AND cdtt.ColumnName='C_DocTypeTarget_ID'));
-- new columns found to be problematic
UPDATE AD_Column SET IsAllowCopy='N' WHERE ColumnName IN (
'ProcessedOn'
);
-- new fields found to be problematic
UPDATE AD_Field SET IsAllowCopy='N' WHERE AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE ColumnName IN (
'QtyDelivered',
'QtyInvoiced',
'QtyReserved'
));
-- key columns
UPDATE AD_Column SET IsAllowCopy='N' WHERE IsKey='Y';
-- virtual columns
UPDATE AD_Column SET IsAllowCopy='N' WHERE ColumnSQL IS NOT NULL;
-- UUID columns
UPDATE AD_Column SET IsAllowCopy='N' WHERE columnname = (SELECT tablename||'_UU' FROM ad_table t where t.ad_table_id=ad_column.ad_table_id);
CREATE OR REPLACE VIEW AD_FIELD_V AS
SELECT t.AD_Window_ID, f.AD_Tab_ID, f.AD_Field_ID, tbl.AD_Table_ID, f.AD_Column_ID,
f.NAME, f.Description, f.Help, f.IsDisplayed, f.DisplayLogic, f.DisplayLength,
f.SeqNo, f.SortNo, f.IsSameLine, f.IsHeading, f.IsFieldOnly, f.IsReadOnly,
f.IsEncrypted AS IsEncryptedField, f.ObscureType,
c.ColumnName, c.ColumnSQL, c.FieldLength, c.VFormat,
COALESCE(f.DefaultValue, c.DefaultValue) AS DefaultValue,
c.IsKey, c.IsParent,
COALESCE(f.IsMandatory, c.IsMandatory) AS IsMandatory,
c.IsIdentifier, c.IsTranslated, COALESCE(f.AD_Reference_Value_ID, c.AD_Reference_Value_ID) AS AD_Reference_Value_ID,
c.Callout, COALESCE(f.AD_Reference_ID, c.AD_Reference_ID) AS AD_Reference_ID,
COALESCE(f.AD_Val_Rule_ID, c.AD_Val_Rule_ID) AS AD_Val_Rule_ID, c.AD_Process_ID, c.IsAlwaysUpdateable,
c.ReadOnlyLogic, c.MandatoryLogic, c.IsUpdateable, c.IsEncrypted AS IsEncryptedColumn,
c.IsSelectionColumn,
tbl.TableName, c.ValueMin, c.ValueMax,
fg.NAME AS FieldGroup, vr.Code AS ValidationCode,
f.Included_Tab_ID, fg.FieldGroupType, fg.IsCollapsedByDefault,
COALESCE(f.InfoFactoryClass, c.InfoFactoryClass) as InfoFactoryClass,
c.IsAutocomplete, COALESCE(f.IsAllowCopy, c.IsAllowCopy) AS IsAllowCopy
FROM AD_FIELD f
INNER JOIN AD_TAB t ON (f.AD_Tab_ID = t.AD_Tab_ID)
LEFT OUTER JOIN AD_FIELDGROUP fg ON (f.AD_FieldGroup_ID = fg.AD_FieldGroup_ID)
LEFT OUTER JOIN AD_COLUMN c ON (f.AD_Column_ID = c.AD_Column_ID)
INNER JOIN AD_TABLE tbl ON (c.AD_Table_ID = tbl.AD_Table_ID)
INNER JOIN AD_REFERENCE r ON (c.AD_Reference_ID = r.AD_Reference_ID)
LEFT OUTER JOIN AD_VAL_RULE vr ON (vr.AD_Val_Rule_ID = COALESCE(f.AD_Val_Rule_ID, c.AD_Val_Rule_ID))
WHERE f.IsActive = 'Y'
AND c.IsActive = 'Y';
CREATE OR REPLACE VIEW AD_FIELD_VT AS
SELECT trl.AD_LANGUAGE, t.AD_Window_ID, f.AD_Tab_ID, f.AD_Field_ID, tbl.AD_Table_ID, f.AD_Column_ID,
trl.NAME, trl.Description, trl.Help, f.IsDisplayed, f.DisplayLogic, f.DisplayLength,
f.SeqNo, f.SortNo, f.IsSameLine, f.IsHeading, f.IsFieldOnly, f.IsReadOnly,
f.IsEncrypted AS IsEncryptedField, f.ObscureType,
c.ColumnName, c.ColumnSQL, c.FieldLength, c.VFormat,
COALESCE(f.DefaultValue, c.DefaultValue) AS DefaultValue,
c.IsKey, c.IsParent,
COALESCE(f.IsMandatory, c.IsMandatory) AS IsMandatory,
c.IsIdentifier, c.IsTranslated, COALESCE(f.AD_Reference_Value_ID, c.AD_Reference_Value_ID) AS AD_Reference_Value_ID,
c.Callout, COALESCE(f.AD_Reference_ID, c.AD_Reference_ID) AS AD_Reference_ID,
COALESCE(f.AD_Val_Rule_ID, c.AD_Val_Rule_ID) as AD_Val_Rule_ID, c.AD_Process_ID, c.IsAlwaysUpdateable,
c.ReadOnlyLogic, c.MandatoryLogic, c.IsUpdateable, c.IsEncrypted AS IsEncryptedColumn, c.IsSelectionColumn,
tbl.TableName, c.ValueMin, c.ValueMax,
fgt.NAME AS FieldGroup, vr.Code AS ValidationCode,
f.Included_Tab_ID, fg.FieldGroupType, fg.IsCollapsedByDefault,
COALESCE(f.InfoFactoryClass, c.InfoFactoryClass) as InfoFactoryClass,
c.IsAutocomplete, COALESCE(f.IsAllowCopy, c.IsAllowCopy) AS IsAllowCopy
FROM AD_FIELD f
INNER JOIN AD_FIELD_TRL trl ON (f.AD_Field_ID = trl.AD_Field_ID)
INNER JOIN AD_TAB t ON (f.AD_Tab_ID = t.AD_Tab_ID)
LEFT OUTER JOIN AD_FIELDGROUP fg ON (f.AD_FieldGroup_ID = fg.AD_FieldGroup_ID)
LEFT OUTER JOIN AD_FIELDGROUP_TRL fgt ON
(f.AD_FieldGroup_ID = fgt.AD_FieldGroup_ID AND trl.AD_LANGUAGE=fgt.AD_LANGUAGE)
LEFT OUTER JOIN AD_COLUMN c ON (f.AD_Column_ID = c.AD_Column_ID)
INNER JOIN AD_TABLE tbl ON (c.AD_Table_ID = tbl.AD_Table_ID)
INNER JOIN AD_REFERENCE r ON (c.AD_Reference_ID = r.AD_Reference_ID)
LEFT OUTER JOIN AD_VAL_RULE vr ON (vr.AD_Val_Rule_ID=COALESCE(f.AD_Val_Rule_ID, c.AD_Val_Rule_ID))
WHERE f.IsActive = 'Y'
AND c.IsActive = 'Y';

View File

@ -0,0 +1,194 @@
-- Sep 9, 2011 10:58:03 AM COT
-- IDEMPIERE-67 ProcessedOn should not be copied by MOrder.copyFrom
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,55297,0,'IsAllowCopy',TO_TIMESTAMP('2011-09-09 10:58:02','YYYY-MM-DD HH24:MI:SS'),100,'Determine if a column must be copied when pushing the button to copy record','D','Y','Allow Copy','Allow Copy',TO_TIMESTAMP('2011-09-09 10:58:02','YYYY-MM-DD HH24:MI:SS'),100)
;
-- Sep 9, 2011 10:58:04 AM COT
-- IDEMPIERE-67 ProcessedOn should not be copied by MOrder.copyFrom
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=55297 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID)
;
-- Sep 9, 2011 10:58:35 AM COT
-- IDEMPIERE-67 ProcessedOn should not be copied by MOrder.copyFrom
UPDATE AD_Element_Trl SET IsTranslated='Y',Name='Permitir copia',PrintName='Permitir copia',Description='Determina si una columna debe ser copiada cuando se selecciona copiar registro',Updated=TO_TIMESTAMP('2011-09-09 10:58:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=55297 AND AD_Language LIKE 'es_%'
;
-- Sep 9, 2011 10:59:43 AM COT
-- IDEMPIERE-67 ProcessedOn should not be copied by MOrder.copyFrom
INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,DefaultValue,Description,EntityType,FieldLength,IsActive,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,62199,55297,0,20,101,'IsAllowCopy',TO_TIMESTAMP('2011-09-09 10:59:42','YYYY-MM-DD HH24:MI:SS'),100,'Y','Determine if a column must be copied when pushing the button to copy record','D',1,'Y','Y','N','N','N','N','N','Y','N','N','N','N','Y','Allow Copy',0,TO_TIMESTAMP('2011-09-09 10:59:42','YYYY-MM-DD HH24:MI:SS'),100,0)
;
-- Sep 9, 2011 10:59:43 AM COT
-- IDEMPIERE-67 ProcessedOn should not be copied by MOrder.copyFrom
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=62199 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- Sep 9, 2011 11:00:47 AM COT
-- IDEMPIERE-67 ProcessedOn should not be copied by MOrder.copyFrom
UPDATE AD_Field SET IsSameLine='N', SeqNo=390,Updated=TO_TIMESTAMP('2011-09-09 11:00:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=5122
;
-- Sep 9, 2011 11:01:22 AM COT
-- IDEMPIERE-67 ProcessedOn should not be copied by MOrder.copyFrom
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,SortNo,Updated,UpdatedBy) VALUES (0,62199,62467,0,101,TO_TIMESTAMP('2011-09-09 11:01:22','YYYY-MM-DD HH24:MI:SS'),100,'Determine if a column must be copied when pushing the button to copy record',10,'D','Y','Y','Y','N','N','N','N','Y','Allow Copy',380,0,TO_TIMESTAMP('2011-09-09 11:01:22','YYYY-MM-DD HH24:MI:SS'),100)
;
-- Sep 9, 2011 11:01:22 AM COT
-- IDEMPIERE-67 ProcessedOn should not be copied by MOrder.copyFrom
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=62467 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- Sep 9, 2011 11:01:35 AM COT
-- IDEMPIERE-67 ProcessedOn should not be copied by MOrder.copyFrom
UPDATE AD_Field SET DisplayLength=10,Updated=TO_TIMESTAMP('2011-09-09 11:01:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56317
;
-- Sep 9, 2011 11:19:47 AM COT
-- IDEMPIERE-67 ProcessedOn should not be copied by MOrder.copyFrom
ALTER TABLE AD_Column ADD COLUMN IsAllowCopy CHAR(1) DEFAULT 'Y' CHECK (IsAllowCopy IN ('Y','N')) NOT NULL
;
-- Sep 11, 2011 11:49:44 AM COT
-- IDEMPIERE-67 ProcessedOn should not be copied by MOrder.copyFrom
INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,62200,55297,0,17,319,107,'IsAllowCopy',TO_TIMESTAMP('2011-09-11 11:49:42','YYYY-MM-DD HH24:MI:SS'),100,'Determine if a column must be copied when pushing the button to copy record','D',1,'Y','Y','N','N','N','N','N','N','N','N','N','N','Y','Allow Copy',0,TO_TIMESTAMP('2011-09-11 11:49:42','YYYY-MM-DD HH24:MI:SS'),100,0)
;
-- Sep 11, 2011 11:49:44 AM COT
-- IDEMPIERE-67 ProcessedOn should not be copied by MOrder.copyFrom
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=62200 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- Sep 11, 2011 11:52:39 AM COT
-- IDEMPIERE-67 ProcessedOn should not be copied by MOrder.copyFrom
ALTER TABLE AD_Field ADD COLUMN IsAllowCopy CHAR(1) DEFAULT NULL
;
-- Sep 11, 2011 11:51:12 AM COT
-- IDEMPIERE-67 ProcessedOn should not be copied by MOrder.copyFrom
UPDATE AD_Field SET SeqNo=290,Updated=TO_TIMESTAMP('2011-09-11 11:51:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=53280
;
-- Sep 11, 2011 11:51:25 AM COT
-- IDEMPIERE-67 ProcessedOn should not be copied by MOrder.copyFrom
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,SortNo,Updated,UpdatedBy) VALUES (0,62200,62468,0,107,TO_TIMESTAMP('2011-09-11 11:51:24','YYYY-MM-DD HH24:MI:SS'),100,'Determine if a column must be copied when pushing the button to copy record',0,'D','Y','Y','Y','N','N','N','N','Y','Allow Copy',280,0,TO_TIMESTAMP('2011-09-11 11:51:24','YYYY-MM-DD HH24:MI:SS'),100)
;
-- Sep 11, 2011 11:56:01 AM COT
-- IDEMPIERE-67 ProcessedOn should not be copied by MOrder.copyFrom
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=62468 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- Backward compatibility with old PO copyValues method
UPDATE AD_Column SET IsAllowCopy='N' WHERE ColumnName IN (
'Created',
'Created',
'CreatedBy',
'Updated',
'UpdatedBy',
'IsActive',
'AD_Client_ID',
'AD_Org_ID',
'Processing'
);
-- additional from GridTable (on AD_Field for better backward compatibility)
UPDATE AD_Field SET IsAllowCopy='N' WHERE AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE ColumnName IN (
'EntityType',
'DocumentNo',
'Processed',
'IsSelfService',
'DocAction',
'DocStatus',
'Posted',
'IsReconciled',
'IsApproved',
'IsGenerated',
'GrandTotal',
'TotalLines',
'C_CashLine_ID',
'C_Payment_ID',
'IsPaid',
'IsAllocated',
'Line'
));
-- Ref_ from GridTable
UPDATE AD_Field SET IsAllowCopy='N' WHERE AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE ColumnName LIKE 'Ref_%');
-- C_DocType_ID if there is DocTypeTarget from GridTable
UPDATE AD_Field SET IsAllowCopy='N' WHERE AD_Column_ID IN
(SELECT AD_Column_ID FROM AD_Column cdt
WHERE cdt.ColumnName = 'C_DocType_ID' AND EXISTS
(SELECT 1 FROM AD_Column cdtt
WHERE cdtt.AD_Table_ID=cdt.AD_Table_ID AND cdtt.ColumnName='C_DocTypeTarget_ID'));
-- new columns found to be problematic
UPDATE AD_Column SET IsAllowCopy='N' WHERE ColumnName IN (
'ProcessedOn'
);
-- new fields found to be problematic
UPDATE AD_Field SET IsAllowCopy='N' WHERE AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE ColumnName IN (
'QtyDelivered',
'QtyInvoiced',
'QtyReserved'
));
-- key columns
UPDATE AD_Column SET IsAllowCopy='N' WHERE IsKey='Y';
-- virtual columns
UPDATE AD_Column SET IsAllowCopy='N' WHERE ColumnSQL IS NOT NULL;
-- UUID columns
UPDATE AD_Column SET IsAllowCopy='N' WHERE columnname = (SELECT tablename||'_UU' FROM ad_table t where t.ad_table_id=ad_column.ad_table_id);
DROP VIEW ad_field_v;
CREATE OR REPLACE VIEW ad_field_v AS
SELECT t.ad_window_id, f.ad_tab_id, f.ad_field_id, tbl.ad_table_id, f.ad_column_id,
f.name, f.description, f.help, f.isdisplayed, f.displaylogic, f.displaylength, f.seqno,
f.sortno, f.issameline, f.isheading, f.isfieldonly, f.isreadonly, f.isencrypted AS isencryptedfield,
f.obscuretype, c.columnname, c.columnsql, c.fieldlength, c.vformat,
COALESCE(f.defaultvalue, c.defaultvalue) AS defaultvalue, c.iskey, c.isparent,
COALESCE(f.ismandatory, c.ismandatory) AS ismandatory, c.isidentifier, c.istranslated,
COALESCE(f.ad_reference_value_id, c.ad_reference_value_id) AS ad_reference_value_id, c.callout,
COALESCE(f.ad_reference_id, c.ad_reference_id) AS ad_reference_id,
COALESCE(f.ad_val_rule_id, c.ad_val_rule_id) AS ad_val_rule_id, c.ad_process_id,
c.isalwaysupdateable, c.readonlylogic, c.mandatorylogic, c.isupdateable,
c.isencrypted AS isencryptedcolumn, c.isselectioncolumn, tbl.tablename, c.valuemin, c.valuemax,
fg.name AS fieldgroup, vr.code AS validationcode, f.included_tab_id, fg.fieldgrouptype, fg.iscollapsedbydefault,
COALESCE(f.infofactoryclass, c.infofactoryclass) AS infofactoryclass, c.isautocomplete,
COALESCE(f.IsAllowCopy, c.IsAllowCopy) AS IsAllowCopy
FROM ad_field f
JOIN ad_tab t ON f.ad_tab_id = t.ad_tab_id
LEFT JOIN ad_fieldgroup fg ON f.ad_fieldgroup_id = fg.ad_fieldgroup_id
LEFT JOIN ad_column c ON f.ad_column_id = c.ad_column_id
JOIN ad_table tbl ON c.ad_table_id = tbl.ad_table_id
JOIN ad_reference r ON c.ad_reference_id = r.ad_reference_id
LEFT JOIN ad_val_rule vr ON vr.ad_val_rule_id = COALESCE(f.ad_val_rule_id, c.ad_val_rule_id)
WHERE f.isactive = 'Y'::bpchar AND c.isactive = 'Y'::bpchar;
DROP VIEW ad_field_vt;
CREATE OR REPLACE VIEW ad_field_vt AS
SELECT trl.ad_language, t.ad_window_id, f.ad_tab_id, f.ad_field_id, tbl.ad_table_id, f.ad_column_id, trl.name, trl.description,
trl.help, f.isdisplayed, f.displaylogic, f.displaylength, f.seqno, f.sortno, f.issameline, f.isheading, f.isfieldonly, f.isreadonly,
f.isencrypted AS isencryptedfield, f.obscuretype, c.columnname, c.columnsql, c.fieldlength, c.vformat, COALESCE(f.defaultvalue, c.defaultvalue) AS defaultvalue,
c.iskey, c.isparent, COALESCE(f.ismandatory, c.ismandatory) AS ismandatory, c.isidentifier, c.istranslated,
COALESCE(f.ad_reference_value_id, c.ad_reference_value_id) AS ad_reference_value_id, c.callout, COALESCE(f.ad_reference_id, c.ad_reference_id) AS ad_reference_id,
COALESCE(f.ad_val_rule_id, c.ad_val_rule_id) AS ad_val_rule_id, c.ad_process_id, c.isalwaysupdateable, c.readonlylogic, c.mandatorylogic, c.isupdateable,
c.isencrypted AS isencryptedcolumn, c.isselectioncolumn, tbl.tablename, c.valuemin, c.valuemax, fgt.name AS fieldgroup, vr.code AS validationcode,
f.included_tab_id, fg.fieldgrouptype, fg.iscollapsedbydefault, COALESCE(f.infofactoryclass, c.infofactoryclass) AS infofactoryclass, c.isautocomplete,
COALESCE(f.IsAllowCopy, c.IsAllowCopy) AS IsAllowCopy
FROM ad_field f
JOIN ad_field_trl trl ON f.ad_field_id = trl.ad_field_id
JOIN ad_tab t ON f.ad_tab_id = t.ad_tab_id
LEFT JOIN ad_fieldgroup fg ON f.ad_fieldgroup_id = fg.ad_fieldgroup_id
LEFT JOIN ad_fieldgroup_trl fgt ON f.ad_fieldgroup_id = fgt.ad_fieldgroup_id AND trl.ad_language::text = fgt.ad_language::text
LEFT JOIN ad_column c ON f.ad_column_id = c.ad_column_id
JOIN ad_table tbl ON c.ad_table_id = tbl.ad_table_id
JOIN ad_reference r ON c.ad_reference_id = r.ad_reference_id
LEFT JOIN ad_val_rule vr ON vr.ad_val_rule_id = COALESCE(f.ad_val_rule_id, c.ad_val_rule_id)
WHERE f.isactive = 'Y'::bpchar AND c.isactive = 'Y'::bpchar;

View File

@ -77,7 +77,7 @@ public class GridField
/** /**
* *
*/ */
private static final long serialVersionUID = -6007475135643071025L; private static final long serialVersionUID = -2943313231011246615L;
/** /**
* Field Constructor. * Field Constructor.
@ -1027,6 +1027,13 @@ public class GridField
public boolean isAutocomplete() { public boolean isAutocomplete() {
return m_vo.IsAutocomplete; return m_vo.IsAutocomplete;
} }
/**
* Is Allow Copy
* @return true if allow copy
*/
public boolean isAllowCopy() {
return m_vo.IsAllowCopy;
}
/** /**
* Is Always Updateable * Is Always Updateable
* @return true if always updateable * @return true if always updateable

View File

@ -41,6 +41,10 @@ import org.compiere.util.Env;
*/ */
public class GridFieldVO implements Serializable public class GridFieldVO implements Serializable
{ {
/**
*
*/
private static final long serialVersionUID = 3576685994073893942L;
/** /**
* Return the SQL statement used for the MFieldVO.create * Return the SQL statement used for the MFieldVO.create
@ -178,6 +182,8 @@ public class GridFieldVO implements Serializable
// Feature Request FR [ 2003044 ] // Feature Request FR [ 2003044 ]
else if (columnName.equalsIgnoreCase("IsAutocomplete")) else if (columnName.equalsIgnoreCase("IsAutocomplete"))
vo.IsAutocomplete = "Y".equals(rs.getString(i)); vo.IsAutocomplete = "Y".equals(rs.getString(i));
else if (columnName.equalsIgnoreCase("IsAllowCopy"))
vo.IsAllowCopy = "Y".equals(rs.getString(i));
} }
if (vo.Header == null) if (vo.Header == null)
vo.Header = vo.ColumnName; vo.Header = vo.ColumnName;
@ -345,8 +351,6 @@ public class GridFieldVO implements Serializable
tabReadOnly = TabReadOnly; tabReadOnly = TabReadOnly;
} // MFieldVO } // MFieldVO
static final long serialVersionUID = 4385061125114436797L;
/** Context */ /** Context */
public Properties ctx = null; public Properties ctx = null;
/** Window No */ /** Window No */
@ -458,6 +462,8 @@ public class GridFieldVO implements Serializable
public boolean IsCollapsedByDefault = false; public boolean IsCollapsedByDefault = false;
/** Autocompletion for textfields - Feature Request FR [ 1757088 ] */ /** Autocompletion for textfields - Feature Request FR [ 1757088 ] */
public boolean IsAutocomplete = false; public boolean IsAutocomplete = false;
/* Allow copy - IDEMPIERE-67 - Carlos Ruiz - globalqss */
public boolean IsAllowCopy = false;
/** /**
* Set Context including contained elements * Set Context including contained elements
@ -554,6 +560,7 @@ public class GridFieldVO implements Serializable
clone.IsEncryptedColumn = IsEncryptedColumn; clone.IsEncryptedColumn = IsEncryptedColumn;
clone.IsSelectionColumn = IsSelectionColumn; clone.IsSelectionColumn = IsSelectionColumn;
clone.IsAutocomplete = IsAutocomplete; clone.IsAutocomplete = IsAutocomplete;
clone.IsAllowCopy = IsAllowCopy;
clone.SortNo = SortNo; clone.SortNo = SortNo;
clone.FieldLength = FieldLength; clone.FieldLength = FieldLength;
clone.VFormat = VFormat; clone.VFormat = VFormat;

View File

@ -2478,40 +2478,18 @@ public class GridTable extends AbstractTableModel
// fill data // fill data
if (copyCurrent) if (copyCurrent)
{ {
boolean hasDocTypeTargetField = (getField("C_DocTypeTarget_ID") != null);
Object[] origData = getDataAtRow(currentRow); Object[] origData = getDataAtRow(currentRow);
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);
String columnName = field.getColumnName();
if (field.isVirtualColumn()) if (field.isVirtualColumn())
; ;
else if (field.isKey() else if (field.isAllowCopy())
|| columnName.equals("AD_Client_ID") rowData[i] = origData[i];
// else {
|| columnName.startsWith("Created") || columnName.startsWith("Updated")
|| columnName.equals("EntityType") || columnName.equals("DocumentNo")
|| columnName.equals("Processed") || columnName.equals("IsSelfService")
|| columnName.equals("DocAction") || columnName.equals("DocStatus")
|| columnName.equals("Posted") || columnName.equals("IsReconciled")
|| columnName.equals("IsApproved") // BF [ 1943682 ]
|| columnName.equals("IsGenerated") // BF [ 1943682 ]
|| columnName.startsWith("Ref_")
// Order/Invoice
|| columnName.equals("GrandTotal") || columnName.equals("TotalLines")
|| columnName.equals("C_CashLine_ID") || columnName.equals("C_Payment_ID")
|| columnName.equals("IsPaid") || columnName.equals("IsAllocated")
// Bug [ 1807947 ]
|| ( columnName.equals("C_DocType_ID") && hasDocTypeTargetField )
|| ( columnName.equals("Line") )
|| ( columnName.equals("C_Location_ID"))
)
{
rowData[i] = field.getDefault(); rowData[i] = field.getDefault();
field.setValue(rowData[i], m_inserting); field.setValue(rowData[i], m_inserting);
} }
else
rowData[i] = origData[i];
} }
} }
else // new else // new

View File

@ -31,7 +31,7 @@ public interface I_AD_Column
public static final String Table_Name = "AD_Column"; public static final String Table_Name = "AD_Column";
/** AD_Table_ID=101 */ /** AD_Table_ID=101 */
public static final int Table_ID = MTable.getTable_ID(Table_Name); public static final int Table_ID = 101;
KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name); KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);
@ -62,6 +62,15 @@ public interface I_AD_Column
*/ */
public int getAD_Column_ID(); public int getAD_Column_ID();
/** Column name AD_Column_UU */
public static final String COLUMNNAME_AD_Column_UU = "AD_Column_UU";
/** Set AD_Column_UU */
public void setAD_Column_UU (String AD_Column_UU);
/** Get AD_Column_UU */
public String getAD_Column_UU();
/** Column name AD_Element_ID */ /** Column name AD_Element_ID */
public static final String COLUMNNAME_AD_Element_ID = "AD_Element_ID"; public static final String COLUMNNAME_AD_Element_ID = "AD_Element_ID";
@ -75,7 +84,7 @@ public interface I_AD_Column
*/ */
public int getAD_Element_ID(); public int getAD_Element_ID();
public I_AD_Element getAD_Element() throws RuntimeException; public org.compiere.model.I_AD_Element getAD_Element() throws RuntimeException;
/** Column name AD_Org_ID */ /** Column name AD_Org_ID */
public static final String COLUMNNAME_AD_Org_ID = "AD_Org_ID"; public static final String COLUMNNAME_AD_Org_ID = "AD_Org_ID";
@ -103,7 +112,7 @@ public interface I_AD_Column
*/ */
public int getAD_Process_ID(); public int getAD_Process_ID();
public I_AD_Process getAD_Process() throws RuntimeException; public org.compiere.model.I_AD_Process getAD_Process() throws RuntimeException;
/** Column name AD_Reference_ID */ /** Column name AD_Reference_ID */
public static final String COLUMNNAME_AD_Reference_ID = "AD_Reference_ID"; public static final String COLUMNNAME_AD_Reference_ID = "AD_Reference_ID";
@ -118,7 +127,7 @@ public interface I_AD_Column
*/ */
public int getAD_Reference_ID(); public int getAD_Reference_ID();
public I_AD_Reference getAD_Reference() throws RuntimeException; public org.compiere.model.I_AD_Reference getAD_Reference() throws RuntimeException;
/** Column name AD_Reference_Value_ID */ /** Column name AD_Reference_Value_ID */
public static final String COLUMNNAME_AD_Reference_Value_ID = "AD_Reference_Value_ID"; public static final String COLUMNNAME_AD_Reference_Value_ID = "AD_Reference_Value_ID";
@ -133,7 +142,7 @@ public interface I_AD_Column
*/ */
public int getAD_Reference_Value_ID(); public int getAD_Reference_Value_ID();
public I_AD_Reference getAD_Reference_Value() throws RuntimeException; public org.compiere.model.I_AD_Reference getAD_Reference_Value() throws RuntimeException;
/** Column name AD_Table_ID */ /** Column name AD_Table_ID */
public static final String COLUMNNAME_AD_Table_ID = "AD_Table_ID"; public static final String COLUMNNAME_AD_Table_ID = "AD_Table_ID";
@ -148,7 +157,7 @@ public interface I_AD_Column
*/ */
public int getAD_Table_ID(); public int getAD_Table_ID();
public I_AD_Table getAD_Table() throws RuntimeException; public org.compiere.model.I_AD_Table getAD_Table() throws RuntimeException;
/** Column name AD_Val_Rule_ID */ /** Column name AD_Val_Rule_ID */
public static final String COLUMNNAME_AD_Val_Rule_ID = "AD_Val_Rule_ID"; public static final String COLUMNNAME_AD_Val_Rule_ID = "AD_Val_Rule_ID";
@ -163,7 +172,7 @@ public interface I_AD_Column
*/ */
public int getAD_Val_Rule_ID(); public int getAD_Val_Rule_ID();
public I_AD_Val_Rule getAD_Val_Rule() throws RuntimeException; public org.compiere.model.I_AD_Val_Rule getAD_Val_Rule() throws RuntimeException;
/** Column name Callout */ /** Column name Callout */
public static final String COLUMNNAME_Callout = "Callout"; public static final String COLUMNNAME_Callout = "Callout";
@ -328,6 +337,19 @@ public interface I_AD_Column
*/ */
public boolean isActive(); public boolean isActive();
/** Column name IsAllowCopy */
public static final String COLUMNNAME_IsAllowCopy = "IsAllowCopy";
/** Set Allow Copy.
* Determine if a column must be copied when pushing the button to copy record
*/
public void setIsAllowCopy (boolean IsAllowCopy);
/** Get Allow Copy.
* Determine if a column must be copied when pushing the button to copy record
*/
public boolean isAllowCopy();
/** Column name IsAllowLogging */ /** Column name IsAllowLogging */
public static final String COLUMNNAME_IsAllowLogging = "IsAllowLogging"; public static final String COLUMNNAME_IsAllowLogging = "IsAllowLogging";

View File

@ -31,7 +31,7 @@ public interface I_AD_Field
public static final String Table_Name = "AD_Field"; public static final String Table_Name = "AD_Field";
/** AD_Table_ID=107 */ /** AD_Table_ID=107 */
public static final int Table_ID = MTable.getTable_ID(Table_Name); public static final int Table_ID = 107;
KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name); KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);
@ -62,7 +62,7 @@ public interface I_AD_Field
*/ */
public int getAD_Column_ID(); public int getAD_Column_ID();
public I_AD_Column getAD_Column() throws RuntimeException; public org.compiere.model.I_AD_Column getAD_Column() throws RuntimeException;
/** Column name AD_FieldGroup_ID */ /** Column name AD_FieldGroup_ID */
public static final String COLUMNNAME_AD_FieldGroup_ID = "AD_FieldGroup_ID"; public static final String COLUMNNAME_AD_FieldGroup_ID = "AD_FieldGroup_ID";
@ -77,7 +77,7 @@ public interface I_AD_Field
*/ */
public int getAD_FieldGroup_ID(); public int getAD_FieldGroup_ID();
public I_AD_FieldGroup getAD_FieldGroup() throws RuntimeException; public org.compiere.model.I_AD_FieldGroup getAD_FieldGroup() throws RuntimeException;
/** Column name AD_Field_ID */ /** Column name AD_Field_ID */
public static final String COLUMNNAME_AD_Field_ID = "AD_Field_ID"; public static final String COLUMNNAME_AD_Field_ID = "AD_Field_ID";
@ -92,6 +92,15 @@ public interface I_AD_Field
*/ */
public int getAD_Field_ID(); public int getAD_Field_ID();
/** Column name AD_Field_UU */
public static final String COLUMNNAME_AD_Field_UU = "AD_Field_UU";
/** Set AD_Field_UU */
public void setAD_Field_UU (String AD_Field_UU);
/** Get AD_Field_UU */
public String getAD_Field_UU();
/** Column name AD_Org_ID */ /** Column name AD_Org_ID */
public static final String COLUMNNAME_AD_Org_ID = "AD_Org_ID"; public static final String COLUMNNAME_AD_Org_ID = "AD_Org_ID";
@ -118,7 +127,7 @@ public interface I_AD_Field
*/ */
public int getAD_Reference_ID(); public int getAD_Reference_ID();
public I_AD_Reference getAD_Reference() throws RuntimeException; public org.compiere.model.I_AD_Reference getAD_Reference() throws RuntimeException;
/** Column name AD_Reference_Value_ID */ /** Column name AD_Reference_Value_ID */
public static final String COLUMNNAME_AD_Reference_Value_ID = "AD_Reference_Value_ID"; public static final String COLUMNNAME_AD_Reference_Value_ID = "AD_Reference_Value_ID";
@ -133,7 +142,7 @@ public interface I_AD_Field
*/ */
public int getAD_Reference_Value_ID(); public int getAD_Reference_Value_ID();
public I_AD_Reference getAD_Reference_Value() throws RuntimeException; public org.compiere.model.I_AD_Reference getAD_Reference_Value() throws RuntimeException;
/** Column name AD_Tab_ID */ /** Column name AD_Tab_ID */
public static final String COLUMNNAME_AD_Tab_ID = "AD_Tab_ID"; public static final String COLUMNNAME_AD_Tab_ID = "AD_Tab_ID";
@ -148,7 +157,7 @@ public interface I_AD_Field
*/ */
public int getAD_Tab_ID(); public int getAD_Tab_ID();
public I_AD_Tab getAD_Tab() throws RuntimeException; public org.compiere.model.I_AD_Tab getAD_Tab() throws RuntimeException;
/** Column name AD_Val_Rule_ID */ /** Column name AD_Val_Rule_ID */
public static final String COLUMNNAME_AD_Val_Rule_ID = "AD_Val_Rule_ID"; public static final String COLUMNNAME_AD_Val_Rule_ID = "AD_Val_Rule_ID";
@ -163,7 +172,7 @@ public interface I_AD_Field
*/ */
public int getAD_Val_Rule_ID(); public int getAD_Val_Rule_ID();
public I_AD_Val_Rule getAD_Val_Rule() throws RuntimeException; public org.compiere.model.I_AD_Val_Rule getAD_Val_Rule() throws RuntimeException;
/** Column name Created */ /** Column name Created */
public static final String COLUMNNAME_Created = "Created"; public static final String COLUMNNAME_Created = "Created";
@ -276,7 +285,7 @@ public interface I_AD_Field
*/ */
public int getIncluded_Tab_ID(); public int getIncluded_Tab_ID();
public I_AD_Tab getIncluded_Tab() throws RuntimeException; public org.compiere.model.I_AD_Tab getIncluded_Tab() throws RuntimeException;
/** Column name InfoFactoryClass */ /** Column name InfoFactoryClass */
public static final String COLUMNNAME_InfoFactoryClass = "InfoFactoryClass"; public static final String COLUMNNAME_InfoFactoryClass = "InfoFactoryClass";
@ -304,6 +313,19 @@ public interface I_AD_Field
*/ */
public boolean isActive(); public boolean isActive();
/** Column name IsAllowCopy */
public static final String COLUMNNAME_IsAllowCopy = "IsAllowCopy";
/** Set Allow Copy.
* Determine if a column must be copied when pushing the button to copy record
*/
public void setIsAllowCopy (String IsAllowCopy);
/** Get Allow Copy.
* Determine if a column must be copied when pushing the button to copy record
*/
public String getIsAllowCopy();
/** Column name IsCentrallyMaintained */ /** Column name IsCentrallyMaintained */
public static final String COLUMNNAME_IsCentrallyMaintained = "IsCentrallyMaintained"; public static final String COLUMNNAME_IsCentrallyMaintained = "IsCentrallyMaintained";

View File

@ -145,8 +145,10 @@ public class MColumn extends X_AD_Column
if (columnName.equals("AD_Client_ID") if (columnName.equals("AD_Client_ID")
|| columnName.equals("AD_Org_ID") || columnName.equals("AD_Org_ID")
|| columnName.equals("IsActive") || columnName.equals("IsActive")
|| columnName.startsWith("Created") || columnName.equals("Created")
|| columnName.startsWith("Updated") ) || columnName.equals("CreatedBy")
|| columnName.equals("Updated")
|| columnName.equals("UpdatedBy") )
return true; return true;
return false; return false;
@ -270,6 +272,18 @@ public class MColumn extends X_AD_Column
setDescription (element.getDescription()); setDescription (element.getDescription());
setHelp (element.getHelp()); setHelp (element.getHelp());
} }
// Validations for IsAllowCopy - some columns must never be set as allowed copying
String colname = getColumnName();
if (isAllowCopy()) {
if ( isKey()
|| getColumnSQL() != null
|| colname.equals(getAD_Table().getTableName()+"_UU")
|| isStandardColumn()
)
setIsAllowCopy(false);
}
return true; return true;
} // beforeSave } // beforeSave

View File

@ -128,6 +128,16 @@ public class MField extends X_AD_Field
setDescription (element.getDescription ()); setDescription (element.getDescription ());
setHelp (element.getHelp()); setHelp (element.getHelp());
} }
if (getIsAllowCopy() != null) {
MColumn column = (MColumn) getAD_Column();
if ( column.isKey()
|| column.getColumnSQL() != null
|| column.isStandardColumn()
)
setIsAllowCopy(null);
}
return true; return true;
} // beforeSave } // beforeSave

View File

@ -1225,35 +1225,20 @@ public abstract class PO
public static void copyValues (PO from, PO to) public static void copyValues (PO from, PO to)
{ {
s_log.fine("From ID=" + from.get_ID() + " - To ID=" + to.get_ID()); s_log.fine("From ID=" + from.get_ID() + " - To ID=" + to.get_ID());
String uuidColumn = from.get_TableName()+"_UU";
// Different Classes // Different Classes
if (from.getClass() != to.getClass()) if (from.getClass() != to.getClass())
{ {
for (int i1 = 0; i1 < from.m_oldValues.length; i1++) for (int i1 = 0; i1 < from.m_oldValues.length; i1++)
{ {
if (from.p_info.isVirtualColumn(i1) if (! from.p_info.isAllowCopy(i1))
|| from.p_info.isKey(i1)) // KeyColumn
continue; continue;
String colName = from.p_info.getColumnName(i1); String colName = from.p_info.getColumnName(i1);
// Ignore Standard Values for (int i2 = 0; i2 < to.m_oldValues.length; i2++)
if (colName.startsWith("Created")
|| colName.startsWith("Updated")
|| colName.equals("IsActive")
|| colName.equals("AD_Client_ID")
|| colName.equals("AD_Org_ID")
|| colName.equals("Processing")
|| colName.equals(uuidColumn)
)
; // ignore
else
{ {
for (int i2 = 0; i2 < to.m_oldValues.length; i2++) if (to.p_info.getColumnName(i2).equals(colName))
{ {
if (to.p_info.getColumnName(i2).equals(colName)) to.m_newValues[i2] = from.m_oldValues[i1];
{ break;
to.m_newValues[i2] = from.m_oldValues[i1];
break;
}
} }
} }
} // from loop } // from loop
@ -1262,22 +1247,9 @@ public abstract class PO
{ {
for (int i = 0; i < from.m_oldValues.length; i++) for (int i = 0; i < from.m_oldValues.length; i++)
{ {
if (from.p_info.isVirtualColumn(i) if (! from.p_info.isAllowCopy(i))
|| from.p_info.isKey(i)) // KeyColumn
continue; continue;
String colName = from.p_info.getColumnName(i); to.m_newValues[i] = from.m_oldValues[i];
// Ignore Standard Values
if (colName.startsWith("Created")
|| colName.startsWith("Updated")
|| colName.equals("IsActive")
|| colName.equals("AD_Client_ID")
|| colName.equals("AD_Org_ID")
|| colName.equals("Processing")
|| colName.equals(uuidColumn)
)
; // ignore
else
to.m_newValues[i] = from.m_oldValues[i];
} }
} // same class } // same class
} // copy } // copy

View File

@ -43,9 +43,12 @@ import org.compiere.util.Env;
*/ */
public class POInfo implements Serializable public class POInfo implements Serializable
{ {
/** Used by Remote FinReport */ /**
static final long serialVersionUID = -5976719579744948419L; *
*/
private static final long serialVersionUID = 6383466650370705655L;
/** Used by Remote FinReport */
/** /**
* POInfo Factory * POInfo Factory
* @param ctx context * @param ctx context
@ -141,7 +144,7 @@ public class POInfo implements Serializable
+ "c.AD_Reference_Value_ID, vr.Code, " // 12..13 + "c.AD_Reference_Value_ID, vr.Code, " // 12..13
+ "c.FieldLength, c.ValueMin, c.ValueMax, c.IsTranslated, " // 14..17 + "c.FieldLength, c.ValueMin, c.ValueMax, c.IsTranslated, " // 14..17
+ "t.AccessLevel, c.ColumnSQL, c.IsEncrypted, " // 18..20 + "t.AccessLevel, c.ColumnSQL, c.IsEncrypted, " // 18..20
+ "c.IsAllowLogging,t.IsChangeLog "); // 21 + "c.IsAllowLogging,c.IsAllowCopy,t.IsChangeLog "); // 21..23
sql.append("FROM AD_Table t" sql.append("FROM AD_Table t"
+ " INNER JOIN AD_Column c ON (t.AD_Table_ID=c.AD_Table_ID)" + " INNER JOIN AD_Column c ON (t.AD_Table_ID=c.AD_Table_ID)"
+ " LEFT OUTER JOIN AD_Val_Rule vr ON (c.AD_Val_Rule_ID=vr.AD_Val_Rule_ID)" + " LEFT OUTER JOIN AD_Val_Rule vr ON (c.AD_Val_Rule_ID=vr.AD_Val_Rule_ID)"
@ -189,7 +192,8 @@ public class POInfo implements Serializable
String ColumnSQL = rs.getString(19); String ColumnSQL = rs.getString(19);
boolean IsEncrypted = "Y".equals(rs.getString(20)); boolean IsEncrypted = "Y".equals(rs.getString(20));
boolean IsAllowLogging = "Y".equals(rs.getString(21)); boolean IsAllowLogging = "Y".equals(rs.getString(21));
m_IsChangeLog="Y".equals(rs.getString(22)); boolean IsAllowCopy = "Y".equals(rs.getString(22));
m_IsChangeLog="Y".equals(rs.getString(23));
POInfoColumn col = new POInfoColumn ( POInfoColumn col = new POInfoColumn (
AD_Column_ID, ColumnName, ColumnSQL, AD_Reference_ID, AD_Column_ID, ColumnName, ColumnSQL, AD_Reference_ID,
@ -199,7 +203,7 @@ public class POInfo implements Serializable
AD_Reference_Value_ID, ValidationCode, AD_Reference_Value_ID, ValidationCode,
FieldLength, ValueMin, ValueMax, FieldLength, ValueMin, ValueMax,
IsTranslated, IsEncrypted, IsTranslated, IsEncrypted,
IsAllowLogging); IsAllowLogging, IsAllowCopy);
list.add(col); list.add(col);
} }
} }
@ -599,6 +603,19 @@ public class POInfo implements Serializable
return m_columns[index].IsAllowLogging; return m_columns[index].IsAllowLogging;
} // isAllowLogging } // isAllowLogging
/**
* Is allowed copying this column
*
* @param index
* index
* @return true if column is allowed to be copied
*/
public boolean isAllowCopy(int index) {
if (index < 0 || index >= m_columns.length)
return false;
return m_columns[index].IsAllowCopy;
} // isAllowCopy
/** /**
* Get Column FieldLength * Get Column FieldLength
* @param index index * @param index index

View File

@ -30,9 +30,12 @@ import org.compiere.util.CLogger;
*/ */
public class POInfoColumn implements Serializable public class POInfoColumn implements Serializable
{ {
/**
*
*/
private static final long serialVersionUID = 3882249785085847367L;
/** Used by Remote FinReport */ /** Used by Remote FinReport */
static final long serialVersionUID = -3983585608504631958L;
/** /**
* Constructor * Constructor
* @param ad_Column_ID Column ID * @param ad_Column_ID Column ID
@ -54,6 +57,7 @@ public class POInfoColumn implements Serializable
* @param isTranslated translated * @param isTranslated translated
* @param isEncrypted encrypted * @param isEncrypted encrypted
* @param isAllowLogging allow logging * @param isAllowLogging allow logging
* @param isAllowCopy allow copy
*/ */
public POInfoColumn (int ad_Column_ID, String columnName, String columnSQL, int displayType, public POInfoColumn (int ad_Column_ID, String columnName, String columnSQL, int displayType,
boolean isMandatory, boolean isUpdateable, String defaultLogic, boolean isMandatory, boolean isUpdateable, String defaultLogic,
@ -61,7 +65,7 @@ public class POInfoColumn implements Serializable
boolean isKey, boolean isParent, boolean isKey, boolean isParent,
int ad_Reference_Value_ID, String validationCode, int ad_Reference_Value_ID, String validationCode,
int fieldLength, String valueMin, String valueMax, int fieldLength, String valueMin, String valueMax,
boolean isTranslated, boolean isEncrypted, boolean isAllowLogging) boolean isTranslated, boolean isEncrypted, boolean isAllowLogging, boolean isAllowCopy)
{ {
AD_Column_ID = ad_Column_ID; AD_Column_ID = ad_Column_ID;
ColumnName = columnName; ColumnName = columnName;
@ -120,6 +124,7 @@ public class POInfoColumn implements Serializable
IsTranslated = isTranslated; IsTranslated = isTranslated;
IsEncrypted = isEncrypted; IsEncrypted = isEncrypted;
IsAllowLogging = isAllowLogging; IsAllowLogging = isAllowLogging;
IsAllowCopy = isAllowCopy;
} // Column } // Column
/** Column ID */ /** Column ID */
@ -152,6 +157,8 @@ public class POInfoColumn implements Serializable
public boolean IsEncrypted; public boolean IsEncrypted;
/** Allow Logging */ /** Allow Logging */
public boolean IsAllowLogging; public boolean IsAllowLogging;
/** Allow Copy */
public boolean IsAllowCopy;
/** Reference Value */ /** Reference Value */
public int AD_Reference_Value_ID; public int AD_Reference_Value_ID;

View File

@ -32,7 +32,7 @@ public class X_AD_Column extends PO implements I_AD_Column, I_Persistent
/** /**
* *
*/ */
private static final long serialVersionUID = 20100614L; private static final long serialVersionUID = 20110918L;
/** Standard Constructor */ /** Standard Constructor */
public X_AD_Column (Properties ctx, int AD_Column_ID, String trxName) public X_AD_Column (Properties ctx, int AD_Column_ID, String trxName)
@ -47,6 +47,8 @@ public class X_AD_Column extends PO implements I_AD_Column, I_Persistent
setColumnName (null); setColumnName (null);
setEntityType (null); setEntityType (null);
// U // U
setIsAllowCopy (true);
// Y
setIsAlwaysUpdateable (false); setIsAlwaysUpdateable (false);
// N // N
setIsAutocomplete (false); setIsAutocomplete (false);
@ -117,9 +119,23 @@ public class X_AD_Column extends PO implements I_AD_Column, I_Persistent
return ii.intValue(); return ii.intValue();
} }
public I_AD_Element getAD_Element() throws RuntimeException /** Set AD_Column_UU.
@param AD_Column_UU AD_Column_UU */
public void setAD_Column_UU (String AD_Column_UU)
{
set_Value (COLUMNNAME_AD_Column_UU, AD_Column_UU);
}
/** Get AD_Column_UU.
@return AD_Column_UU */
public String getAD_Column_UU ()
{
return (String)get_Value(COLUMNNAME_AD_Column_UU);
}
public org.compiere.model.I_AD_Element getAD_Element() throws RuntimeException
{ {
return (I_AD_Element)MTable.get(getCtx(), I_AD_Element.Table_Name) return (org.compiere.model.I_AD_Element)MTable.get(getCtx(), org.compiere.model.I_AD_Element.Table_Name)
.getPO(getAD_Element_ID(), get_TrxName()); } .getPO(getAD_Element_ID(), get_TrxName()); }
/** Set System Element. /** Set System Element.
@ -145,9 +161,9 @@ public class X_AD_Column extends PO implements I_AD_Column, I_Persistent
return ii.intValue(); return ii.intValue();
} }
public I_AD_Process getAD_Process() throws RuntimeException public org.compiere.model.I_AD_Process getAD_Process() throws RuntimeException
{ {
return (I_AD_Process)MTable.get(getCtx(), I_AD_Process.Table_Name) return (org.compiere.model.I_AD_Process)MTable.get(getCtx(), org.compiere.model.I_AD_Process.Table_Name)
.getPO(getAD_Process_ID(), get_TrxName()); } .getPO(getAD_Process_ID(), get_TrxName()); }
/** Set Process. /** Set Process.
@ -173,9 +189,9 @@ public class X_AD_Column extends PO implements I_AD_Column, I_Persistent
return ii.intValue(); return ii.intValue();
} }
public I_AD_Reference getAD_Reference() throws RuntimeException public org.compiere.model.I_AD_Reference getAD_Reference() throws RuntimeException
{ {
return (I_AD_Reference)MTable.get(getCtx(), I_AD_Reference.Table_Name) return (org.compiere.model.I_AD_Reference)MTable.get(getCtx(), org.compiere.model.I_AD_Reference.Table_Name)
.getPO(getAD_Reference_ID(), get_TrxName()); } .getPO(getAD_Reference_ID(), get_TrxName()); }
/** Set Reference. /** Set Reference.
@ -201,9 +217,9 @@ public class X_AD_Column extends PO implements I_AD_Column, I_Persistent
return ii.intValue(); return ii.intValue();
} }
public I_AD_Reference getAD_Reference_Value() throws RuntimeException public org.compiere.model.I_AD_Reference getAD_Reference_Value() throws RuntimeException
{ {
return (I_AD_Reference)MTable.get(getCtx(), I_AD_Reference.Table_Name) return (org.compiere.model.I_AD_Reference)MTable.get(getCtx(), org.compiere.model.I_AD_Reference.Table_Name)
.getPO(getAD_Reference_Value_ID(), get_TrxName()); } .getPO(getAD_Reference_Value_ID(), get_TrxName()); }
/** Set Reference Key. /** Set Reference Key.
@ -229,9 +245,9 @@ public class X_AD_Column extends PO implements I_AD_Column, I_Persistent
return ii.intValue(); return ii.intValue();
} }
public I_AD_Table getAD_Table() throws RuntimeException public org.compiere.model.I_AD_Table getAD_Table() throws RuntimeException
{ {
return (I_AD_Table)MTable.get(getCtx(), I_AD_Table.Table_Name) return (org.compiere.model.I_AD_Table)MTable.get(getCtx(), org.compiere.model.I_AD_Table.Table_Name)
.getPO(getAD_Table_ID(), get_TrxName()); } .getPO(getAD_Table_ID(), get_TrxName()); }
/** Set Table. /** Set Table.
@ -257,9 +273,9 @@ public class X_AD_Column extends PO implements I_AD_Column, I_Persistent
return ii.intValue(); return ii.intValue();
} }
public I_AD_Val_Rule getAD_Val_Rule() throws RuntimeException public org.compiere.model.I_AD_Val_Rule getAD_Val_Rule() throws RuntimeException
{ {
return (I_AD_Val_Rule)MTable.get(getCtx(), I_AD_Val_Rule.Table_Name) return (org.compiere.model.I_AD_Val_Rule)MTable.get(getCtx(), org.compiere.model.I_AD_Val_Rule.Table_Name)
.getPO(getAD_Val_Rule_ID(), get_TrxName()); } .getPO(getAD_Val_Rule_ID(), get_TrxName()); }
/** Set Dynamic Validation. /** Set Dynamic Validation.
@ -469,6 +485,30 @@ public class X_AD_Column extends PO implements I_AD_Column, I_Persistent
return (String)get_Value(COLUMNNAME_InfoFactoryClass); return (String)get_Value(COLUMNNAME_InfoFactoryClass);
} }
/** Set Allow Copy.
@param IsAllowCopy
Determine if a column must be copied when pushing the button to copy record
*/
public void setIsAllowCopy (boolean IsAllowCopy)
{
set_Value (COLUMNNAME_IsAllowCopy, Boolean.valueOf(IsAllowCopy));
}
/** Get Allow Copy.
@return Determine if a column must be copied when pushing the button to copy record
*/
public boolean isAllowCopy ()
{
Object oo = get_Value(COLUMNNAME_IsAllowCopy);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set Allow Logging. /** Set Allow Logging.
@param IsAllowLogging @param IsAllowLogging
Determine if a column must be recorded into the change log Determine if a column must be recorded into the change log

View File

@ -32,7 +32,7 @@ public class X_AD_Field extends PO implements I_AD_Field, I_Persistent
/** /**
* *
*/ */
private static final long serialVersionUID = 20100614L; private static final long serialVersionUID = 20110918L;
/** Standard Constructor */ /** Standard Constructor */
public X_AD_Field (Properties ctx, int AD_Field_ID, String trxName) public X_AD_Field (Properties ctx, int AD_Field_ID, String trxName)
@ -86,9 +86,9 @@ public class X_AD_Field extends PO implements I_AD_Field, I_Persistent
return sb.toString(); return sb.toString();
} }
public I_AD_Column getAD_Column() throws RuntimeException public org.compiere.model.I_AD_Column getAD_Column() throws RuntimeException
{ {
return (I_AD_Column)MTable.get(getCtx(), I_AD_Column.Table_Name) return (org.compiere.model.I_AD_Column)MTable.get(getCtx(), org.compiere.model.I_AD_Column.Table_Name)
.getPO(getAD_Column_ID(), get_TrxName()); } .getPO(getAD_Column_ID(), get_TrxName()); }
/** Set Column. /** Set Column.
@ -114,9 +114,9 @@ public class X_AD_Field extends PO implements I_AD_Field, I_Persistent
return ii.intValue(); return ii.intValue();
} }
public I_AD_FieldGroup getAD_FieldGroup() throws RuntimeException public org.compiere.model.I_AD_FieldGroup getAD_FieldGroup() throws RuntimeException
{ {
return (I_AD_FieldGroup)MTable.get(getCtx(), I_AD_FieldGroup.Table_Name) return (org.compiere.model.I_AD_FieldGroup)MTable.get(getCtx(), org.compiere.model.I_AD_FieldGroup.Table_Name)
.getPO(getAD_FieldGroup_ID(), get_TrxName()); } .getPO(getAD_FieldGroup_ID(), get_TrxName()); }
/** Set Field Group. /** Set Field Group.
@ -165,9 +165,23 @@ public class X_AD_Field extends PO implements I_AD_Field, I_Persistent
return ii.intValue(); return ii.intValue();
} }
public I_AD_Reference getAD_Reference() throws RuntimeException /** Set AD_Field_UU.
@param AD_Field_UU AD_Field_UU */
public void setAD_Field_UU (String AD_Field_UU)
{
set_Value (COLUMNNAME_AD_Field_UU, AD_Field_UU);
}
/** Get AD_Field_UU.
@return AD_Field_UU */
public String getAD_Field_UU ()
{
return (String)get_Value(COLUMNNAME_AD_Field_UU);
}
public org.compiere.model.I_AD_Reference getAD_Reference() throws RuntimeException
{ {
return (I_AD_Reference)MTable.get(getCtx(), I_AD_Reference.Table_Name) return (org.compiere.model.I_AD_Reference)MTable.get(getCtx(), org.compiere.model.I_AD_Reference.Table_Name)
.getPO(getAD_Reference_ID(), get_TrxName()); } .getPO(getAD_Reference_ID(), get_TrxName()); }
/** Set Reference. /** Set Reference.
@ -193,9 +207,9 @@ public class X_AD_Field extends PO implements I_AD_Field, I_Persistent
return ii.intValue(); return ii.intValue();
} }
public I_AD_Reference getAD_Reference_Value() throws RuntimeException public org.compiere.model.I_AD_Reference getAD_Reference_Value() throws RuntimeException
{ {
return (I_AD_Reference)MTable.get(getCtx(), I_AD_Reference.Table_Name) return (org.compiere.model.I_AD_Reference)MTable.get(getCtx(), org.compiere.model.I_AD_Reference.Table_Name)
.getPO(getAD_Reference_Value_ID(), get_TrxName()); } .getPO(getAD_Reference_Value_ID(), get_TrxName()); }
/** Set Reference Key. /** Set Reference Key.
@ -221,9 +235,9 @@ public class X_AD_Field extends PO implements I_AD_Field, I_Persistent
return ii.intValue(); return ii.intValue();
} }
public I_AD_Tab getAD_Tab() throws RuntimeException public org.compiere.model.I_AD_Tab getAD_Tab() throws RuntimeException
{ {
return (I_AD_Tab)MTable.get(getCtx(), I_AD_Tab.Table_Name) return (org.compiere.model.I_AD_Tab)MTable.get(getCtx(), org.compiere.model.I_AD_Tab.Table_Name)
.getPO(getAD_Tab_ID(), get_TrxName()); } .getPO(getAD_Tab_ID(), get_TrxName()); }
/** Set Tab. /** Set Tab.
@ -249,9 +263,9 @@ public class X_AD_Field extends PO implements I_AD_Field, I_Persistent
return ii.intValue(); return ii.intValue();
} }
public I_AD_Val_Rule getAD_Val_Rule() throws RuntimeException public org.compiere.model.I_AD_Val_Rule getAD_Val_Rule() throws RuntimeException
{ {
return (I_AD_Val_Rule)MTable.get(getCtx(), I_AD_Val_Rule.Table_Name) return (org.compiere.model.I_AD_Val_Rule)MTable.get(getCtx(), org.compiere.model.I_AD_Val_Rule.Table_Name)
.getPO(getAD_Val_Rule_ID(), get_TrxName()); } .getPO(getAD_Val_Rule_ID(), get_TrxName()); }
/** Set Dynamic Validation. /** Set Dynamic Validation.
@ -385,9 +399,9 @@ public class X_AD_Field extends PO implements I_AD_Field, I_Persistent
return (String)get_Value(COLUMNNAME_Help); return (String)get_Value(COLUMNNAME_Help);
} }
public I_AD_Tab getIncluded_Tab() throws RuntimeException public org.compiere.model.I_AD_Tab getIncluded_Tab() throws RuntimeException
{ {
return (I_AD_Tab)MTable.get(getCtx(), I_AD_Tab.Table_Name) return (org.compiere.model.I_AD_Tab)MTable.get(getCtx(), org.compiere.model.I_AD_Tab.Table_Name)
.getPO(getIncluded_Tab_ID(), get_TrxName()); } .getPO(getIncluded_Tab_ID(), get_TrxName()); }
/** Set Included Tab. /** Set Included Tab.
@ -430,6 +444,30 @@ public class X_AD_Field extends PO implements I_AD_Field, I_Persistent
return (String)get_Value(COLUMNNAME_InfoFactoryClass); return (String)get_Value(COLUMNNAME_InfoFactoryClass);
} }
/** IsAllowCopy AD_Reference_ID=319 */
public static final int ISALLOWCOPY_AD_Reference_ID=319;
/** Yes = Y */
public static final String ISALLOWCOPY_Yes = "Y";
/** No = N */
public static final String ISALLOWCOPY_No = "N";
/** Set Allow Copy.
@param IsAllowCopy
Determine if a column must be copied when pushing the button to copy record
*/
public void setIsAllowCopy (String IsAllowCopy)
{
set_Value (COLUMNNAME_IsAllowCopy, IsAllowCopy);
}
/** Get Allow Copy.
@return Determine if a column must be copied when pushing the button to copy record
*/
public String getIsAllowCopy ()
{
return (String)get_Value(COLUMNNAME_IsAllowCopy);
}
/** Set Centrally maintained. /** Set Centrally maintained.
@param IsCentrallyMaintained @param IsCentrallyMaintained
Information maintained in System Element table Information maintained in System Element table