Project:
View Issue Details[ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
ID | ||||||||
0030724 | ||||||||
Type | Category | Severity | Reproducibility | Date Submitted | Last Update | |||
feature request | [Openbravo ERP] 02. Master data management | minor | N/A | 2015-09-01 17:24 | 2015-11-23 21:17 | |||
Reporter | gorkaion | View Status | public | |||||
Assigned To | gorkaion | |||||||
Priority | normal | Resolution | fixed | Fixed in Version | ||||
Status | closed | Fix in branch | Fixed in SCM revision | eca7d0102a7e | ||||
Projection | none | ETA | none | Target Version | ||||
OS | Any | Database | Any | Java version | ||||
OS Version | Database version | Ant version | ||||||
Product Version | SCM revision | |||||||
Review Assigned To | dmiguelez | |||||||
Web browser | ||||||||
Modules | Core | |||||||
Regression level | ||||||||
Regression date | ||||||||
Regression introduced in release | ||||||||
Regression introduced by commit | ||||||||
Triggers an Emergency Pack | No | |||||||
Summary | 0030724: Add ability to configure if values of a variant characteristics need to be added automatically to the configuration tab. | |||||||
Description | When a variant characteristic is added to a generic product all its values are copied in the configuration tab. If the characteristic has many values it makes more sense to be able to configure it so only the desired values are added manually by the user. | |||||||
Steps To Reproduce | Create a characteristic with some values. Create a new product checking the is generic flag. Add the characteristic to the product as a variant. Check that all the values are inserted in the configuration tab but it is nos possible to delete or insert new ones. | |||||||
Proposed Solution | Add a flag in the Characteristic definition and in the Product Characteristic definition to disable the automatic insert. This flag should work in a similar way than the is variant flag. | |||||||
Tags | No tags attached. | |||||||
Attached Files | issues-30721-30724-isexplodeflag-rev-496c8deb9c51.diff [^] (32,690 bytes) 2015-09-03 13:12 [Show Content] [Hide Content]diff --git a/src-db/database/model/tables/M_CHARACTERISTIC.xml b/src-db/database/model/tables/M_CHARACTERISTIC.xml --- a/src-db/database/model/tables/M_CHARACTERISTIC.xml +++ b/src-db/database/model/tables/M_CHARACTERISTIC.xml @@ -49,6 +49,10 @@ <default><![CDATA[N]]></default> <onCreateDefault/> </column> + <column name="ISEXPLODECONF" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false"> + <default><![CDATA[Y]]></default> + <onCreateDefault><![CDATA['Y']]></onCreateDefault> + </column> <foreign-key foreignTable="AD_CLIENT" name="M_CHARACTERISTIC_AD_CLIENT"> <reference local="AD_CLIENT_ID" foreign="AD_CLIENT_ID"/> </foreign-key> @@ -59,6 +63,7 @@ <reference local="AD_TREE_ID" foreign="AD_TREE_ID"/> </foreign-key> <check name="M_CHARACTERISTIC_ISACTIVE"><![CDATA[ISACTIVE IN ('Y', 'N')]]></check> + <check name="M_CHARACTERISTIC_ISEXPLODECONF"><![CDATA[ISEXPLODECONF IN ('Y', 'N')]]></check> <check name="M_CHARACTERISTIC_VARIANT"><![CDATA[ISVARIANT IN ('Y', 'N')]]></check> </table> </database> diff --git a/src-db/database/model/tables/M_PRODUCT_CH.xml b/src-db/database/model/tables/M_PRODUCT_CH.xml --- a/src-db/database/model/tables/M_PRODUCT_CH.xml +++ b/src-db/database/model/tables/M_PRODUCT_CH.xml @@ -65,6 +65,10 @@ <default><![CDATA[SALES]]></default> <onCreateDefault><![CDATA['ALL']]></onCreateDefault> </column> + <column name="ISEXPLODECONF" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false"> + <default><![CDATA[Y]]></default> + <onCreateDefault><![CDATA['Y']]></onCreateDefault> + </column> <foreign-key foreignTable="AD_CLIENT" name="M_PRODUCT_CH_AD_CLIENT"> <reference local="AD_CLIENT_ID" foreign="AD_CLIENT_ID"/> </foreign-key> @@ -87,6 +91,7 @@ <check name="M_PRODUCT_CH_DEFINE_IMAGE_CHK"><![CDATA[DEFINE_IMAGE IN ('Y', 'N')]]></check> <check name="M_PRODUCT_CH_DEFINE_PRICE_CHK"><![CDATA[DEFINE_PRICE IN ('Y', 'N')]]></check> <check name="M_PRODUCT_CH_ISACTIVE"><![CDATA[ISACTIVE IN ('Y', 'N')]]></check> + <check name="M_PRODUCT_CH_ISEXPLODECONF"><![CDATA[ISEXPLODECONF IN ('Y', 'N')]]></check> <check name="M_PRODUCT_CH_VARIANT"><![CDATA[ISVARIANT IN ('Y', 'N')]]></check> </table> </database> diff --git a/src-db/database/model/tables/M_PRODUCT_CH_CONF.xml b/src-db/database/model/tables/M_PRODUCT_CH_CONF.xml --- a/src-db/database/model/tables/M_PRODUCT_CH_CONF.xml +++ b/src-db/database/model/tables/M_PRODUCT_CH_CONF.xml @@ -71,6 +71,10 @@ <index name="M_PRODUCT_CH_CONF_CHAR" unique="false"> <index-column name="M_PRODUCT_CH_ID"/> </index> + <index name="M_PRODUCT_CH_CONF_UNIQ" unique="true"> + <index-column name="M_PRODUCT_CH_ID"/> + <index-column name="M_CH_VALUE_ID"/> + </index> <check name="M_PRODUCT_CH_CONF_ISACTIVE"><![CDATA[ISACTIVE IN ('Y', 'N')]]></check> </table> </database> diff --git a/src-db/database/model/triggers/M_CH_SUBSET_VALUE_TRG.xml b/src-db/database/model/triggers/M_CH_SUBSET_VALUE_TRG.xml --- a/src-db/database/model/triggers/M_CH_SUBSET_VALUE_TRG.xml +++ b/src-db/database/model/triggers/M_CH_SUBSET_VALUE_TRG.xml @@ -54,7 +54,10 @@ pch.m_product_ch_id, :new.m_ch_value_id, :new.skcode FROM m_product_ch pch WHERE pch.m_characteristic_id = v_characteristic_id - AND pch.m_ch_subset_id = :new.m_ch_subset_id; + AND pch.m_ch_subset_id = :new.m_ch_subset_id + AND exists (select 1 from m_product where m_product_id=pch.m_product_id AND isgeneric='Y') + AND pch.isvariant='Y' + AND pch.isexplodeconf = 'Y'; END IF; END M_CH_SUBSET_VALUE_TRG ]]></body> diff --git a/src-db/database/model/triggers/M_CH_VALUE_TRG.xml b/src-db/database/model/triggers/M_CH_VALUE_TRG.xml --- a/src-db/database/model/triggers/M_CH_VALUE_TRG.xml +++ b/src-db/database/model/triggers/M_CH_VALUE_TRG.xml @@ -90,8 +90,9 @@ FROM m_product_ch pch WHERE pch.m_characteristic_id = :new.m_characteristic_id AND pch.m_ch_subset_id IS NULL - AND exists (select 1 from m_product where m_product_id=pch.m_product_id AND isgeneric='Y') - AND pch.isvariant='Y'; + AND exists (select 1 from m_product where m_product_id=pch.m_product_id AND isgeneric='Y') + AND pch.isvariant='Y' + AND pch.isexplodeconf = 'Y'; END IF; IF DELETING THEN diff --git a/src-db/database/sourcedata/AD_COLUMN.xml b/src-db/database/sourcedata/AD_COLUMN.xml --- a/src-db/database/sourcedata/AD_COLUMN.xml +++ b/src-db/database/sourcedata/AD_COLUMN.xml @@ -231502,6 +231502,76 @@ <!--1E97CCA9378942AD8FAA59637244881C--> <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE> <!--1E97CCA9378942AD8FAA59637244881C--></AD_COLUMN> +<!--1E9B4165B4D9671EE050007F01005834--><AD_COLUMN> +<!--1E9B4165B4D9671EE050007F01005834--> <AD_COLUMN_ID><![CDATA[1E9B4165B4D9671EE050007F01005834]]></AD_COLUMN_ID> +<!--1E9B4165B4D9671EE050007F01005834--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID> +<!--1E9B4165B4D9671EE050007F01005834--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID> +<!--1E9B4165B4D9671EE050007F01005834--> <ISACTIVE><![CDATA[Y]]></ISACTIVE> +<!--1E9B4165B4D9671EE050007F01005834--> <NAME><![CDATA[Explode Configuration Tab]]></NAME> +<!--1E9B4165B4D9671EE050007F01005834--> <HELP><![CDATA[Determines if the values of the characteristic needs to be automatically inserted in the Configuration tab when the characteristic is added to a Generic product as a Variant.]]></HELP> +<!--1E9B4165B4D9671EE050007F01005834--> <COLUMNNAME><![CDATA[IsExplodeConf]]></COLUMNNAME> +<!--1E9B4165B4D9671EE050007F01005834--> <AD_TABLE_ID><![CDATA[8E4A6598CA2747B6B0E7257C6F3DEB19]]></AD_TABLE_ID> +<!--1E9B4165B4D9671EE050007F01005834--> <AD_REFERENCE_ID><![CDATA[20]]></AD_REFERENCE_ID> +<!--1E9B4165B4D9671EE050007F01005834--> <FIELDLENGTH><![CDATA[1]]></FIELDLENGTH> +<!--1E9B4165B4D9671EE050007F01005834--> <DEFAULTVALUE><![CDATA[Y]]></DEFAULTVALUE> +<!--1E9B4165B4D9671EE050007F01005834--> <ISKEY><![CDATA[N]]></ISKEY> +<!--1E9B4165B4D9671EE050007F01005834--> <ISPARENT><![CDATA[N]]></ISPARENT> +<!--1E9B4165B4D9671EE050007F01005834--> <ISMANDATORY><![CDATA[Y]]></ISMANDATORY> +<!--1E9B4165B4D9671EE050007F01005834--> <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE> +<!--1E9B4165B4D9671EE050007F01005834--> <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER> +<!--1E9B4165B4D9671EE050007F01005834--> <SEQNO><![CDATA[190]]></SEQNO> +<!--1E9B4165B4D9671EE050007F01005834--> <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED> +<!--1E9B4165B4D9671EE050007F01005834--> <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED> +<!--1E9B4165B4D9671EE050007F01005834--> <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN> +<!--1E9B4165B4D9671EE050007F01005834--> <AD_ELEMENT_ID><![CDATA[1E9B451D4487ECDDE050007F010057FB]]></AD_ELEMENT_ID> +<!--1E9B4165B4D9671EE050007F01005834--> <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR> +<!--1E9B4165B4D9671EE050007F01005834--> <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY> +<!--1E9B4165B4D9671EE050007F01005834--> <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE> +<!--1E9B4165B4D9671EE050007F01005834--> <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS> +<!--1E9B4165B4D9671EE050007F01005834--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID> +<!--1E9B4165B4D9671EE050007F01005834--> <POSITION><![CDATA[17]]></POSITION> +<!--1E9B4165B4D9671EE050007F01005834--> <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT> +<!--1E9B4165B4D9671EE050007F01005834--> <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE> +<!--1E9B4165B4D9671EE050007F01005834--> <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW> +<!--1E9B4165B4D9671EE050007F01005834--> <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION> +<!--1E9B4165B4D9671EE050007F01005834--> <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE> +<!--1E9B4165B4D9671EE050007F01005834--></AD_COLUMN> + +<!--1E9B451D4492ECDDE050007F010057FB--><AD_COLUMN> +<!--1E9B451D4492ECDDE050007F010057FB--> <AD_COLUMN_ID><![CDATA[1E9B451D4492ECDDE050007F010057FB]]></AD_COLUMN_ID> +<!--1E9B451D4492ECDDE050007F010057FB--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID> +<!--1E9B451D4492ECDDE050007F010057FB--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID> +<!--1E9B451D4492ECDDE050007F010057FB--> <ISACTIVE><![CDATA[Y]]></ISACTIVE> +<!--1E9B451D4492ECDDE050007F010057FB--> <NAME><![CDATA[Explode Configuration Tab]]></NAME> +<!--1E9B451D4492ECDDE050007F010057FB--> <HELP><![CDATA[Determines if the values of the characteristic needs to be automatically inserted in the Configuration tab when the characteristic is added to a Generic product as a Variant.]]></HELP> +<!--1E9B451D4492ECDDE050007F010057FB--> <COLUMNNAME><![CDATA[IsExplodeConf]]></COLUMNNAME> +<!--1E9B451D4492ECDDE050007F010057FB--> <AD_TABLE_ID><![CDATA[91C26DEA4B3D4C05B4F277D009220872]]></AD_TABLE_ID> +<!--1E9B451D4492ECDDE050007F010057FB--> <AD_REFERENCE_ID><![CDATA[20]]></AD_REFERENCE_ID> +<!--1E9B451D4492ECDDE050007F010057FB--> <FIELDLENGTH><![CDATA[1]]></FIELDLENGTH> +<!--1E9B451D4492ECDDE050007F010057FB--> <DEFAULTVALUE><![CDATA[Y]]></DEFAULTVALUE> +<!--1E9B451D4492ECDDE050007F010057FB--> <ISKEY><![CDATA[N]]></ISKEY> +<!--1E9B451D4492ECDDE050007F010057FB--> <ISPARENT><![CDATA[N]]></ISPARENT> +<!--1E9B451D4492ECDDE050007F010057FB--> <ISMANDATORY><![CDATA[Y]]></ISMANDATORY> +<!--1E9B451D4492ECDDE050007F010057FB--> <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE> +<!--1E9B451D4492ECDDE050007F010057FB--> <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER> +<!--1E9B451D4492ECDDE050007F010057FB--> <SEQNO><![CDATA[180]]></SEQNO> +<!--1E9B451D4492ECDDE050007F010057FB--> <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED> +<!--1E9B451D4492ECDDE050007F010057FB--> <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED> +<!--1E9B451D4492ECDDE050007F010057FB--> <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN> +<!--1E9B451D4492ECDDE050007F010057FB--> <AD_ELEMENT_ID><![CDATA[1E9B451D4487ECDDE050007F010057FB]]></AD_ELEMENT_ID> +<!--1E9B451D4492ECDDE050007F010057FB--> <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR> +<!--1E9B451D4492ECDDE050007F010057FB--> <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY> +<!--1E9B451D4492ECDDE050007F010057FB--> <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE> +<!--1E9B451D4492ECDDE050007F010057FB--> <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS> +<!--1E9B451D4492ECDDE050007F010057FB--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID> +<!--1E9B451D4492ECDDE050007F010057FB--> <POSITION><![CDATA[13]]></POSITION> +<!--1E9B451D4492ECDDE050007F010057FB--> <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT> +<!--1E9B451D4492ECDDE050007F010057FB--> <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE> +<!--1E9B451D4492ECDDE050007F010057FB--> <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW> +<!--1E9B451D4492ECDDE050007F010057FB--> <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION> +<!--1E9B451D4492ECDDE050007F010057FB--> <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE> +<!--1E9B451D4492ECDDE050007F010057FB--></AD_COLUMN> + <!--1EAEE8AF503C4348B565DB81325665D2--><AD_COLUMN> <!--1EAEE8AF503C4348B565DB81325665D2--> <AD_COLUMN_ID><![CDATA[1EAEE8AF503C4348B565DB81325665D2]]></AD_COLUMN_ID> <!--1EAEE8AF503C4348B565DB81325665D2--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID> @@ -332599,7 +332669,7 @@ <!--DFE34CED8F06273BE040007F0100319F--> <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE> <!--DFE34CED8F06273BE040007F0100319F--> <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS> <!--DFE34CED8F06273BE040007F0100319F--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID> -<!--DFE34CED8F06273BE040007F0100319F--> <POSITION><![CDATA[16]]></POSITION> +<!--DFE34CED8F06273BE040007F0100319F--> <POSITION><![CDATA[12]]></POSITION> <!--DFE34CED8F06273BE040007F0100319F--> <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT> <!--DFE34CED8F06273BE040007F0100319F--> <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE> <!--DFE34CED8F06273BE040007F0100319F--> <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW> diff --git a/src-db/database/sourcedata/AD_ELEMENT.xml b/src-db/database/sourcedata/AD_ELEMENT.xml --- a/src-db/database/sourcedata/AD_ELEMENT.xml +++ b/src-db/database/sourcedata/AD_ELEMENT.xml @@ -21646,6 +21646,19 @@ <!--1E5CB7185CF94CC595BDB2A1C2129C75--> <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY> <!--1E5CB7185CF94CC595BDB2A1C2129C75--></AD_ELEMENT> +<!--1E9B451D4487ECDDE050007F010057FB--><AD_ELEMENT> +<!--1E9B451D4487ECDDE050007F010057FB--> <AD_ELEMENT_ID><![CDATA[1E9B451D4487ECDDE050007F010057FB]]></AD_ELEMENT_ID> +<!--1E9B451D4487ECDDE050007F010057FB--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID> +<!--1E9B451D4487ECDDE050007F010057FB--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID> +<!--1E9B451D4487ECDDE050007F010057FB--> <ISACTIVE><![CDATA[Y]]></ISACTIVE> +<!--1E9B451D4487ECDDE050007F010057FB--> <COLUMNNAME><![CDATA[IsExplodeConf]]></COLUMNNAME> +<!--1E9B451D4487ECDDE050007F010057FB--> <NAME><![CDATA[Explode Configuration Tab]]></NAME> +<!--1E9B451D4487ECDDE050007F010057FB--> <PRINTNAME><![CDATA[Explode Configuration Tab]]></PRINTNAME> +<!--1E9B451D4487ECDDE050007F010057FB--> <HELP><![CDATA[Determines if the values of the characteristic needs to be automatically inserted in the Configuration tab when the characteristic is added to a Generic product as a Variant.]]></HELP> +<!--1E9B451D4487ECDDE050007F010057FB--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID> +<!--1E9B451D4487ECDDE050007F010057FB--> <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY> +<!--1E9B451D4487ECDDE050007F010057FB--></AD_ELEMENT> + <!--1E9CF24A3AC043188D0462EAF1CFDABF--><AD_ELEMENT> <!--1E9CF24A3AC043188D0462EAF1CFDABF--> <AD_ELEMENT_ID><![CDATA[1E9CF24A3AC043188D0462EAF1CFDABF]]></AD_ELEMENT_ID> <!--1E9CF24A3AC043188D0462EAF1CFDABF--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID> diff --git a/src-db/database/sourcedata/AD_FIELD.xml b/src-db/database/sourcedata/AD_FIELD.xml --- a/src-db/database/sourcedata/AD_FIELD.xml +++ b/src-db/database/sourcedata/AD_FIELD.xml @@ -189579,6 +189579,62 @@ <!--1E92B8595A2540319DD25495D459830C--> <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY> <!--1E92B8595A2540319DD25495D459830C--></AD_FIELD> +<!--1E9B451D448DECDDE050007F010057FB--><AD_FIELD> +<!--1E9B451D448DECDDE050007F010057FB--> <AD_FIELD_ID><![CDATA[1E9B451D448DECDDE050007F010057FB]]></AD_FIELD_ID> +<!--1E9B451D448DECDDE050007F010057FB--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID> +<!--1E9B451D448DECDDE050007F010057FB--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID> +<!--1E9B451D448DECDDE050007F010057FB--> <ISACTIVE><![CDATA[Y]]></ISACTIVE> +<!--1E9B451D448DECDDE050007F010057FB--> <NAME><![CDATA[Explode Configuration Tab]]></NAME> +<!--1E9B451D448DECDDE050007F010057FB--> <HELP><![CDATA[Determines if the values of the characteristic needs to be automatically inserted in the Configuration tab when the characteristic is added to a Generic product as a Variant.]]></HELP> +<!--1E9B451D448DECDDE050007F010057FB--> <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED> +<!--1E9B451D448DECDDE050007F010057FB--> <AD_TAB_ID><![CDATA[769BB4BF6B0B4C39AD28E9A00D260F33]]></AD_TAB_ID> +<!--1E9B451D448DECDDE050007F010057FB--> <AD_COLUMN_ID><![CDATA[1E9B4165B4D9671EE050007F01005834]]></AD_COLUMN_ID> +<!--1E9B451D448DECDDE050007F010057FB--> <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD> +<!--1E9B451D448DECDDE050007F010057FB--> <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED> +<!--1E9B451D448DECDDE050007F010057FB--> <DISPLAYLOGIC><![CDATA[@isVariant@='Y'&@IsGeneric@='Y']]></DISPLAYLOGIC> +<!--1E9B451D448DECDDE050007F010057FB--> <DISPLAYLENGTH><![CDATA[1]]></DISPLAYLENGTH> +<!--1E9B451D448DECDDE050007F010057FB--> <ISREADONLY><![CDATA[N]]></ISREADONLY> +<!--1E9B451D448DECDDE050007F010057FB--> <SEQNO><![CDATA[40]]></SEQNO> +<!--1E9B451D448DECDDE050007F010057FB--> <ISSAMELINE><![CDATA[N]]></ISSAMELINE> +<!--1E9B451D448DECDDE050007F010057FB--> <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY> +<!--1E9B451D448DECDDE050007F010057FB--> <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED> +<!--1E9B451D448DECDDE050007F010057FB--> <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION> +<!--1E9B451D448DECDDE050007F010057FB--> <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD> +<!--1E9B451D448DECDDE050007F010057FB--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID> +<!--1E9B451D448DECDDE050007F010057FB--> <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN> +<!--1E9B451D448DECDDE050007F010057FB--> <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE> +<!--1E9B451D448DECDDE050007F010057FB--> <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR> +<!--1E9B451D448DECDDE050007F010057FB--> <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY> +<!--1E9B451D448DECDDE050007F010057FB--></AD_FIELD> + +<!--1E9B451D4497ECDDE050007F010057FB--><AD_FIELD> +<!--1E9B451D4497ECDDE050007F010057FB--> <AD_FIELD_ID><![CDATA[1E9B451D4497ECDDE050007F010057FB]]></AD_FIELD_ID> +<!--1E9B451D4497ECDDE050007F010057FB--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID> +<!--1E9B451D4497ECDDE050007F010057FB--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID> +<!--1E9B451D4497ECDDE050007F010057FB--> <ISACTIVE><![CDATA[Y]]></ISACTIVE> +<!--1E9B451D4497ECDDE050007F010057FB--> <NAME><![CDATA[Explode Configuration Tab]]></NAME> +<!--1E9B451D4497ECDDE050007F010057FB--> <HELP><![CDATA[Determines if the values of the characteristic needs to be automatically inserted in the Configuration tab when the characteristic is added to a Generic product as a Variant.]]></HELP> +<!--1E9B451D4497ECDDE050007F010057FB--> <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED> +<!--1E9B451D4497ECDDE050007F010057FB--> <AD_TAB_ID><![CDATA[A661A0A05DCD4650BCB14B010C87F0AA]]></AD_TAB_ID> +<!--1E9B451D4497ECDDE050007F010057FB--> <AD_COLUMN_ID><![CDATA[1E9B451D4492ECDDE050007F010057FB]]></AD_COLUMN_ID> +<!--1E9B451D4497ECDDE050007F010057FB--> <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD> +<!--1E9B451D4497ECDDE050007F010057FB--> <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED> +<!--1E9B451D4497ECDDE050007F010057FB--> <DISPLAYLOGIC><![CDATA[@isVariant@='Y']]></DISPLAYLOGIC> +<!--1E9B451D4497ECDDE050007F010057FB--> <DISPLAYLENGTH><![CDATA[1]]></DISPLAYLENGTH> +<!--1E9B451D4497ECDDE050007F010057FB--> <ISREADONLY><![CDATA[N]]></ISREADONLY> +<!--1E9B451D4497ECDDE050007F010057FB--> <SEQNO><![CDATA[40]]></SEQNO> +<!--1E9B451D4497ECDDE050007F010057FB--> <ISSAMELINE><![CDATA[N]]></ISSAMELINE> +<!--1E9B451D4497ECDDE050007F010057FB--> <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY> +<!--1E9B451D4497ECDDE050007F010057FB--> <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED> +<!--1E9B451D4497ECDDE050007F010057FB--> <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION> +<!--1E9B451D4497ECDDE050007F010057FB--> <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD> +<!--1E9B451D4497ECDDE050007F010057FB--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID> +<!--1E9B451D4497ECDDE050007F010057FB--> <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN> +<!--1E9B451D4497ECDDE050007F010057FB--> <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE> +<!--1E9B451D4497ECDDE050007F010057FB--> <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR> +<!--1E9B451D4497ECDDE050007F010057FB--> <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY> +<!--1E9B451D4497ECDDE050007F010057FB--></AD_FIELD> + <!--1E9F1F317C2141688C1213BA43F1954A--><AD_FIELD> <!--1E9F1F317C2141688C1213BA43F1954A--> <AD_FIELD_ID><![CDATA[1E9F1F317C2141688C1213BA43F1954A]]></AD_FIELD_ID> <!--1E9F1F317C2141688C1213BA43F1954A--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID> @@ -291161,7 +291217,6 @@ <!--D6CBFD85215F563DE040007F0100228D--> <ISDISPLAYED><![CDATA[N]]></ISDISPLAYED> <!--D6CBFD85215F563DE040007F0100228D--> <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH> <!--D6CBFD85215F563DE040007F0100228D--> <ISREADONLY><![CDATA[N]]></ISREADONLY> -<!--D6CBFD85215F563DE040007F0100228D--> <SEQNO><![CDATA[40]]></SEQNO> <!--D6CBFD85215F563DE040007F0100228D--> <ISSAMELINE><![CDATA[N]]></ISSAMELINE> <!--D6CBFD85215F563DE040007F0100228D--> <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY> <!--D6CBFD85215F563DE040007F0100228D--> <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED> @@ -291270,7 +291325,7 @@ <!--D6DAE72466B920D3E040007F01003941--> <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED> <!--D6DAE72466B920D3E040007F01003941--> <DISPLAYLENGTH><![CDATA[1]]></DISPLAYLENGTH> <!--D6DAE72466B920D3E040007F01003941--> <ISREADONLY><![CDATA[N]]></ISREADONLY> -<!--D6DAE72466B920D3E040007F01003941--> <SEQNO><![CDATA[40]]></SEQNO> +<!--D6DAE72466B920D3E040007F01003941--> <SEQNO><![CDATA[90]]></SEQNO> <!--D6DAE72466B920D3E040007F01003941--> <ISSAMELINE><![CDATA[N]]></ISSAMELINE> <!--D6DAE72466B920D3E040007F01003941--> <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY> <!--D6DAE72466B920D3E040007F01003941--> <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED> @@ -292891,7 +292946,7 @@ <!--D9E9D213D42EB578E040007F010015CC--> <DISPLAYLOGIC><![CDATA[@isGeneric@='Y']]></DISPLAYLOGIC> <!--D9E9D213D42EB578E040007F010015CC--> <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH> <!--D9E9D213D42EB578E040007F010015CC--> <ISREADONLY><![CDATA[N]]></ISREADONLY> -<!--D9E9D213D42EB578E040007F010015CC--> <SEQNO><![CDATA[90]]></SEQNO> +<!--D9E9D213D42EB578E040007F010015CC--> <SEQNO><![CDATA[80]]></SEQNO> <!--D9E9D213D42EB578E040007F010015CC--> <ISSAMELINE><![CDATA[N]]></ISSAMELINE> <!--D9E9D213D42EB578E040007F010015CC--> <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY> <!--D9E9D213D42EB578E040007F010015CC--> <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED> @@ -293447,7 +293502,7 @@ <!--DA64BC057C44893CE040007F010046BF--> <DISPLAYLOGIC><![CDATA[@isGeneric@='Y']]></DISPLAYLOGIC> <!--DA64BC057C44893CE040007F010046BF--> <DISPLAYLENGTH><![CDATA[1]]></DISPLAYLENGTH> <!--DA64BC057C44893CE040007F010046BF--> <ISREADONLY><![CDATA[N]]></ISREADONLY> -<!--DA64BC057C44893CE040007F010046BF--> <SEQNO><![CDATA[60]]></SEQNO> +<!--DA64BC057C44893CE040007F010046BF--> <SEQNO><![CDATA[50]]></SEQNO> <!--DA64BC057C44893CE040007F010046BF--> <ISSAMELINE><![CDATA[N]]></ISSAMELINE> <!--DA64BC057C44893CE040007F010046BF--> <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY> <!--DA64BC057C44893CE040007F010046BF--> <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED> @@ -296360,7 +296415,7 @@ <!--E084A90237DEECEDE040007F0100697D--> <DISPLAYLOGIC><![CDATA[@isGeneric@='Y']]></DISPLAYLOGIC> <!--E084A90237DEECEDE040007F0100697D--> <DISPLAYLENGTH><![CDATA[1]]></DISPLAYLENGTH> <!--E084A90237DEECEDE040007F0100697D--> <ISREADONLY><![CDATA[N]]></ISREADONLY> -<!--E084A90237DEECEDE040007F0100697D--> <SEQNO><![CDATA[80]]></SEQNO> +<!--E084A90237DEECEDE040007F0100697D--> <SEQNO><![CDATA[70]]></SEQNO> <!--E084A90237DEECEDE040007F0100697D--> <ISSAMELINE><![CDATA[N]]></ISSAMELINE> <!--E084A90237DEECEDE040007F0100697D--> <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY> <!--E084A90237DEECEDE040007F0100697D--> <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED> @@ -298058,7 +298113,7 @@ <!--E631BD24883BDB56E040007F01002672--> <DISPLAYLOGIC><![CDATA[@isGeneric@='Y' & @Define_Price@='Y']]></DISPLAYLOGIC> <!--E631BD24883BDB56E040007F01002672--> <DISPLAYLENGTH><![CDATA[60]]></DISPLAYLENGTH> <!--E631BD24883BDB56E040007F01002672--> <ISREADONLY><![CDATA[N]]></ISREADONLY> -<!--E631BD24883BDB56E040007F01002672--> <SEQNO><![CDATA[70]]></SEQNO> +<!--E631BD24883BDB56E040007F01002672--> <SEQNO><![CDATA[60]]></SEQNO> <!--E631BD24883BDB56E040007F01002672--> <ISSAMELINE><![CDATA[N]]></ISSAMELINE> <!--E631BD24883BDB56E040007F01002672--> <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY> <!--E631BD24883BDB56E040007F01002672--> <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED> diff --git a/src-db/database/sourcedata/AD_TAB.xml b/src-db/database/sourcedata/AD_TAB.xml --- a/src-db/database/sourcedata/AD_TAB.xml +++ b/src-db/database/sourcedata/AD_TAB.xml @@ -16395,7 +16395,7 @@ <!--77B382924865466E8333415AAA1263CC--> <IMPORTFIELDS><![CDATA[N]]></IMPORTFIELDS> <!--77B382924865466E8333415AAA1263CC--> <ISSORTTAB><![CDATA[N]]></ISSORTTAB> <!--77B382924865466E8333415AAA1263CC--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID> -<!--77B382924865466E8333415AAA1263CC--> <UIPATTERN><![CDATA[SR]]></UIPATTERN> +<!--77B382924865466E8333415AAA1263CC--> <UIPATTERN><![CDATA[STD]]></UIPATTERN> <!--77B382924865466E8333415AAA1263CC--> <SHOWPARENTBUTTONS><![CDATA[Y]]></SHOWPARENTBUTTONS> <!--77B382924865466E8333415AAA1263CC--> <DISPLAYLOGIC><![CDATA[@IsGeneric@='Y']]></DISPLAYLOGIC> <!--77B382924865466E8333415AAA1263CC--> <DISABLE_PARENT_KEY_PROPERTY><![CDATA[N]]></DISABLE_PARENT_KEY_PROPERTY> diff --git a/src/org/openbravo/erpCommon/ad_callouts/SL_ProductCh_Characteristic.java b/src/org/openbravo/erpCommon/ad_callouts/SL_ProductCh_Characteristic.java --- a/src/org/openbravo/erpCommon/ad_callouts/SL_ProductCh_Characteristic.java +++ b/src/org/openbravo/erpCommon/ad_callouts/SL_ProductCh_Characteristic.java @@ -35,6 +35,7 @@ if (StringUtils.isNotBlank(strCharacteristicId)) { Characteristic ch = OBDal.getInstance().get(Characteristic.class, strCharacteristicId); info.addResult("inpisvariant", ch.isVariant() ? "Y" : "N"); + info.addResult("inpisexplodeconf", ch.isExplodeConfigurationTab() ? "Y" : "N"); } } diff --git a/src/org/openbravo/event/ProductCharacteristicEventHandler.java b/src/org/openbravo/event/ProductCharacteristicEventHandler.java --- a/src/org/openbravo/event/ProductCharacteristicEventHandler.java +++ b/src/org/openbravo/event/ProductCharacteristicEventHandler.java @@ -60,8 +60,7 @@ return entities; } - public void onDelete(@Observes - EntityDeleteEvent event) { + public void onDelete(@Observes EntityDeleteEvent event) { if (!isValidEvent(event)) { return; } @@ -73,8 +72,7 @@ deleteProductCharacteristicValue(prCh); } - public void onSave(@Observes - EntityNewEvent event) { + public void onSave(@Observes EntityNewEvent event) { if (!isValidEvent(event)) { return; } @@ -102,21 +100,22 @@ final Entity prodCharEntity = ModelProvider.getInstance().getEntity( ProductCharacteristic.ENTITY_NAME); - final Property charConfListProperty = prodCharEntity - .getProperty(ProductCharacteristic.PROPERTY_PRODUCTCHARACTERISTICCONFLIST); - @SuppressWarnings("unchecked") - List<ProductCharacteristicConf> prChConfs = (List<ProductCharacteristicConf>) event - .getCurrentState(charConfListProperty); - Set<String[]> newChValues = getValuesToAdd(prCh); - for (String[] strChValueId : newChValues) { - prChConfs - .add(getCharacteristicConf(prCh, strChValueId[0], strChValueId[1], strChValueId[2])); + if (prCh.isExplodeConfigurationTab()) { + final Property charConfListProperty = prodCharEntity + .getProperty(ProductCharacteristic.PROPERTY_PRODUCTCHARACTERISTICCONFLIST); + @SuppressWarnings("unchecked") + List<ProductCharacteristicConf> prChConfs = (List<ProductCharacteristicConf>) event + .getCurrentState(charConfListProperty); + Set<String[]> newChValues = getValuesToAdd(prCh); + for (String[] strChValueId : newChValues) { + prChConfs.add(getCharacteristicConf(prCh, strChValueId[0], strChValueId[1], + strChValueId[2])); + } } } } - public void onUpdate(@Observes - EntityUpdateEvent event) { + public void onUpdate(@Observes EntityUpdateEvent event) { if (!isValidEvent(event)) { return; } @@ -166,50 +165,55 @@ } } - final Property charConfListProperty = prodCharEntity - .getProperty(ProductCharacteristic.PROPERTY_PRODUCTCHARACTERISTICCONFLIST); - @SuppressWarnings("unchecked") - List<ProductCharacteristicConf> prChConfs = (List<ProductCharacteristicConf>) event - .getCurrentState(charConfListProperty); + if (prCh.isExplodeConfigurationTab()) { + final Property charConfListProperty = prodCharEntity + .getProperty(ProductCharacteristic.PROPERTY_PRODUCTCHARACTERISTICCONFLIST); + @SuppressWarnings("unchecked") + List<ProductCharacteristicConf> prChConfs = (List<ProductCharacteristicConf>) event + .getCurrentState(charConfListProperty); - final List<String> existingValues = new ArrayList<String>(); - for (ProductCharacteristicConf prChConf : prCh.getProductCharacteristicConfList()) { - existingValues.add((String) DalUtil.getId(prChConf.getCharacteristicValue())); - } - Set<String[]> valuesToAdd = getValuesToAdd(prCh); - for (String[] strNewValue : valuesToAdd) { - if (existingValues.remove(strNewValue[0])) { - OBCriteria<ProductCharacteristicConf> prChConfCrit = OBDal.getInstance().createCriteria( - ProductCharacteristicConf.class); - prChConfCrit.add(Restrictions.eq( - ProductCharacteristicConf.PROPERTY_CHARACTERISTICOFPRODUCT, prCh)); - prChConfCrit.add(Restrictions.eq(ProductCharacteristicConf.PROPERTY_CHARACTERISTICVALUE, - OBDal.getInstance().get(CharacteristicValue.class, strNewValue[0]))); - prChConfCrit.setFilterOnActive(false); - ProductCharacteristicConf prChConf = (ProductCharacteristicConf) prChConfCrit - .uniqueResult(); - prChConf.setCode(strNewValue[1]); - prChConf.setActive(Boolean.parseBoolean(strNewValue[2])); - OBDal.getInstance().save(prChConf); - continue; + final List<String> existingValues = new ArrayList<String>(); + for (ProductCharacteristicConf prChConf : prCh.getProductCharacteristicConfList()) { + existingValues.add((String) DalUtil.getId(prChConf.getCharacteristicValue())); } - prChConfs.add(getCharacteristicConf(prCh, strNewValue[0], strNewValue[1], strNewValue[2])); - } - // remove not needed - if (!existingValues.isEmpty()) { - for (String strChValueId : existingValues) { - OBCriteria<ProductCharacteristicConf> prChConfCrit = OBDal.getInstance().createCriteria( - ProductCharacteristicConf.class); - prChConfCrit.add(Restrictions.eq( - ProductCharacteristicConf.PROPERTY_CHARACTERISTICOFPRODUCT, prCh)); - prChConfCrit.add(Restrictions.eq(ProductCharacteristicConf.PROPERTY_CHARACTERISTICVALUE, - OBDal.getInstance().get(CharacteristicValue.class, strChValueId))); - prChConfCrit.setFilterOnActive(false); - ProductCharacteristicConf prChConf = (ProductCharacteristicConf) prChConfCrit - .uniqueResult(); + Set<String[]> valuesToAdd = getValuesToAdd(prCh); + for (String[] strNewValue : valuesToAdd) { + if (existingValues.remove(strNewValue[0])) { + OBCriteria<ProductCharacteristicConf> prChConfCrit = OBDal.getInstance() + .createCriteria(ProductCharacteristicConf.class); + prChConfCrit.add(Restrictions.eq( + ProductCharacteristicConf.PROPERTY_CHARACTERISTICOFPRODUCT, prCh)); + prChConfCrit.add(Restrictions.eq( + ProductCharacteristicConf.PROPERTY_CHARACTERISTICVALUE, + OBDal.getInstance().get(CharacteristicValue.class, strNewValue[0]))); + prChConfCrit.setFilterOnActive(false); + ProductCharacteristicConf prChConf = (ProductCharacteristicConf) prChConfCrit + .uniqueResult(); + prChConf.setCode(strNewValue[1]); + prChConf.setActive(Boolean.parseBoolean(strNewValue[2])); + OBDal.getInstance().save(prChConf); + continue; + } + prChConfs + .add(getCharacteristicConf(prCh, strNewValue[0], strNewValue[1], strNewValue[2])); + } + // remove not needed + if (!existingValues.isEmpty()) { + for (String strChValueId : existingValues) { + OBCriteria<ProductCharacteristicConf> prChConfCrit = OBDal.getInstance() + .createCriteria(ProductCharacteristicConf.class); + prChConfCrit.add(Restrictions.eq( + ProductCharacteristicConf.PROPERTY_CHARACTERISTICOFPRODUCT, prCh)); + prChConfCrit.add(Restrictions.eq( + ProductCharacteristicConf.PROPERTY_CHARACTERISTICVALUE, + OBDal.getInstance().get(CharacteristicValue.class, strChValueId))); + prChConfCrit.setFilterOnActive(false); + ProductCharacteristicConf prChConf = (ProductCharacteristicConf) prChConfCrit + .uniqueResult(); - prChConfs.remove(prChConf); - OBDal.getInstance().remove(prChConf); + prChConfs.remove(prChConf); + OBDal.getInstance().remove(prChConf); + } } } } testAddExplodeFlagToCharacteristics.diff [^] (42,102 bytes) 2015-11-05 12:00 [Show Content] [Hide Content] diff --git a/src-test/com/openbravo/test/integration/erp/data/masterdata/product/CharacteristicsData.java b/src-test/com/openbravo/test/integration/erp/data/masterdata/product/CharacteristicsData.java new file mode 100644 --- /dev/null +++ b/src-test/com/openbravo/test/integration/erp/data/masterdata/product/CharacteristicsData.java @@ -0,0 +1,125 @@ +/* + ************************************************************************* + * The contents of this file are subject to the Openbravo Public License + * Version 1.0 (the "License"), being the Mozilla Public License + * Version 1.1 with a permitted attribution clause; you may not use this + * file except in compliance with the License. You may obtain a copy of + * the License at http://www.openbravo.com/legal/license.html + * Software distributed under the License is distributed on an "AS IS" + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the + * License for the specific language governing rights and limitations + * under the License. + * The Original Code is Openbravo ERP. + * The Initial Developer of the Original Code is Openbravo S.L.U. + * All portions are Copyright (C) 2011-2012 Openbravo S.L.U. + * All Rights Reserved. + * + * This class was automatically generated on 2011-03-09 21:37:13 + * Contributor(s): + ************************************************************************* + */ + +package com.openbravo.test.integration.erp.data.masterdata.product; + +import java.util.LinkedHashMap; + +import com.openbravo.test.integration.erp.data.DataObject; + +/** + * + * Class for ProductData + * + * @author jbueno + * + */ +public class CharacteristicsData extends DataObject { + + /** + * Class builder + * + * @author jbueno + * + */ + public static class Builder { + + /** The data fields. */ + private LinkedHashMap<String, Object> dataFields = new LinkedHashMap<String, Object>(); + + /** + * Set the active value + * + * Description: A flag indicating whether this record is available for use or de-activated. + * + * @param value + * The active value. + * @return The builder for this class. + */ + public Builder active(Boolean value) { + this.dataFields.put("active", value); + return this; + } + + /** + * Set the characteristic value + * + * Description: A non-unique identifier for a record/document often used as a search tool. + * + * @param value + * The chracteristic value. + * @return The builder for this class. + */ + public Builder characteristic(String value) { + this.dataFields.put("characteristic", value); + return this; + } + + /** + * Set the variant value + * + * Description: A non-unique identifier for a record/document often used as a search tool. + * + * @param value + * The variant value. + * @return The builder for this class. + */ + public Builder variant(Boolean value) { + this.dataFields.put("variant", value); + return this; + } + + /** + * Set the explode configuration tab value + * + * Description: A non-unique identifier for a record/document often used as a search tool. + * + * @param value + * The variant value. + * @return The builder for this class. + */ + public Builder explode(Boolean value) { + this.dataFields.put("explodeConfigurationTab", value); + return this; + } + + /** + * Build the data object. + * + * @return The data object + */ + public CharacteristicsData build() { + return new CharacteristicsData(this); + } + + } + + /** + * Build the data object. + * + * @param builder + * The object builder + */ + private CharacteristicsData(Builder builder) { + dataFields = builder.dataFields; + } + +} diff --git a/src-test/com/openbravo/test/integration/erp/data/masterdata/product/ProductCharacteristicData.java b/src-test/com/openbravo/test/integration/erp/data/masterdata/product/ProductCharacteristicData.java new file mode 100644 --- /dev/null +++ b/src-test/com/openbravo/test/integration/erp/data/masterdata/product/ProductCharacteristicData.java @@ -0,0 +1,110 @@ +package com.openbravo.test.integration.erp.data.masterdata.product; + +import java.util.LinkedHashMap; + +import com.openbravo.test.integration.erp.data.DataObject; + +public class ProductCharacteristicData extends DataObject { + /** + * Class builder + * + * @author jbueno + * + */ + public static class Builder { + + /** The data fields. */ + private LinkedHashMap<String, Object> dataFields = new LinkedHashMap<String, Object>(); + + /** + * Set the active value + * + * Description: A flag indicating whether this record is available for use or de-activated. + * + * @param value + * The active value. + * @return The builder for this class. + */ + public Builder active(Boolean value) { + this.dataFields.put("active", value); + return this; + } + + /** + * Set the name value + * + * Description: A non-unique identifier for a record/document often used as a search tool. + * + * @param value + * The name value. + * @return The builder for this class. + */ + public Builder name(String value) { + this.dataFields.put("name", value); + return this; + } + + /** + * Set the description value + * + * Description: A space to write additional related information. + * + * @param value + * The description value. + * @return The builder for this class. + */ + public Builder description(String value) { + this.dataFields.put("description", value); + return this; + } + + /** + * Set the variant value + * + * Description: Checked if it is a variant characteristic. + * + * @param value + * The is variant value. + * @return The builder for this class. + */ + public Builder variant(Boolean value) { + this.dataFields.put("variant", value); + return this; + } + + /** + * Set the Explode configuration + * + * Description: Checked if the characteristic will explode with all its values + * + * @param value + * The explode configuration tab value. + * @return The builder for this class. + */ + public Builder explode(Boolean value) { + this.dataFields.put("explodeConfigurationTab", value); + return this; + } + + /** + * Build the data object. + * + * @return The data object + */ + public ProductCharacteristicData build() { + return new ProductCharacteristicData(this); + } + + } + + /** + * Build the data object. + * + * @param builder + * The object builder + */ + private ProductCharacteristicData(Builder builder) { + dataFields = builder.dataFields; + } + +} diff --git a/src-test/com/openbravo/test/integration/erp/data/masterdata/product/ProductCharacteristicValueData.java b/src-test/com/openbravo/test/integration/erp/data/masterdata/product/ProductCharacteristicValueData.java new file mode 100644 --- /dev/null +++ b/src-test/com/openbravo/test/integration/erp/data/masterdata/product/ProductCharacteristicValueData.java @@ -0,0 +1,82 @@ +package com.openbravo.test.integration.erp.data.masterdata.product; + +import java.util.LinkedHashMap; + +import com.openbravo.test.integration.erp.data.DataObject; + +public class ProductCharacteristicValueData extends DataObject { + /** + * Class builder + * + * @author jbueno + * + */ + public static class Builder { + + /** The data fields. */ + private LinkedHashMap<String, Object> dataFields = new LinkedHashMap<String, Object>(); + + /** + * Set the active value + * + * Description: A flag indicating whether this record is available for use or de-activated. + * + * @param value + * The active value. + * @return The builder for this class. + */ + public Builder active(Boolean value) { + this.dataFields.put("active", value); + return this; + } + + /** + * Set the name value + * + * Description: A non-unique identifier for a record/document often used as a search tool. + * + * @param value + * The name value. + * @return The builder for this class. + */ + public Builder name(String value) { + this.dataFields.put("name", value); + return this; + } + + /** + * Set the description value + * + * Description: A space to write additional related information. + * + * @param value + * The description value. + * @return The builder for this class. + */ + public Builder description(String value) { + this.dataFields.put("description", value); + return this; + } + + /** + * Build the data object. + * + * @return The data object + */ + public ProductCharacteristicValueData build() { + return new ProductCharacteristicValueData(this); + } + + } + + /** + * Build the data object. + * + * @param builder + * The object builder + */ + private ProductCharacteristicValueData(Builder builder) { + dataFields = builder.dataFields; + } + +} diff --git a/src-test/com/openbravo/test/integration/erp/data/masterdata/product/ProductData.java b/src-test/com/openbravo/test/integration/erp/data/masterdata/product/ProductData.java --- a/src-test/com/openbravo/test/integration/erp/data/masterdata/product/ProductData.java +++ b/src-test/com/openbravo/test/integration/erp/data/masterdata/product/ProductData.java @@ -285,6 +285,20 @@ } /** + * Set the is generic value + * + * Description: An indication that the product is a generic product. + * + * @param value + * True if it is a generic product, false in other case. + * @return The builder for this class. + */ + public Builder generic(Boolean value) { + this.dataFields.put("isGeneric", value); + return this; + } + + /** * Build the data object. * * @return The data object diff --git a/src-test/com/openbravo/test/integration/erp/gui/masterdata/product/CharacteristicsTab.java b/src-test/com/openbravo/test/integration/erp/gui/masterdata/product/CharacteristicsTab.java new file mode 100644 --- /dev/null +++ b/src-test/com/openbravo/test/integration/erp/gui/masterdata/product/CharacteristicsTab.java @@ -0,0 +1,44 @@ +/* + ************************************************************************* + * The contents of this file are subject to the Openbravo Public License + * Version 1.0 (the "License"), being the Mozilla Public License + * Version 1.1 with a permitted attribution clause; you may not use this + * file except in compliance with the License. You may obtain a copy of + * the License at http://www.openbravo.com/legal/license.html + * Software distributed under the License is distributed on an "AS IS" + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the + * License for the specific language governing rights and limitations + * under the License. + * The Original Code is Openbravo ERP. + * The Initial Developer of the Original Code is Openbravo S.L.U. + * All portions are Copyright (C) 2010-2015 Openbravo S.L.U. + * All Rights Reserved. + * Contributor(s): + * Jonathan Bueno <jonathan.bueno@openbravo.com>. + ************************************************************************ + */ + +package com.openbravo.test.integration.erp.gui.masterdata.product; + +import com.openbravo.test.integration.erp.data.masterdata.product.CharacteristicsData; +import com.openbravo.test.integration.erp.modules.client.application.gui.GeneratedTab; + +public class CharacteristicsTab extends GeneratedTab<CharacteristicsData> { + + /** The tab title. */ + static final String TITLE = "Characteristics"; + /** The tab identifier. */ + static final String IDENTIFIER = "769BB4BF6B0B4C39AD28E9A00D260F33"; + /** The tab level. */ + private static final int LEVEL = 1; + + /** + * Class constructor + * + */ + public CharacteristicsTab(GeneratedTab<?> parentTab) { + super(TITLE, IDENTIFIER, LEVEL, parentTab); + addChildTab(new ProductCharacteristicConfigurationTab(this)); + } + +} diff --git a/src-test/com/openbravo/test/integration/erp/gui/masterdata/product/ProductCharacteristicConfigurationTab.java b/src-test/com/openbravo/test/integration/erp/gui/masterdata/product/ProductCharacteristicConfigurationTab.java new file mode 100644 --- /dev/null +++ b/src-test/com/openbravo/test/integration/erp/gui/masterdata/product/ProductCharacteristicConfigurationTab.java @@ -0,0 +1,26 @@ +package com.openbravo.test.integration.erp.gui.masterdata.product; + +import com.openbravo.test.integration.erp.data.masterdata.product.ProductCharacteristicValueData; +import com.openbravo.test.integration.erp.modules.client.application.gui.GeneratedTab; + +/** + * Executes and verifies actions on OpenbravoERP Product Characteristic Configuration tab. + * + * @author jbueno + * + */ +public class ProductCharacteristicConfigurationTab extends + GeneratedTab<ProductCharacteristicValueData> { + + /** The tab title. */ + public static final String TITLE = "Characteristic Configuration"; + /** The tab identifier. */ + public static final String IDENTIFIER = "77B382924865466E8333415AAA1263CC"; + /** The tab level. */ + private static final int LEVEL = 2; + + public ProductCharacteristicConfigurationTab(GeneratedTab<?> parentTab) { + super(TITLE, IDENTIFIER, LEVEL, parentTab); + } + +} \ No newline at end of file diff --git a/src-test/com/openbravo/test/integration/erp/gui/masterdata/product/ProductCharacteristicTab.java b/src-test/com/openbravo/test/integration/erp/gui/masterdata/product/ProductCharacteristicTab.java new file mode 100644 --- /dev/null +++ b/src-test/com/openbravo/test/integration/erp/gui/masterdata/product/ProductCharacteristicTab.java @@ -0,0 +1,29 @@ +package com.openbravo.test.integration.erp.gui.masterdata.product; + +import com.openbravo.test.integration.erp.data.masterdata.product.ProductCharacteristicData; +import com.openbravo.test.integration.erp.modules.client.application.gui.GeneratedTab; + +/** + * Executes and verifies actions on OpenbravoERP Product tab. + * + * @author jbu + * + */ +public class ProductCharacteristicTab extends GeneratedTab<ProductCharacteristicData> { + + /** The tab title. */ + static final String TITLE = "Characteristics"; + /** The tab identifier. */ + static final String IDENTIFIER = "A661A0A05DCD4650BCB14B010C87F0AA"; + /** The tab level. */ + private static final int LEVEL = 0; + + /** + * Class constructor + * + */ + public ProductCharacteristicTab() { + super(TITLE, IDENTIFIER); + } + +} \ No newline at end of file diff --git a/src-test/com/openbravo/test/integration/erp/gui/masterdata/product/ProductCharacteristicValueTab.java b/src-test/com/openbravo/test/integration/erp/gui/masterdata/product/ProductCharacteristicValueTab.java new file mode 100644 --- /dev/null +++ b/src-test/com/openbravo/test/integration/erp/gui/masterdata/product/ProductCharacteristicValueTab.java @@ -0,0 +1,25 @@ +package com.openbravo.test.integration.erp.gui.masterdata.product; + +import com.openbravo.test.integration.erp.data.masterdata.product.ProductCharacteristicValueData; +import com.openbravo.test.integration.erp.modules.client.application.gui.GeneratedTab; + +/** + * Executes and verifies actions on OpenbravoERP Product Characteristic - Value tab. + * + * @author jbueno + * + */ +public class ProductCharacteristicValueTab extends GeneratedTab<ProductCharacteristicValueData> { + + /** The tab title. */ + static final String TITLE = "Value"; + /** The tab identifier. */ + static final String IDENTIFIER = "367D9DF685DA42A38CAE641D30A0BEBF"; + /** The tab level. */ + private static final int LEVEL = 1; + + public ProductCharacteristicValueTab(GeneratedTab<?> parentTab) { + super(TITLE, IDENTIFIER, LEVEL, parentTab); + } + +} \ No newline at end of file diff --git a/src-test/com/openbravo/test/integration/erp/gui/masterdata/product/ProductCharacteristicWindow.java b/src-test/com/openbravo/test/integration/erp/gui/masterdata/product/ProductCharacteristicWindow.java new file mode 100644 --- /dev/null +++ b/src-test/com/openbravo/test/integration/erp/gui/masterdata/product/ProductCharacteristicWindow.java @@ -0,0 +1,51 @@ +package com.openbravo.test.integration.erp.gui.masterdata.product; + +import com.openbravo.test.integration.erp.modules.client.application.gui.StandardWindow; +import com.openbravo.test.integration.erp.modules.client.application.navigationbarcomponents.gui.Menu; + +/** + * Executes and verifies actions on OpenbravoERP Product Characteristic window. + * + * @author jbueno + * + */ +public class ProductCharacteristicWindow extends StandardWindow { + /** The window title. */ + public static final String TITLE = "Product Characteristic"; + /** The window menu path. */ + private static final String[] MENU_PATH = new String[] { Menu.MASTER_DATA_MANAGEMENT, + Menu.PRODUCT_SETUP, Menu.PRODUCT_CHARACTERISTIC }; + + /** + * Class constructor. + */ + public ProductCharacteristicWindow() { + super(TITLE, MENU_PATH); + } + + @Override + public void load() { + ProductCharacteristicTab productTab = new ProductCharacteristicTab(); + addTopLevelTab(productTab); + super.load(); + } + + /** + * Select and return the Product Characteristic tab. + * + * @return the Product Characteristic tab. + */ + public ProductCharacteristicTab selectProductCharacteristicTab() { + return (ProductCharacteristicTab) selectTab(ProductCharacteristicTab.IDENTIFIER); + } + + /** + * Select and return the Product Characteristic Value tab. + * + * @return the Product Characteristic Valuetab. + */ + public ProductCharacteristicValueTab selectProductCharacteristicValueTab() { + return (ProductCharacteristicValueTab) selectTab(ProductCharacteristicValueTab.IDENTIFIER); + } + +} diff --git a/src-test/com/openbravo/test/integration/erp/gui/masterdata/product/ProductTab.java b/src-test/com/openbravo/test/integration/erp/gui/masterdata/product/ProductTab.java --- a/src-test/com/openbravo/test/integration/erp/gui/masterdata/product/ProductTab.java +++ b/src-test/com/openbravo/test/integration/erp/gui/masterdata/product/ProductTab.java @@ -45,6 +45,6 @@ public ProductTab() { super(TITLE, IDENTIFIER); addChildTab(new PriceTab(this)); + addChildTab(new CharacteristicsTab(this)); } - } diff --git a/src-test/com/openbravo/test/integration/erp/gui/masterdata/product/ProductWindow.java b/src-test/com/openbravo/test/integration/erp/gui/masterdata/product/ProductWindow.java --- a/src-test/com/openbravo/test/integration/erp/gui/masterdata/product/ProductWindow.java +++ b/src-test/com/openbravo/test/integration/erp/gui/masterdata/product/ProductWindow.java @@ -64,6 +64,15 @@ } /** + * Select and return the Characteristic tab. + * + * @return the Characteristic tab. + */ + public CharacteristicsTab selectCharacteristicsTab() { + return (CharacteristicsTab) selectTab(CharacteristicsTab.IDENTIFIER); + } + + /** * Select and return the Price tab. * * @return the Price tab. @@ -72,4 +81,13 @@ return (PriceTab) selectTab(PriceTab.IDENTIFIER); } + /** + * Select and return the Characteristic configuration tab. + * + * @return the Characteristic configuration tab. + */ + public ProductCharacteristicConfigurationTab selectCharacteristicConfigurationTab() { + return (ProductCharacteristicConfigurationTab) selectTab(ProductCharacteristicConfigurationTab.IDENTIFIER); + } + } diff --git a/src-test/com/openbravo/test/integration/erp/modules/client/application/navigationbarcomponents/gui/Menu.java b/src-test/com/openbravo/test/integration/erp/modules/client/application/navigationbarcomponents/gui/Menu.java --- a/src-test/com/openbravo/test/integration/erp/modules/client/application/navigationbarcomponents/gui/Menu.java +++ b/src-test/com/openbravo/test/integration/erp/modules/client/application/navigationbarcomponents/gui/Menu.java @@ -113,6 +113,9 @@ public static final String MASTER_DATA_MANAGEMENT = "Master Data Management"; /** Product menu item. */ + public static final String PRODUCT_CHARACTERISTIC = "Product Characteristic"; + + /** Product menu item. */ public static final String PRODUCT = "Product"; /** Business Partner menu item. */ diff --git a/src-test/com/openbravo/test/integration/erp/testscripts/masterdata/product/Product.java b/src-test/com/openbravo/test/integration/erp/testscripts/masterdata/product/Product.java --- a/src-test/com/openbravo/test/integration/erp/testscripts/masterdata/product/Product.java +++ b/src-test/com/openbravo/test/integration/erp/testscripts/masterdata/product/Product.java @@ -21,8 +21,12 @@ package com.openbravo.test.integration.erp.testscripts.masterdata.product; +import com.openbravo.test.integration.erp.data.masterdata.product.CharacteristicsData; import com.openbravo.test.integration.erp.data.masterdata.product.PriceData; import com.openbravo.test.integration.erp.data.masterdata.product.ProductData; +import com.openbravo.test.integration.erp.gui.masterdata.product.CharacteristicsTab; +import com.openbravo.test.integration.erp.gui.masterdata.product.ProductCharacteristicConfigurationTab; +import com.openbravo.test.integration.erp.gui.masterdata.product.ProductWindow; import com.openbravo.test.integration.erp.modules.client.application.gui.MainPage; /** @@ -59,6 +63,54 @@ } } + public static class ProductCharacteristicsValueTab { + + /** + * Creates the record. + * + * @param selenium + * Object used to execute actions on the application. + * @param mainPage + * The application main page. + * @param productData + * + */ + public static void create(MainPage mainPage, CharacteristicsData productData) { + if (mainPage.isOnNewLayout()) { + ProductScript.create(mainPage, productData); + } + } + + /** + * Delete some records. + * + * @param selenium + * Object used to execute actions on the application. + * @param mainPage + * The application main page. + * @param indexes + * The index of the record that will be deleted. + */ + public static void delete(MainPage mainPage) { + ProductWindow productWindow = new ProductWindow(); + mainPage.openView(productWindow); + + CharacteristicsTab productTab = productWindow.selectCharacteristicsTab(); + productTab.clearFilters(); + productTab.deleteMultipleRecordsOneCheckboxOnGrid(); + productTab.closeMessageIfVisible(); + } + + public static void select(MainPage mainPage, CharacteristicsData productData) { + final ProductWindow productPriceWindow = (ProductWindow) mainPage + .getView(ProductWindow.TITLE); + + CharacteristicsTab productTab = productPriceWindow.selectCharacteristicsTab(); + productTab.select(productData); + } + + } + /** * Executes and verifies actions on the tab. * @@ -85,4 +137,27 @@ } } } + + public static class CharacteristicsConfiguration { + + /** + * Creates the record. + * + * @param selenium + * Object used to execute actions on the application. + * @param mainPage + * The application main page. + * @param priceData + * + */ + public static void verifyCount(MainPage mainPage, int count) { + final ProductWindow productPriceWindow = (ProductWindow) mainPage + .getView(ProductWindow.TITLE); + ProductCharacteristicConfigurationTab productCCTab = productPriceWindow + .selectCharacteristicConfigurationTab(); + productCCTab.assertCount(count); + } + + } + } diff --git a/src-test/com/openbravo/test/integration/erp/testscripts/masterdata/product/ProductCharacteristic.java b/src-test/com/openbravo/test/integration/erp/testscripts/masterdata/product/ProductCharacteristic.java new file mode 100644 --- /dev/null +++ b/src-test/com/openbravo/test/integration/erp/testscripts/masterdata/product/ProductCharacteristic.java @@ -0,0 +1,73 @@ +/* + ************************************************************************* + * The contents of this file are subject to the Openbravo Public License + * Version 1.0 (the "License"), being the Mozilla Public License + * Version 1.1 with a permitted attribution clause; you may not use this + * file except in compliance with the License. You may obtain a copy of + * the License at http://www.openbravo.com/legal/license.html + * Software distributed under the License is distributed on an "AS IS" + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the + * License for the specific language governing rights and limitations + * under the License. + * The Original Code is Openbravo ERP. + * The Initial Developer of the Original Code is Openbravo S.L.U. + * All portions are Copyright (C) 2009-2015 Openbravo S.L.U. + * All Rights Reserved. + * Contributor(s): + * Jonathan Bueno <jonathan.bueno@openbravo.com>, + ************************************************************************ + */ + +package com.openbravo.test.integration.erp.testscripts.masterdata.product; + +import com.openbravo.test.integration.erp.data.masterdata.product.ProductCharacteristicData; +import com.openbravo.test.integration.erp.data.masterdata.product.ProductCharacteristicValueData; +import com.openbravo.test.integration.erp.modules.client.application.gui.MainPage; + +/** + * Executes and verifies actions on the window. + * + * @author jbueno + */ +public class ProductCharacteristic { + + public static class ProductCharacteristicsTab { + + /** + * Creates the record. + * + * @param selenium + * Object used to execute actions on the application. + * @param mainPage + * The application main page. + * @param productCharacteristicValueData + * + */ + public static void create(MainPage mainPage, ProductCharacteristicData productCharacteristicData) { + if (mainPage.isOnNewLayout()) { + ProductCharacteristicScript.create(mainPage, productCharacteristicData); + } + } + } + + public static class ProductCharacteristicValueTab { + + /** + * Creates the record. + * + * @param selenium + * Object used to execute actions on the application. + * @param mainPage + * The application main page. + * @param productData + * + */ + public static void create(MainPage mainPage, + ProductCharacteristicValueData productCharacteristicValueData) { + if (mainPage.isOnNewLayout()) { + ProductCharacteristicScript.create(mainPage, productCharacteristicValueData); + } + } + } + +} diff --git a/src-test/com/openbravo/test/integration/erp/testscripts/masterdata/product/ProductCharacteristicScript.java b/src-test/com/openbravo/test/integration/erp/testscripts/masterdata/product/ProductCharacteristicScript.java new file mode 100644 --- /dev/null +++ b/src-test/com/openbravo/test/integration/erp/testscripts/masterdata/product/ProductCharacteristicScript.java @@ -0,0 +1,78 @@ +/* + ************************************************************************* + * The contents of this file are subject to the Openbravo Public License + * Version 1.0 (the "License"), being the Mozilla Public License + * Version 1.1 with a permitted attribution clause; you may not use this + * file except in compliance with the License. You may obtain a copy of + * the License at http://www.openbravo.com/legal/license.html + * Software distributed under the License is distributed on an "AS IS" + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the + * License for the specific language governing rights and limitations + * under the License. + * The Original Code is Openbravo ERP. + * The Initial Developer of the Original Code is Openbravo S.L.U. + * All portions are Copyright (C) 2010-2015 Openbravo S.L.U. + * All Rights Reserved. + * Contributor(s): + * Jonathan Bueno <jonathan.bueno@openbravo.com> + ************************************************************************ + */ + +package com.openbravo.test.integration.erp.testscripts.masterdata.product; + +import com.openbravo.test.integration.erp.data.masterdata.product.ProductCharacteristicData; +import com.openbravo.test.integration.erp.data.masterdata.product.ProductCharacteristicValueData; +import com.openbravo.test.integration.erp.gui.masterdata.product.ProductCharacteristicTab; +import com.openbravo.test.integration.erp.gui.masterdata.product.ProductCharacteristicValueTab; +import com.openbravo.test.integration.erp.gui.masterdata.product.ProductCharacteristicWindow; +import com.openbravo.test.integration.erp.modules.client.application.gui.MainPage; + +/** + * Executes and verifies actions on the Product Characteristic tab of OpenbravoERP. + * + * @author jbueno + * + */ +class ProductCharacteristicScript { + + /** + * Create a record. + * + * @param selenium + * Object used to execute actions on the application. + * @param mainPage + * The application main page. + * @param data + * The data of the record that will be created. + */ + static void create(MainPage mainPage, ProductCharacteristicData data) { + ProductCharacteristicWindow productCharacteristicWindow = new ProductCharacteristicWindow(); + mainPage.openView(productCharacteristicWindow); + + ProductCharacteristicTab productCharacteristicTab = productCharacteristicWindow + .selectProductCharacteristicTab(); + productCharacteristicTab.createRecord(data); + productCharacteristicTab.assertSaved(); + } + + /** + * Create a record. + * + * @param selenium + * Object used to execute actions on the application. + * @param mainPage + * The application main page. + * @param data + * The data of the record that will be created. + */ + static void create(MainPage mainPage, ProductCharacteristicValueData data) { + ProductCharacteristicWindow productCharacteristicWindow = new ProductCharacteristicWindow(); + mainPage.openView(productCharacteristicWindow); + + ProductCharacteristicValueTab productCharacteristicValueTab = productCharacteristicWindow + .selectProductCharacteristicValueTab(); + productCharacteristicValueTab.createRecord(data); + productCharacteristicValueTab.assertSaved(); + } + +} diff --git a/src-test/com/openbravo/test/integration/erp/testscripts/masterdata/product/ProductScript.java b/src-test/com/openbravo/test/integration/erp/testscripts/masterdata/product/ProductScript.java --- a/src-test/com/openbravo/test/integration/erp/testscripts/masterdata/product/ProductScript.java +++ b/src-test/com/openbravo/test/integration/erp/testscripts/masterdata/product/ProductScript.java @@ -21,7 +21,10 @@ package com.openbravo.test.integration.erp.testscripts.masterdata.product; +import com.openbravo.test.integration.erp.data.masterdata.product.CharacteristicsData; import com.openbravo.test.integration.erp.data.masterdata.product.ProductData; +import com.openbravo.test.integration.erp.gui.masterdata.product.CharacteristicsTab; +import com.openbravo.test.integration.erp.gui.masterdata.product.ProductCharacteristicConfigurationTab; import com.openbravo.test.integration.erp.gui.masterdata.product.ProductTab; import com.openbravo.test.integration.erp.gui.masterdata.product.ProductWindow; import com.openbravo.test.integration.erp.modules.client.application.gui.MainPage; @@ -53,4 +56,42 @@ productTab.assertSaved(); } + /** + * Create a record. + * + * @param selenium + * Object used to execute actions on the application. + * @param mainPage + * The application main page. + * @param data + * The data of the record that will be created. + */ + static void create(MainPage mainPage, CharacteristicsData data) { + ProductWindow productWindow = new ProductWindow(); + mainPage.openView(productWindow); + + CharacteristicsTab productTab = productWindow.selectCharacteristicsTab(); + productTab.createRecord(data); + productTab.assertSaved(); + } + + /** + * Check number of records in tab. + * + * @param selenium + * Object used to execute actions on the application. + * @param mainPage + * The application main page. + * @param count + * The amount of records that must exist. + */ + static void verifyRecordNumber(MainPage mainPage, int count) { + ProductWindow productWindow = new ProductWindow(); + mainPage.openView(productWindow); + + ProductCharacteristicConfigurationTab productTab = productWindow + .selectCharacteristicConfigurationTab(); + productTab.assertCount(count); + } + } diff --git a/src-test/com/openbravo/test/integration/erp/testsuites/smoke/masterdata/AddExplodeFlagToCharacteristics.java b/src-test/com/openbravo/test/integration/erp/testsuites/smoke/masterdata/AddExplodeFlagToCharacteristics.java new file mode 100644 --- /dev/null +++ b/src-test/com/openbravo/test/integration/erp/testsuites/smoke/masterdata/AddExplodeFlagToCharacteristics.java @@ -0,0 +1,168 @@ +/* + ************************************************************************* + * The contents of this file are subject to the Openbravo Public License + * Version 1.0 (the "License"), being the Mozilla Public License + * Version 1.1 with a permitted attribution clause; you may not use this + * file except in compliance with the License. You may obtain a copy of + * the License at http://www.openbravo.com/legal/license.html + * Software distributed under the License is distributed on an "AS IS" + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the + * License for the specific language governing rights and limitations + * under the License. + * The Original Code is Openbravo ERP. + * The Initial Developer of the Original Code is Openbravo S.L.U. + * All portions are Copyright (C) 2010-2015 Openbravo S.L.U. + * All Rights Reserved. + * Contributor(s): + * Jonathan Bueno <jonathan.bueno@openbravo.com>. + ************************************************************************ + */ + +package com.openbravo.test.integration.erp.testsuites.smoke.masterdata; + +import java.io.IOException; +import java.util.Arrays; +import java.util.Collection; + +import org.apache.log4j.Logger; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; +import org.junit.runners.Parameterized.Parameters; + +import com.openbravo.test.integration.erp.data.LogInData; +import com.openbravo.test.integration.erp.data.masterdata.product.CharacteristicsData; +import com.openbravo.test.integration.erp.data.masterdata.product.ProductCharacteristicData; +import com.openbravo.test.integration.erp.data.masterdata.product.ProductCharacteristicValueData; +import com.openbravo.test.integration.erp.data.masterdata.product.ProductData; +import com.openbravo.test.integration.erp.testscripts.OpenbravoERPTest; +import com.openbravo.test.integration.erp.testscripts.OpenbravoERPTestException; +import com.openbravo.test.integration.erp.testscripts.masterdata.product.Product; +import com.openbravo.test.integration.erp.testscripts.masterdata.product.ProductCharacteristic; + +/** + * Execute the Setup User and Role flow of the smoke test suite. + * + * @author JBU + */ +@RunWith(Parameterized.class) +public class AddExplodeFlagToCharacteristics extends OpenbravoERPTest { + + /** Log4j logger for this class. */ + private static Logger logger = Logger.getLogger(AddExplodeFlagToCharacteristics.class); + + /* Data for this test. */ + + private ProductData productData; + private ProductCharacteristicValueData productCharacteristicValueData; + private ProductCharacteristicValueData productCharacteristicValueData2; + private ProductCharacteristicData productCharacteristicData; + private ProductCharacteristicData productCharacteristicData2; + private CharacteristicsData characteristicsData; + private CharacteristicsData characteristicsData2; + private CharacteristicsData characteristicsData3; + private CharacteristicsData characteristicsData4; + + /** + * Class constructor. + */ + public AddExplodeFlagToCharacteristics(ProductCharacteristicData productCharacteristicData, + ProductCharacteristicValueData productCharacteristicValueData, + ProductCharacteristicValueData productCharacteristicValueData2, + ProductCharacteristicData productCharacteristicData2, ProductData productData, + CharacteristicsData characteristicsData, CharacteristicsData characteristicsData2, + CharacteristicsData characteristicsData3, CharacteristicsData characteristicsData4) { + + this.productData = productData; + this.productCharacteristicValueData = productCharacteristicValueData; + this.productCharacteristicValueData2 = productCharacteristicValueData2; + this.productCharacteristicData = productCharacteristicData; + this.productCharacteristicData2 = productCharacteristicData2; + this.characteristicsData = characteristicsData; + this.characteristicsData2 = characteristicsData2; + this.characteristicsData3 = characteristicsData3; + this.characteristicsData4 = characteristicsData4; + + logInData = new LogInData.Builder().userName("QAAdmin").password("QAAdmin").build(); + } + + /** + * Test parameters. + * + * @return collection of object arrays with data for the test + * @throws IOException + * + */ + @Parameters + public static Collection<Object[]> setupProductValues() throws IOException { + return Arrays.asList(new Object[][] { { + + // Create a Product + new ProductCharacteristicData.Builder().name("Explode Characteristic").active(true) + .variant(true).explode(true).build(), + new ProductCharacteristicValueData.Builder().name("Value1").build(), + new ProductCharacteristicValueData.Builder().name("Value2").build(), + new ProductCharacteristicData.Builder().name("No Explode Characteristic").active(true) + .variant(true).explode(false).build(), + new ProductData.Builder().searchKey("ECTTP").name("Explode config tab test product") + .productCategory("Services").uOM("Unit").productType("Item").purchase(true).sale(true) + .taxCategory("VAT 3%").generic(true).build(), + new CharacteristicsData.Builder().characteristic("Explode Characteristic").variant(true) + .build(), + new CharacteristicsData.Builder().characteristic("No Explode Characteristic").variant(true) + .build(), + new CharacteristicsData.Builder().characteristic("No Explode Characteristic").variant(true) + .explode(true).build(), + new CharacteristicsData.Builder().characteristic("Explode Characteristic").variant(true) + .explode(false).build() } }); + + } + + /** + * Test the setup client and organization flow. + * + * @throws IOException + * @throws OpenbravoERPTestException + */ + @Test + public void testExplodeFlagInCharacteristics() throws IOException, OpenbravoERPTestException { + logger.info("** Test explode config flag **"); + ProductCharacteristic.ProductCharacteristicsTab.create(mainPage, productCharacteristicData); + ProductCharacteristic.ProductCharacteristicValueTab.create(mainPage, + productCharacteristicValueData); + ProductCharacteristic.ProductCharacteristicValueTab.create(mainPage, + productCharacteristicValueData2); + ProductCharacteristic.ProductCharacteristicsTab.create(mainPage, productCharacteristicData2); + ProductCharacteristic.ProductCharacteristicValueTab.create(mainPage, + productCharacteristicValueData); + ProductCharacteristic.ProductCharacteristicValueTab.create(mainPage, + productCharacteristicValueData2); + Product.ProductTab.create(mainPage, productData); + // Assign "Explode characteristic" to product + Product.ProductCharacteristicsValueTab.create(mainPage, characteristicsData); + Product.ProductCharacteristicsValueTab.select(mainPage, characteristicsData); + // Check that values have exploded + Product.CharacteristicsConfiguration.verifyCount(mainPage, 2); + + // Assign "No Explode characteristic" to product + Product.ProductCharacteristicsValueTab.create(mainPage, characteristicsData2); + Product.ProductCharacteristicsValueTab.select(mainPage, characteristicsData2); + // Check that values have not exploded + Product.CharacteristicsConfiguration.verifyCount(mainPage, 0); + // Delete characteristics assigned to product + Product.ProductCharacteristicsValueTab.delete(mainPage); + // Assign "No Explode characteristic" (Explode ->True)to product + Product.ProductCharacteristicsValueTab.create(mainPage, characteristicsData3); + + Product.ProductCharacteristicsValueTab.select(mainPage, characteristicsData3); + // Check that values have exploded + Product.CharacteristicsConfiguration.verifyCount(mainPage, 2); + + // Assign "Explode characteristic" (Explode ->False)to product + Product.ProductCharacteristicsValueTab.create(mainPage, characteristicsData4); + Product.ProductCharacteristicsValueTab.select(mainPage, characteristicsData4); + // Check that values have not exploded + Product.CharacteristicsConfiguration.verifyCount(mainPage, 0); + + } +} | |||||||
Relationships [ Relation Graph ] [ Dependency Graph ] | |||||||||||||||||
|
Notes | |
(0081493) gorkaion (developer) 2015-11-05 09:58 |
Test cases in Test Link in suite: 3.0 Test Suite -> Functional Team -> Product Characteristics Tests PC040 and PC050 |
(0081738) hgbot (developer) 2015-11-12 10:22 |
Repository: erp/devel/pi Changeset: eca7d0102a7e9f59bfea63e233625949dfe5316b Author: Jonathan Bueno <jonathan.bueno <at> openbravo.com> Date: Thu Nov 12 10:20:59 2015 +0100 URL: http://code.openbravo.com/erp/devel/pi/rev/eca7d0102a7e9f59bfea63e233625949dfe5316b [^] Fixed issue 30721. Fixed issue 30724 Now is possible to insert or delete records in product characteristic configuration tab. When a variant characteristic is added to a generic product all its values are copied in the configuration tab. --- M src-db/database/model/tables/M_CHARACTERISTIC.xml M src-db/database/model/tables/M_PRODUCT_CH.xml M src-db/database/model/tables/M_PRODUCT_CH_CONF.xml M src-db/database/model/triggers/M_CH_SUBSET_VALUE_TRG.xml M src-db/database/model/triggers/M_CH_VALUE_TRG.xml M src-db/database/sourcedata/AD_COLUMN.xml M src-db/database/sourcedata/AD_ELEMENT.xml M src-db/database/sourcedata/AD_FIELD.xml M src-db/database/sourcedata/AD_TAB.xml M src/org/openbravo/erpCommon/ad_callouts/SL_ProductCh_Characteristic.java M src/org/openbravo/event/ProductCharacteristicEventHandler.java --- |
(0081756) dmiguelez (developer) 2015-11-12 13:25 |
Code Review + Testing done |
(0082203) hudsonbot (developer) 2015-11-23 21:17 |
A changeset related to this issue has been promoted main and to the Central Repository, after passing a series of tests. Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/7b56bebaaa88 [^] Maturity status: Test |
Issue History | |||
Date Modified | Username | Field | Change |
2015-09-01 17:24 | gorkaion | New Issue | |
2015-09-01 17:24 | gorkaion | Assigned To | => gorkaion |
2015-09-01 17:24 | gorkaion | Modules | => Core |
2015-09-01 17:24 | gorkaion | Triggers an Emergency Pack | => No |
2015-09-01 17:25 | gorkaion | Relationship added | depends on 0030721 |
2015-09-01 17:39 | gorkaion | Relationship added | blocks 0030726 |
2015-09-03 13:12 | gorkaion | File Added: issues-30721-30724-isexplodeflag-rev-496c8deb9c51.diff | |
2015-11-05 09:47 | jonibc | File Added: testAddExplodeFlagToCharacteristics.diff | |
2015-11-05 09:58 | gorkaion | Note Added: 0081493 | |
2015-11-05 11:59 | jonibc | File Deleted: testAddExplodeFlagToCharacteristics.diff | |
2015-11-05 12:00 | jonibc | File Added: testAddExplodeFlagToCharacteristics.diff | |
2015-11-12 10:22 | hgbot | Checkin | |
2015-11-12 10:22 | hgbot | Note Added: 0081738 | |
2015-11-12 10:22 | hgbot | Status | new => resolved |
2015-11-12 10:22 | hgbot | Resolution | open => fixed |
2015-11-12 10:22 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/erp/devel/pi/rev/eca7d0102a7e9f59bfea63e233625949dfe5316b [^] |
2015-11-12 13:25 | dmiguelez | Review Assigned To | => dmiguelez |
2015-11-12 13:25 | dmiguelez | Note Added: 0081756 | |
2015-11-12 13:25 | dmiguelez | Status | resolved => closed |
2015-11-23 21:17 | hudsonbot | Checkin | |
2015-11-23 21:17 | hudsonbot | Note Added: 0082203 |
Copyright © 2000 - 2009 MantisBT Group |