Fixed issue 24754.Add pricelist type field and unify processes.
authorGorka Ion Damián <gorkaion.damian@openbravo.com>
Thu, 12 Sep 2013 17:49:00 +0200
changeset 21118 8a7b99723b7b
parent 21117 e2ec63c13ec4
child 21119 74a1c5d100ae
Fixed issue 24754.Add pricelist type field and unify processes.
src-db/database/model/tables/M_PRODUCT_CH.xml
src-db/database/sourcedata/AD_COLUMN.xml
src-db/database/sourcedata/AD_ELEMENT.xml
src-db/database/sourcedata/AD_FIELD.xml
src-db/database/sourcedata/AD_MESSAGE.xml
src-db/database/sourcedata/AD_REFERENCE.xml
src-db/database/sourcedata/AD_REF_LIST.xml
src/org/openbravo/materialmgmt/VariantAutomaticGenerationProcess.java
src/org/openbravo/materialmgmt/actionhandler/ManageVariants.java
--- a/src-db/database/model/tables/M_PRODUCT_CH.xml	Thu Sep 12 17:09:58 2013 +0200
+++ b/src-db/database/model/tables/M_PRODUCT_CH.xml	Thu Sep 12 17:49:00 2013 +0200
@@ -61,6 +61,10 @@
         <default><![CDATA[N]]></default>
         <onCreateDefault><![CDATA['N']]></onCreateDefault>
       </column>
+      <column name="PRICELIST_TYPE" primaryKey="false" required="true" type="VARCHAR" size="60" autoIncrement="false">
+        <default><![CDATA[SALES]]></default>
+        <onCreateDefault><![CDATA['ALL']]></onCreateDefault>
+      </column>
       <foreign-key foreignTable="AD_CLIENT" name="M_PRODUCT_CH_AD_CLIENT">
         <reference local="AD_CLIENT_ID" foreign="AD_CLIENT_ID"/>
       </foreign-key>
--- a/src-db/database/sourcedata/AD_COLUMN.xml	Thu Sep 12 17:09:58 2013 +0200
+++ b/src-db/database/sourcedata/AD_COLUMN.xml	Thu Sep 12 17:49:00 2013 +0200
@@ -316221,7 +316221,7 @@
 <!--E084A90237CAECEDE040007F0100697D-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--E084A90237CAECEDE040007F0100697D-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--E084A90237CAECEDE040007F0100697D-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--E084A90237CAECEDE040007F0100697D-->  <POSITION><![CDATA[16]]></POSITION>
+<!--E084A90237CAECEDE040007F0100697D-->  <POSITION><![CDATA[15]]></POSITION>
 <!--E084A90237CAECEDE040007F0100697D-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--E084A90237CAECEDE040007F0100697D-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--E084A90237CAECEDE040007F0100697D-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -317118,6 +317118,41 @@
 <!--E59D4BB7F1C342619CB4131FE4888FFA-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
 <!--E59D4BB7F1C342619CB4131FE4888FFA--></AD_COLUMN>
 
+<!--E631C21ED303AC60E040007F01002676--><AD_COLUMN>
+<!--E631C21ED303AC60E040007F01002676-->  <AD_COLUMN_ID><![CDATA[E631C21ED303AC60E040007F01002676]]></AD_COLUMN_ID>
+<!--E631C21ED303AC60E040007F01002676-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--E631C21ED303AC60E040007F01002676-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--E631C21ED303AC60E040007F01002676-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--E631C21ED303AC60E040007F01002676-->  <NAME><![CDATA[Price List Type]]></NAME>
+<!--E631C21ED303AC60E040007F01002676-->  <COLUMNNAME><![CDATA[Pricelist_Type]]></COLUMNNAME>
+<!--E631C21ED303AC60E040007F01002676-->  <AD_TABLE_ID><![CDATA[8E4A6598CA2747B6B0E7257C6F3DEB19]]></AD_TABLE_ID>
+<!--E631C21ED303AC60E040007F01002676-->  <AD_REFERENCE_ID><![CDATA[17]]></AD_REFERENCE_ID>
+<!--E631C21ED303AC60E040007F01002676-->  <AD_REFERENCE_VALUE_ID><![CDATA[7A55F24E10FD467EA8436DFE32D2C368]]></AD_REFERENCE_VALUE_ID>
+<!--E631C21ED303AC60E040007F01002676-->  <FIELDLENGTH><![CDATA[60]]></FIELDLENGTH>
+<!--E631C21ED303AC60E040007F01002676-->  <DEFAULTVALUE><![CDATA[SALES]]></DEFAULTVALUE>
+<!--E631C21ED303AC60E040007F01002676-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--E631C21ED303AC60E040007F01002676-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--E631C21ED303AC60E040007F01002676-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--E631C21ED303AC60E040007F01002676-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--E631C21ED303AC60E040007F01002676-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--E631C21ED303AC60E040007F01002676-->  <SEQNO><![CDATA[180]]></SEQNO>
+<!--E631C21ED303AC60E040007F01002676-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--E631C21ED303AC60E040007F01002676-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--E631C21ED303AC60E040007F01002676-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--E631C21ED303AC60E040007F01002676-->  <AD_ELEMENT_ID><![CDATA[E631C8FF94BDAF52E040007F0100263B]]></AD_ELEMENT_ID>
+<!--E631C21ED303AC60E040007F01002676-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--E631C21ED303AC60E040007F01002676-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--E631C21ED303AC60E040007F01002676-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--E631C21ED303AC60E040007F01002676-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--E631C21ED303AC60E040007F01002676-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--E631C21ED303AC60E040007F01002676-->  <POSITION><![CDATA[16]]></POSITION>
+<!--E631C21ED303AC60E040007F01002676-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--E631C21ED303AC60E040007F01002676-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--E631C21ED303AC60E040007F01002676-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--E631C21ED303AC60E040007F01002676-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--E631C21ED303AC60E040007F01002676-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--E631C21ED303AC60E040007F01002676--></AD_COLUMN>
+
 <!--E644E732A207448EAB7CBE80D616AB6F--><AD_COLUMN>
 <!--E644E732A207448EAB7CBE80D616AB6F-->  <AD_COLUMN_ID><![CDATA[E644E732A207448EAB7CBE80D616AB6F]]></AD_COLUMN_ID>
 <!--E644E732A207448EAB7CBE80D616AB6F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_ELEMENT.xml	Thu Sep 12 17:09:58 2013 +0200
+++ b/src-db/database/sourcedata/AD_ELEMENT.xml	Thu Sep 12 17:49:00 2013 +0200
@@ -31379,6 +31379,18 @@
 <!--E5702FB7A0A14BF782A5723A131B8F8C-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
 <!--E5702FB7A0A14BF782A5723A131B8F8C--></AD_ELEMENT>
 
+<!--E631C8FF94BDAF52E040007F0100263B--><AD_ELEMENT>
+<!--E631C8FF94BDAF52E040007F0100263B-->  <AD_ELEMENT_ID><![CDATA[E631C8FF94BDAF52E040007F0100263B]]></AD_ELEMENT_ID>
+<!--E631C8FF94BDAF52E040007F0100263B-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--E631C8FF94BDAF52E040007F0100263B-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--E631C8FF94BDAF52E040007F0100263B-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--E631C8FF94BDAF52E040007F0100263B-->  <COLUMNNAME><![CDATA[Pricelist_Type]]></COLUMNNAME>
+<!--E631C8FF94BDAF52E040007F0100263B-->  <NAME><![CDATA[Price List Type]]></NAME>
+<!--E631C8FF94BDAF52E040007F0100263B-->  <PRINTNAME><![CDATA[Price List Type]]></PRINTNAME>
+<!--E631C8FF94BDAF52E040007F0100263B-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--E631C8FF94BDAF52E040007F0100263B-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
+<!--E631C8FF94BDAF52E040007F0100263B--></AD_ELEMENT>
+
 <!--E7D1B98BBBDD491E9AF666B510D61188--><AD_ELEMENT>
 <!--E7D1B98BBBDD491E9AF666B510D61188-->  <AD_ELEMENT_ID><![CDATA[E7D1B98BBBDD491E9AF666B510D61188]]></AD_ELEMENT_ID>
 <!--E7D1B98BBBDD491E9AF666B510D61188-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_FIELD.xml	Thu Sep 12 17:09:58 2013 +0200
+++ b/src-db/database/sourcedata/AD_FIELD.xml	Thu Sep 12 17:49:00 2013 +0200
@@ -270175,7 +270175,7 @@
 <!--D9E9D213D42EB578E040007F010015CC-->  <DISPLAYLOGIC><![CDATA[@isGeneric@='Y']]></DISPLAYLOGIC>
 <!--D9E9D213D42EB578E040007F010015CC-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
 <!--D9E9D213D42EB578E040007F010015CC-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
-<!--D9E9D213D42EB578E040007F010015CC-->  <SEQNO><![CDATA[80]]></SEQNO>
+<!--D9E9D213D42EB578E040007F010015CC-->  <SEQNO><![CDATA[90]]></SEQNO>
 <!--D9E9D213D42EB578E040007F010015CC-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
 <!--D9E9D213D42EB578E040007F010015CC-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
 <!--D9E9D213D42EB578E040007F010015CC-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
@@ -273000,7 +273000,7 @@
 <!--E084A90237DEECEDE040007F0100697D-->  <DISPLAYLOGIC><![CDATA[@isGeneric@='Y']]></DISPLAYLOGIC>
 <!--E084A90237DEECEDE040007F0100697D-->  <DISPLAYLENGTH><![CDATA[1]]></DISPLAYLENGTH>
 <!--E084A90237DEECEDE040007F0100697D-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
-<!--E084A90237DEECEDE040007F0100697D-->  <SEQNO><![CDATA[70]]></SEQNO>
+<!--E084A90237DEECEDE040007F0100697D-->  <SEQNO><![CDATA[80]]></SEQNO>
 <!--E084A90237DEECEDE040007F0100697D-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
 <!--E084A90237DEECEDE040007F0100697D-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
 <!--E084A90237DEECEDE040007F0100697D-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
@@ -274230,6 +274230,33 @@
 <!--E631ADB38CF6400BA9EC80FA38CABC51-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--E631ADB38CF6400BA9EC80FA38CABC51--></AD_FIELD>
 
+<!--E631BD24883BDB56E040007F01002672--><AD_FIELD>
+<!--E631BD24883BDB56E040007F01002672-->  <AD_FIELD_ID><![CDATA[E631BD24883BDB56E040007F01002672]]></AD_FIELD_ID>
+<!--E631BD24883BDB56E040007F01002672-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--E631BD24883BDB56E040007F01002672-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--E631BD24883BDB56E040007F01002672-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--E631BD24883BDB56E040007F01002672-->  <NAME><![CDATA[Price List Type]]></NAME>
+<!--E631BD24883BDB56E040007F01002672-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--E631BD24883BDB56E040007F01002672-->  <AD_TAB_ID><![CDATA[769BB4BF6B0B4C39AD28E9A00D260F33]]></AD_TAB_ID>
+<!--E631BD24883BDB56E040007F01002672-->  <AD_COLUMN_ID><![CDATA[E631C21ED303AC60E040007F01002676]]></AD_COLUMN_ID>
+<!--E631BD24883BDB56E040007F01002672-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--E631BD24883BDB56E040007F01002672-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--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-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--E631BD24883BDB56E040007F01002672-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--E631BD24883BDB56E040007F01002672-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--E631BD24883BDB56E040007F01002672-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--E631BD24883BDB56E040007F01002672-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--E631BD24883BDB56E040007F01002672-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--E631BD24883BDB56E040007F01002672-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--E631BD24883BDB56E040007F01002672-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--E631BD24883BDB56E040007F01002672-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--E631BD24883BDB56E040007F01002672-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--E631BD24883BDB56E040007F01002672--></AD_FIELD>
+
 <!--E650C949221B4DB4B75054E6D42685B1--><AD_FIELD>
 <!--E650C949221B4DB4B75054E6D42685B1-->  <AD_FIELD_ID><![CDATA[E650C949221B4DB4B75054E6D42685B1]]></AD_FIELD_ID>
 <!--E650C949221B4DB4B75054E6D42685B1-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_MESSAGE.xml	Thu Sep 12 17:09:58 2013 +0200
+++ b/src-db/database/sourcedata/AD_MESSAGE.xml	Thu Sep 12 17:49:00 2013 +0200
@@ -24060,18 +24060,6 @@
 <!--E2C2CBA4C17D4F9AA5F130ACE83D39E5-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
 <!--E2C2CBA4C17D4F9AA5F130ACE83D39E5--></AD_MESSAGE>
 
-<!--E2C33EF7954C4EB5ADA169E00EF93F99--><AD_MESSAGE>
-<!--E2C33EF7954C4EB5ADA169E00EF93F99-->  <AD_MESSAGE_ID><![CDATA[E2C33EF7954C4EB5ADA169E00EF93F99]]></AD_MESSAGE_ID>
-<!--E2C33EF7954C4EB5ADA169E00EF93F99-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
-<!--E2C33EF7954C4EB5ADA169E00EF93F99-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
-<!--E2C33EF7954C4EB5ADA169E00EF93F99-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--E2C33EF7954C4EB5ADA169E00EF93F99-->  <VALUE><![CDATA[GenericMustHavePriceDefined]]></VALUE>
-<!--E2C33EF7954C4EB5ADA169E00EF93F99-->  <MSGTEXT><![CDATA[A price for the characteristic value is defined but the Generic product does not have a sales price defined.]]></MSGTEXT>
-<!--E2C33EF7954C4EB5ADA169E00EF93F99-->  <MSGTYPE><![CDATA[E]]></MSGTYPE>
-<!--E2C33EF7954C4EB5ADA169E00EF93F99-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--E2C33EF7954C4EB5ADA169E00EF93F99-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
-<!--E2C33EF7954C4EB5ADA169E00EF93F99--></AD_MESSAGE>
-
 <!--E3678269099943C6B6E2920DA9FCE40C--><AD_MESSAGE>
 <!--E3678269099943C6B6E2920DA9FCE40C-->  <AD_MESSAGE_ID><![CDATA[E3678269099943C6B6E2920DA9FCE40C]]></AD_MESSAGE_ID>
 <!--E3678269099943C6B6E2920DA9FCE40C-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_REFERENCE.xml	Thu Sep 12 17:09:58 2013 +0200
+++ b/src-db/database/sourcedata/AD_REFERENCE.xml	Thu Sep 12 17:49:00 2013 +0200
@@ -5287,6 +5287,18 @@
 <!--7A335E6DA5774F89972F6903C9A142AA-->  <ISVALUEDISPLAYED><![CDATA[N]]></ISVALUEDISPLAYED>
 <!--7A335E6DA5774F89972F6903C9A142AA--></AD_REFERENCE>
 
+<!--7A55F24E10FD467EA8436DFE32D2C368--><AD_REFERENCE>
+<!--7A55F24E10FD467EA8436DFE32D2C368-->  <AD_REFERENCE_ID><![CDATA[7A55F24E10FD467EA8436DFE32D2C368]]></AD_REFERENCE_ID>
+<!--7A55F24E10FD467EA8436DFE32D2C368-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--7A55F24E10FD467EA8436DFE32D2C368-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--7A55F24E10FD467EA8436DFE32D2C368-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--7A55F24E10FD467EA8436DFE32D2C368-->  <NAME><![CDATA[Price List Type]]></NAME>
+<!--7A55F24E10FD467EA8436DFE32D2C368-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--7A55F24E10FD467EA8436DFE32D2C368-->  <ISBASEREFERENCE><![CDATA[N]]></ISBASEREFERENCE>
+<!--7A55F24E10FD467EA8436DFE32D2C368-->  <PARENTREFERENCE_ID><![CDATA[17]]></PARENTREFERENCE_ID>
+<!--7A55F24E10FD467EA8436DFE32D2C368-->  <ISVALUEDISPLAYED><![CDATA[N]]></ISVALUEDISPLAYED>
+<!--7A55F24E10FD467EA8436DFE32D2C368--></AD_REFERENCE>
+
 <!--7CD9193198B94EF5B174D0F8512B0857--><AD_REFERENCE>
 <!--7CD9193198B94EF5B174D0F8512B0857-->  <AD_REFERENCE_ID><![CDATA[7CD9193198B94EF5B174D0F8512B0857]]></AD_REFERENCE_ID>
 <!--7CD9193198B94EF5B174D0F8512B0857-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_REF_LIST.xml	Thu Sep 12 17:09:58 2013 +0200
+++ b/src-db/database/sourcedata/AD_REF_LIST.xml	Thu Sep 12 17:49:00 2013 +0200
@@ -11244,6 +11244,17 @@
 <!--BFD6421C087B4F0E85CE1876CC7AB5F1-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--BFD6421C087B4F0E85CE1876CC7AB5F1--></AD_REF_LIST>
 
+<!--C0CD91907A784B059B0230ACDA1A4E1A--><AD_REF_LIST>
+<!--C0CD91907A784B059B0230ACDA1A4E1A-->  <AD_REF_LIST_ID><![CDATA[C0CD91907A784B059B0230ACDA1A4E1A]]></AD_REF_LIST_ID>
+<!--C0CD91907A784B059B0230ACDA1A4E1A-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--C0CD91907A784B059B0230ACDA1A4E1A-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--C0CD91907A784B059B0230ACDA1A4E1A-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--C0CD91907A784B059B0230ACDA1A4E1A-->  <VALUE><![CDATA[PURCHASE]]></VALUE>
+<!--C0CD91907A784B059B0230ACDA1A4E1A-->  <NAME><![CDATA[Purchase Price List]]></NAME>
+<!--C0CD91907A784B059B0230ACDA1A4E1A-->  <AD_REFERENCE_ID><![CDATA[7A55F24E10FD467EA8436DFE32D2C368]]></AD_REFERENCE_ID>
+<!--C0CD91907A784B059B0230ACDA1A4E1A-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--C0CD91907A784B059B0230ACDA1A4E1A--></AD_REF_LIST>
+
 <!--C102A96C20C44BA6BAAD322E999633A3--><AD_REF_LIST>
 <!--C102A96C20C44BA6BAAD322E999633A3-->  <AD_REF_LIST_ID><![CDATA[C102A96C20C44BA6BAAD322E999633A3]]></AD_REF_LIST_ID>
 <!--C102A96C20C44BA6BAAD322E999633A3-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -11943,6 +11954,17 @@
 <!--E613BFBE3D53433292816FE4BEE9B15D-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--E613BFBE3D53433292816FE4BEE9B15D--></AD_REF_LIST>
 
+<!--E93A9EC9AD2C463396261285CB344FC4--><AD_REF_LIST>
+<!--E93A9EC9AD2C463396261285CB344FC4-->  <AD_REF_LIST_ID><![CDATA[E93A9EC9AD2C463396261285CB344FC4]]></AD_REF_LIST_ID>
+<!--E93A9EC9AD2C463396261285CB344FC4-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--E93A9EC9AD2C463396261285CB344FC4-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--E93A9EC9AD2C463396261285CB344FC4-->  <ISACTIVE><![CDATA[N]]></ISACTIVE>
+<!--E93A9EC9AD2C463396261285CB344FC4-->  <VALUE><![CDATA[ALL]]></VALUE>
+<!--E93A9EC9AD2C463396261285CB344FC4-->  <NAME><![CDATA[All Price Lists]]></NAME>
+<!--E93A9EC9AD2C463396261285CB344FC4-->  <AD_REFERENCE_ID><![CDATA[7A55F24E10FD467EA8436DFE32D2C368]]></AD_REFERENCE_ID>
+<!--E93A9EC9AD2C463396261285CB344FC4-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--E93A9EC9AD2C463396261285CB344FC4--></AD_REF_LIST>
+
 <!--EA7231981AC74EBD97ADAD008C0C5530--><AD_REF_LIST>
 <!--EA7231981AC74EBD97ADAD008C0C5530-->  <AD_REF_LIST_ID><![CDATA[EA7231981AC74EBD97ADAD008C0C5530]]></AD_REF_LIST_ID>
 <!--EA7231981AC74EBD97ADAD008C0C5530-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -12243,6 +12265,17 @@
 <!--F909149B2018465DA19A11D9F9AC9ABD-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--F909149B2018465DA19A11D9F9AC9ABD--></AD_REF_LIST>
 
+<!--F9776B07CC474B519AB631DE03726291--><AD_REF_LIST>
+<!--F9776B07CC474B519AB631DE03726291-->  <AD_REF_LIST_ID><![CDATA[F9776B07CC474B519AB631DE03726291]]></AD_REF_LIST_ID>
+<!--F9776B07CC474B519AB631DE03726291-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--F9776B07CC474B519AB631DE03726291-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--F9776B07CC474B519AB631DE03726291-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--F9776B07CC474B519AB631DE03726291-->  <VALUE><![CDATA[SALES]]></VALUE>
+<!--F9776B07CC474B519AB631DE03726291-->  <NAME><![CDATA[Sales Price List]]></NAME>
+<!--F9776B07CC474B519AB631DE03726291-->  <AD_REFERENCE_ID><![CDATA[7A55F24E10FD467EA8436DFE32D2C368]]></AD_REFERENCE_ID>
+<!--F9776B07CC474B519AB631DE03726291-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--F9776B07CC474B519AB631DE03726291--></AD_REF_LIST>
+
 <!--FA4EB912DC0F4A0B80179B78DA09B7AC--><AD_REF_LIST>
 <!--FA4EB912DC0F4A0B80179B78DA09B7AC-->  <AD_REF_LIST_ID><![CDATA[FA4EB912DC0F4A0B80179B78DA09B7AC]]></AD_REF_LIST_ID>
 <!--FA4EB912DC0F4A0B80179B78DA09B7AC-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src/org/openbravo/materialmgmt/VariantAutomaticGenerationProcess.java	Thu Sep 12 17:09:58 2013 +0200
+++ b/src/org/openbravo/materialmgmt/VariantAutomaticGenerationProcess.java	Thu Sep 12 17:49:00 2013 +0200
@@ -39,6 +39,7 @@
 import org.openbravo.dal.core.DalUtil;
 import org.openbravo.dal.service.OBCriteria;
 import org.openbravo.dal.service.OBDal;
+import org.openbravo.dal.service.OBDao;
 import org.openbravo.erpCommon.utility.OBError;
 import org.openbravo.erpCommon.utility.OBMessageUtils;
 import org.openbravo.model.ad.utility.Image;
@@ -54,6 +55,8 @@
 public class VariantAutomaticGenerationProcess implements Process {
   private static final Logger log4j = Logger.getLogger(VariantAutomaticGenerationProcess.class);
   private static final int searchKeyLength = getSearchKeyColumnLength();
+  private static final String SALES_PRICELIST = "SALES";
+  private static final String PURCHASE_PRICELIST = "PURCHASE";
 
   @Override
   public void execute(ProcessBundle bundle) throws Exception {
@@ -155,7 +158,8 @@
           OBDal.getInstance().save(newPrChValue);
           if (prChConf.getCharacteristicOfProduct().isDefinesPrice()
               && prChConf.getNetUnitPrice() != null) {
-            setPrice(variant, prChConf.getNetUnitPrice());
+            setPrice(variant, prChConf.getNetUnitPrice(), prChConf.getCharacteristicOfProduct()
+                .getPriceListType());
           }
           if (prChConf.getCharacteristicOfProduct().isDefinesImage() && prChConf.getImage() != null) {
             Image newImage = (Image) DalUtil.copy(prChConf.getImage(), false);
@@ -244,8 +248,16 @@
     }
   }
 
-  private void setPrice(Product variant, BigDecimal price) {
-    for (ProductPrice prodPrice : variant.getPricingProductPriceList()) {
+  private void setPrice(Product variant, BigDecimal price, String strPriceListType) {
+    List<ProductPrice> prodPrices = OBDao.getActiveOBObjectList(variant,
+        Product.PROPERTY_PRICINGPRODUCTPRICELIST);
+    for (ProductPrice prodPrice : prodPrices) {
+      boolean isSOPriceList = prodPrice.getPriceListVersion().getPriceList().isSalesPriceList();
+      if (SALES_PRICELIST.equals(strPriceListType) && !isSOPriceList) {
+        continue;
+      } else if (PURCHASE_PRICELIST.equals(strPriceListType) && isSOPriceList) {
+        continue;
+      }
       prodPrice.setStandardPrice(price);
       prodPrice.setListPrice(price);
       prodPrice.setPriceLimit(price);
--- a/src/org/openbravo/materialmgmt/actionhandler/ManageVariants.java	Thu Sep 12 17:09:58 2013 +0200
+++ b/src/org/openbravo/materialmgmt/actionhandler/ManageVariants.java	Thu Sep 12 17:49:00 2013 +0200
@@ -20,21 +20,20 @@
 
 import java.math.BigDecimal;
 import java.util.Collections;
-import java.util.Date;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 import org.codehaus.jettison.json.JSONArray;
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
-import org.openbravo.base.exception.OBException;
 import org.openbravo.base.provider.OBProvider;
 import org.openbravo.client.application.process.BaseProcessActionHandler;
 import org.openbravo.dal.core.DalUtil;
 import org.openbravo.dal.core.OBContext;
 import org.openbravo.dal.service.OBDal;
+import org.openbravo.dal.service.OBDao;
 import org.openbravo.erpCommon.utility.OBMessageUtils;
-import org.openbravo.financial.FinancialUtils;
 import org.openbravo.materialmgmt.VariantChDescUpdateProcess;
 import org.openbravo.model.ad.utility.Image;
 import org.openbravo.model.common.plm.Characteristic;
@@ -51,6 +50,8 @@
 
 public class ManageVariants extends BaseProcessActionHandler {
   final static private Logger log = LoggerFactory.getLogger(ManageVariants.class);
+  private static final String SALES_PRICELIST = "SALES";
+  private static final String PURCHASE_PRICELIST = "PURCHASE";
 
   @Override
   protected JSONObject doExecute(Map<String, Object> parameters, String content) {
@@ -132,7 +133,8 @@
           chValue.getString("characteristicConf"));
       if (prChConf.getCharacteristicOfProduct().isDefinesPrice()
           && prChConf.getNetUnitPrice() != null) {
-        setPrice(variant, prChConf.getNetUnitPrice());
+        setPrice(variant, prChConf.getNetUnitPrice(), prChConf.getCharacteristicOfProduct()
+            .getPriceListType());
       }
       if (prChConf.getCharacteristicOfProduct().isDefinesImage() && prChConf.getImage() != null) {
         Image newImage = (Image) DalUtil.copy(prChConf.getImage(), false);
@@ -154,14 +156,20 @@
     OBDal.getInstance().save(variant);
   }
 
-  private void setPrice(Product variant, BigDecimal price) {
-    ProductPrice prodPrice = FinancialUtils.getProductPrice(variant, new Date(), true, null, false);
-    if (prodPrice == null) {
-      throw new OBException(OBMessageUtils.parseTranslation("@GenericMustHavePriceDefined@"));
+  private void setPrice(Product variant, BigDecimal price, String strPriceListType) {
+    List<ProductPrice> prodPrices = OBDao.getActiveOBObjectList(variant,
+        Product.PROPERTY_PRICINGPRODUCTPRICELIST);
+    for (ProductPrice prodPrice : prodPrices) {
+      boolean isSOPriceList = prodPrice.getPriceListVersion().getPriceList().isSalesPriceList();
+      if (SALES_PRICELIST.equals(strPriceListType) && !isSOPriceList) {
+        continue;
+      } else if (PURCHASE_PRICELIST.equals(strPriceListType) && isSOPriceList) {
+        continue;
+      }
+      prodPrice.setStandardPrice(price);
+      prodPrice.setListPrice(price);
+      prodPrice.setPriceLimit(price);
+      OBDal.getInstance().save(prodPrice);
     }
-    prodPrice.setStandardPrice(price);
-    prodPrice.setListPrice(price);
-    prodPrice.setPriceLimit(price);
-    OBDal.getInstance().save(prodPrice);
   }
 }