[Production-Development] Create Product Copy Process
authorrafaeldemiguel <rdm@openbravo.com>
Thu, 01 Sep 2011 12:44:07 +0200
changeset 14973 8241f96bdfad
parent 14972 4b816b0c17b5
child 14974 0fe2752f062e
[Production-Development] Create Product Copy Process
src-db/database/model/tables/MA_SEQUENCEPRODUCT.xml
src-db/database/model/tables/MA_WRPHASE.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_MODEL_OBJECT.xml
src-db/database/sourcedata/AD_PROCESS.xml
src-db/database/sourcedata/AD_PROCESS_PARA.xml
src/org/openbravo/erpCommon/ad_actionButton/SequenceProductCreate.java
src/org/openbravo/erpCommon/ad_reports/ReportWorkRequirementDailyEnv_data.xsql
--- a/src-db/database/model/tables/MA_SEQUENCEPRODUCT.xml	Tue Aug 30 10:28:33 2011 +0200
+++ b/src-db/database/model/tables/MA_SEQUENCEPRODUCT.xml	Thu Sep 01 12:44:07 2011 +0200
@@ -85,6 +85,10 @@
         <default/>
         <onCreateDefault/>
       </column>
+      <column name="COPYPRODUCT" primaryKey="false" required="false" type="CHAR" size="1" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
       <foreign-key foreignTable="AD_ORG" name="AD_ORG_MASEQUENCEPRODUCT">
         <reference local="AD_ORG_ID" foreign="AD_ORG_ID"/>
       </foreign-key>
--- a/src-db/database/model/tables/MA_WRPHASE.xml	Tue Aug 30 10:28:33 2011 +0200
+++ b/src-db/database/model/tables/MA_WRPHASE.xml	Thu Sep 01 12:44:07 2011 +0200
@@ -105,10 +105,6 @@
         <default><![CDATA[0]]></default>
         <onCreateDefault><![CDATA[0]]></onCreateDefault>
       </column>
-      <column name="PHASECLOSED" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
-        <default><![CDATA[N]]></default>
-        <onCreateDefault><![CDATA['N']]></onCreateDefault>
-      </column>
       <foreign-key foreignTable="AD_ORG" name="AD_ORG_MAWRPHASE">
         <reference local="AD_ORG_ID" foreign="AD_ORG_ID"/>
       </foreign-key>
--- a/src-db/database/sourcedata/AD_COLUMN.xml	Tue Aug 30 10:28:33 2011 +0200
+++ b/src-db/database/sourcedata/AD_COLUMN.xml	Thu Sep 01 12:44:07 2011 +0200
@@ -259734,6 +259734,40 @@
 <!--BBAA666B9FC943FD98C2B1E9BDB42EF4-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
 <!--BBAA666B9FC943FD98C2B1E9BDB42EF4--></AD_COLUMN>
 
+<!--BBF2C9B6AA3B4989980411CAFB374A69--><AD_COLUMN>
+<!--BBF2C9B6AA3B4989980411CAFB374A69-->  <AD_COLUMN_ID><![CDATA[BBF2C9B6AA3B4989980411CAFB374A69]]></AD_COLUMN_ID>
+<!--BBF2C9B6AA3B4989980411CAFB374A69-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--BBF2C9B6AA3B4989980411CAFB374A69-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--BBF2C9B6AA3B4989980411CAFB374A69-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--BBF2C9B6AA3B4989980411CAFB374A69-->  <NAME><![CDATA[Copyproduct]]></NAME>
+<!--BBF2C9B6AA3B4989980411CAFB374A69-->  <DESCRIPTION><![CDATA[Create a product copied from the line product and insert a new line in the sequence using this new product created]]></DESCRIPTION>
+<!--BBF2C9B6AA3B4989980411CAFB374A69-->  <HELP><![CDATA[Create a product copied from the line product and insert a new line in the sequence using this new product created]]></HELP>
+<!--BBF2C9B6AA3B4989980411CAFB374A69-->  <COLUMNNAME><![CDATA[Copyproduct]]></COLUMNNAME>
+<!--BBF2C9B6AA3B4989980411CAFB374A69-->  <AD_TABLE_ID><![CDATA[800097]]></AD_TABLE_ID>
+<!--BBF2C9B6AA3B4989980411CAFB374A69-->  <AD_REFERENCE_ID><![CDATA[28]]></AD_REFERENCE_ID>
+<!--BBF2C9B6AA3B4989980411CAFB374A69-->  <FIELDLENGTH><![CDATA[1]]></FIELDLENGTH>
+<!--BBF2C9B6AA3B4989980411CAFB374A69-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--BBF2C9B6AA3B4989980411CAFB374A69-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--BBF2C9B6AA3B4989980411CAFB374A69-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--BBF2C9B6AA3B4989980411CAFB374A69-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--BBF2C9B6AA3B4989980411CAFB374A69-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--BBF2C9B6AA3B4989980411CAFB374A69-->  <SEQNO><![CDATA[330]]></SEQNO>
+<!--BBF2C9B6AA3B4989980411CAFB374A69-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--BBF2C9B6AA3B4989980411CAFB374A69-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--BBF2C9B6AA3B4989980411CAFB374A69-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--BBF2C9B6AA3B4989980411CAFB374A69-->  <AD_ELEMENT_ID><![CDATA[83436989E126431FA42D07FA4295F146]]></AD_ELEMENT_ID>
+<!--BBF2C9B6AA3B4989980411CAFB374A69-->  <AD_PROCESS_ID><![CDATA[FF8081813219E68E013219ECFE930004]]></AD_PROCESS_ID>
+<!--BBF2C9B6AA3B4989980411CAFB374A69-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--BBF2C9B6AA3B4989980411CAFB374A69-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--BBF2C9B6AA3B4989980411CAFB374A69-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--BBF2C9B6AA3B4989980411CAFB374A69-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--BBF2C9B6AA3B4989980411CAFB374A69-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--BBF2C9B6AA3B4989980411CAFB374A69-->  <POSITION><![CDATA[34]]></POSITION>
+<!--BBF2C9B6AA3B4989980411CAFB374A69-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--BBF2C9B6AA3B4989980411CAFB374A69-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--BBF2C9B6AA3B4989980411CAFB374A69-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--BBF2C9B6AA3B4989980411CAFB374A69--></AD_COLUMN>
+
 <!--BD4D0980F314451086F4A861BD92C25E--><AD_COLUMN>
 <!--BD4D0980F314451086F4A861BD92C25E-->  <AD_COLUMN_ID><![CDATA[BD4D0980F314451086F4A861BD92C25E]]></AD_COLUMN_ID>
 <!--BD4D0980F314451086F4A861BD92C25E-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -260360,40 +260394,6 @@
 <!--CC754B47555D4F66974371B151632F41-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
 <!--CC754B47555D4F66974371B151632F41--></AD_COLUMN>
 
-<!--CD5D2BB076B4412FBEE12FA4ED99D0B2--><AD_COLUMN>
-<!--CD5D2BB076B4412FBEE12FA4ED99D0B2-->  <AD_COLUMN_ID><![CDATA[CD5D2BB076B4412FBEE12FA4ED99D0B2]]></AD_COLUMN_ID>
-<!--CD5D2BB076B4412FBEE12FA4ED99D0B2-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
-<!--CD5D2BB076B4412FBEE12FA4ED99D0B2-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
-<!--CD5D2BB076B4412FBEE12FA4ED99D0B2-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--CD5D2BB076B4412FBEE12FA4ED99D0B2-->  <NAME><![CDATA[Phaseclosed]]></NAME>
-<!--CD5D2BB076B4412FBEE12FA4ED99D0B2-->  <DESCRIPTION><![CDATA[Once the phase is closed will not be pending anymore]]></DESCRIPTION>
-<!--CD5D2BB076B4412FBEE12FA4ED99D0B2-->  <HELP><![CDATA[Once the phase is closed will not be pending anymore]]></HELP>
-<!--CD5D2BB076B4412FBEE12FA4ED99D0B2-->  <COLUMNNAME><![CDATA[Phaseclosed]]></COLUMNNAME>
-<!--CD5D2BB076B4412FBEE12FA4ED99D0B2-->  <AD_TABLE_ID><![CDATA[800099]]></AD_TABLE_ID>
-<!--CD5D2BB076B4412FBEE12FA4ED99D0B2-->  <AD_REFERENCE_ID><![CDATA[20]]></AD_REFERENCE_ID>
-<!--CD5D2BB076B4412FBEE12FA4ED99D0B2-->  <FIELDLENGTH><![CDATA[1]]></FIELDLENGTH>
-<!--CD5D2BB076B4412FBEE12FA4ED99D0B2-->  <DEFAULTVALUE><![CDATA[N]]></DEFAULTVALUE>
-<!--CD5D2BB076B4412FBEE12FA4ED99D0B2-->  <ISKEY><![CDATA[N]]></ISKEY>
-<!--CD5D2BB076B4412FBEE12FA4ED99D0B2-->  <ISPARENT><![CDATA[N]]></ISPARENT>
-<!--CD5D2BB076B4412FBEE12FA4ED99D0B2-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
-<!--CD5D2BB076B4412FBEE12FA4ED99D0B2-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
-<!--CD5D2BB076B4412FBEE12FA4ED99D0B2-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
-<!--CD5D2BB076B4412FBEE12FA4ED99D0B2-->  <SEQNO><![CDATA[300]]></SEQNO>
-<!--CD5D2BB076B4412FBEE12FA4ED99D0B2-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
-<!--CD5D2BB076B4412FBEE12FA4ED99D0B2-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
-<!--CD5D2BB076B4412FBEE12FA4ED99D0B2-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
-<!--CD5D2BB076B4412FBEE12FA4ED99D0B2-->  <AD_ELEMENT_ID><![CDATA[114D44DC980943F6AD95D59CC47B5433]]></AD_ELEMENT_ID>
-<!--CD5D2BB076B4412FBEE12FA4ED99D0B2-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
-<!--CD5D2BB076B4412FBEE12FA4ED99D0B2-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
-<!--CD5D2BB076B4412FBEE12FA4ED99D0B2-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
-<!--CD5D2BB076B4412FBEE12FA4ED99D0B2-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
-<!--CD5D2BB076B4412FBEE12FA4ED99D0B2-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--CD5D2BB076B4412FBEE12FA4ED99D0B2-->  <POSITION><![CDATA[27]]></POSITION>
-<!--CD5D2BB076B4412FBEE12FA4ED99D0B2-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
-<!--CD5D2BB076B4412FBEE12FA4ED99D0B2-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
-<!--CD5D2BB076B4412FBEE12FA4ED99D0B2-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
-<!--CD5D2BB076B4412FBEE12FA4ED99D0B2--></AD_COLUMN>
-
 <!--CEC2AA7C93F4423A97CE96BDD1C4B49F--><AD_COLUMN>
 <!--CEC2AA7C93F4423A97CE96BDD1C4B49F-->  <AD_COLUMN_ID><![CDATA[CEC2AA7C93F4423A97CE96BDD1C4B49F]]></AD_COLUMN_ID>
 <!--CEC2AA7C93F4423A97CE96BDD1C4B49F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_ELEMENT.xml	Tue Aug 30 10:28:33 2011 +0200
+++ b/src-db/database/sourcedata/AD_ELEMENT.xml	Thu Sep 01 12:44:07 2011 +0200
@@ -19232,19 +19232,6 @@
 <!--0DCA4840773E45198061B6F1E5F22841-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--0DCA4840773E45198061B6F1E5F22841--></AD_ELEMENT>
 
-<!--114D44DC980943F6AD95D59CC47B5433--><AD_ELEMENT>
-<!--114D44DC980943F6AD95D59CC47B5433-->  <AD_ELEMENT_ID><![CDATA[114D44DC980943F6AD95D59CC47B5433]]></AD_ELEMENT_ID>
-<!--114D44DC980943F6AD95D59CC47B5433-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
-<!--114D44DC980943F6AD95D59CC47B5433-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
-<!--114D44DC980943F6AD95D59CC47B5433-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--114D44DC980943F6AD95D59CC47B5433-->  <COLUMNNAME><![CDATA[Phaseclosed]]></COLUMNNAME>
-<!--114D44DC980943F6AD95D59CC47B5433-->  <NAME><![CDATA[Phase closed]]></NAME>
-<!--114D44DC980943F6AD95D59CC47B5433-->  <PRINTNAME><![CDATA[Phase closed]]></PRINTNAME>
-<!--114D44DC980943F6AD95D59CC47B5433-->  <DESCRIPTION><![CDATA[Once the phase is closed will not be pending anymore]]></DESCRIPTION>
-<!--114D44DC980943F6AD95D59CC47B5433-->  <HELP><![CDATA[Once the phase is closed will not be pending anymore]]></HELP>
-<!--114D44DC980943F6AD95D59CC47B5433-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--114D44DC980943F6AD95D59CC47B5433--></AD_ELEMENT>
-
 <!--13F4ADD5ED8E4FF2B039483283041FA5--><AD_ELEMENT>
 <!--13F4ADD5ED8E4FF2B039483283041FA5-->  <AD_ELEMENT_ID><![CDATA[13F4ADD5ED8E4FF2B039483283041FA5]]></AD_ELEMENT_ID>
 <!--13F4ADD5ED8E4FF2B039483283041FA5-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -23741,6 +23728,19 @@
 <!--828EE0AE80575FA1E040007F010067C7-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--828EE0AE80575FA1E040007F010067C7--></AD_ELEMENT>
 
+<!--83436989E126431FA42D07FA4295F146--><AD_ELEMENT>
+<!--83436989E126431FA42D07FA4295F146-->  <AD_ELEMENT_ID><![CDATA[83436989E126431FA42D07FA4295F146]]></AD_ELEMENT_ID>
+<!--83436989E126431FA42D07FA4295F146-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--83436989E126431FA42D07FA4295F146-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--83436989E126431FA42D07FA4295F146-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--83436989E126431FA42D07FA4295F146-->  <COLUMNNAME><![CDATA[Copyproduct]]></COLUMNNAME>
+<!--83436989E126431FA42D07FA4295F146-->  <NAME><![CDATA[Create Product Copy]]></NAME>
+<!--83436989E126431FA42D07FA4295F146-->  <PRINTNAME><![CDATA[Create Product Copy]]></PRINTNAME>
+<!--83436989E126431FA42D07FA4295F146-->  <DESCRIPTION><![CDATA[Create a product copied from the P - and insert a new line in the sequence using this new product created]]></DESCRIPTION>
+<!--83436989E126431FA42D07FA4295F146-->  <HELP><![CDATA[Create a product copied from the P - and insert a new line in the sequence using this new product created]]></HELP>
+<!--83436989E126431FA42D07FA4295F146-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--83436989E126431FA42D07FA4295F146--></AD_ELEMENT>
+
 <!--8348666AB4E04BDBAC130A4C921440CC--><AD_ELEMENT>
 <!--8348666AB4E04BDBAC130A4C921440CC-->  <AD_ELEMENT_ID><![CDATA[8348666AB4E04BDBAC130A4C921440CC]]></AD_ELEMENT_ID>
 <!--8348666AB4E04BDBAC130A4C921440CC-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_FIELD.xml	Tue Aug 30 10:28:33 2011 +0200
+++ b/src-db/database/sourcedata/AD_FIELD.xml	Thu Sep 01 12:44:07 2011 +0200
@@ -176517,6 +176517,33 @@
 <!--63981B875CAE7A68E040007F01006697-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
 <!--63981B875CAE7A68E040007F01006697--></AD_FIELD>
 
+<!--639A3B8F69E644DAB62B6D07ACE77DDB--><AD_FIELD>
+<!--639A3B8F69E644DAB62B6D07ACE77DDB-->  <AD_FIELD_ID><![CDATA[639A3B8F69E644DAB62B6D07ACE77DDB]]></AD_FIELD_ID>
+<!--639A3B8F69E644DAB62B6D07ACE77DDB-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--639A3B8F69E644DAB62B6D07ACE77DDB-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--639A3B8F69E644DAB62B6D07ACE77DDB-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--639A3B8F69E644DAB62B6D07ACE77DDB-->  <NAME><![CDATA[Create Product Copy]]></NAME>
+<!--639A3B8F69E644DAB62B6D07ACE77DDB-->  <DESCRIPTION><![CDATA[Create a product copied from the line product and insert a new line in the sequence using this new product created]]></DESCRIPTION>
+<!--639A3B8F69E644DAB62B6D07ACE77DDB-->  <HELP><![CDATA[Create a product copied from the line product and insert a new line in the sequence using this new product created]]></HELP>
+<!--639A3B8F69E644DAB62B6D07ACE77DDB-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--639A3B8F69E644DAB62B6D07ACE77DDB-->  <AD_TAB_ID><![CDATA[800110]]></AD_TAB_ID>
+<!--639A3B8F69E644DAB62B6D07ACE77DDB-->  <AD_COLUMN_ID><![CDATA[BBF2C9B6AA3B4989980411CAFB374A69]]></AD_COLUMN_ID>
+<!--639A3B8F69E644DAB62B6D07ACE77DDB-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--639A3B8F69E644DAB62B6D07ACE77DDB-->  <DISPLAYLENGTH><![CDATA[1]]></DISPLAYLENGTH>
+<!--639A3B8F69E644DAB62B6D07ACE77DDB-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--639A3B8F69E644DAB62B6D07ACE77DDB-->  <SEQNO><![CDATA[120]]></SEQNO>
+<!--639A3B8F69E644DAB62B6D07ACE77DDB-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--639A3B8F69E644DAB62B6D07ACE77DDB-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--639A3B8F69E644DAB62B6D07ACE77DDB-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--639A3B8F69E644DAB62B6D07ACE77DDB-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--639A3B8F69E644DAB62B6D07ACE77DDB-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--639A3B8F69E644DAB62B6D07ACE77DDB-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--639A3B8F69E644DAB62B6D07ACE77DDB-->  <GRID_SEQNO><![CDATA[0]]></GRID_SEQNO>
+<!--639A3B8F69E644DAB62B6D07ACE77DDB-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--639A3B8F69E644DAB62B6D07ACE77DDB-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--639A3B8F69E644DAB62B6D07ACE77DDB-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--639A3B8F69E644DAB62B6D07ACE77DDB--></AD_FIELD>
+
 <!--6446379656E54D2F92A2BC54B73003A4--><AD_FIELD>
 <!--6446379656E54D2F92A2BC54B73003A4-->  <AD_FIELD_ID><![CDATA[6446379656E54D2F92A2BC54B73003A4]]></AD_FIELD_ID>
 <!--6446379656E54D2F92A2BC54B73003A4-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -182325,33 +182352,6 @@
 <!--810B57661CF2824EE040007F010150AE-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
 <!--810B57661CF2824EE040007F010150AE--></AD_FIELD>
 
-<!--81128199370841DCB65055EB039E302C--><AD_FIELD>
-<!--81128199370841DCB65055EB039E302C-->  <AD_FIELD_ID><![CDATA[81128199370841DCB65055EB039E302C]]></AD_FIELD_ID>
-<!--81128199370841DCB65055EB039E302C-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
-<!--81128199370841DCB65055EB039E302C-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
-<!--81128199370841DCB65055EB039E302C-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--81128199370841DCB65055EB039E302C-->  <NAME><![CDATA[Phase closed]]></NAME>
-<!--81128199370841DCB65055EB039E302C-->  <DESCRIPTION><![CDATA[Once the phase is closed will not be pending anymore]]></DESCRIPTION>
-<!--81128199370841DCB65055EB039E302C-->  <HELP><![CDATA[Once the phase is closed will not be pending anymore]]></HELP>
-<!--81128199370841DCB65055EB039E302C-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
-<!--81128199370841DCB65055EB039E302C-->  <AD_TAB_ID><![CDATA[800112]]></AD_TAB_ID>
-<!--81128199370841DCB65055EB039E302C-->  <AD_COLUMN_ID><![CDATA[CD5D2BB076B4412FBEE12FA4ED99D0B2]]></AD_COLUMN_ID>
-<!--81128199370841DCB65055EB039E302C-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
-<!--81128199370841DCB65055EB039E302C-->  <DISPLAYLENGTH><![CDATA[1]]></DISPLAYLENGTH>
-<!--81128199370841DCB65055EB039E302C-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
-<!--81128199370841DCB65055EB039E302C-->  <SEQNO><![CDATA[65]]></SEQNO>
-<!--81128199370841DCB65055EB039E302C-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
-<!--81128199370841DCB65055EB039E302C-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
-<!--81128199370841DCB65055EB039E302C-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
-<!--81128199370841DCB65055EB039E302C-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
-<!--81128199370841DCB65055EB039E302C-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
-<!--81128199370841DCB65055EB039E302C-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--81128199370841DCB65055EB039E302C-->  <GRID_SEQNO><![CDATA[65]]></GRID_SEQNO>
-<!--81128199370841DCB65055EB039E302C-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
-<!--81128199370841DCB65055EB039E302C-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
-<!--81128199370841DCB65055EB039E302C-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
-<!--81128199370841DCB65055EB039E302C--></AD_FIELD>
-
 <!--82683CB3CF7918FDE040007F0100573E--><AD_FIELD>
 <!--82683CB3CF7918FDE040007F0100573E-->  <AD_FIELD_ID><![CDATA[82683CB3CF7918FDE040007F0100573E]]></AD_FIELD_ID>
 <!--82683CB3CF7918FDE040007F0100573E-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_MESSAGE.xml	Tue Aug 30 10:28:33 2011 +0200
+++ b/src-db/database/sourcedata/AD_MESSAGE.xml	Thu Sep 01 12:44:07 2011 +0200
@@ -19731,4 +19731,15 @@
 <!--FF808181316B7B2301316BB848590057-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--FF808181316B7B2301316BB848590057--></AD_MESSAGE>
 
+<!--FF8081813224247D01322442257900AC--><AD_MESSAGE>
+<!--FF8081813224247D01322442257900AC-->  <AD_MESSAGE_ID><![CDATA[FF8081813224247D01322442257900AC]]></AD_MESSAGE_ID>
+<!--FF8081813224247D01322442257900AC-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--FF8081813224247D01322442257900AC-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--FF8081813224247D01322442257900AC-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--FF8081813224247D01322442257900AC-->  <VALUE><![CDATA[IOProductCreated]]></VALUE>
+<!--FF8081813224247D01322442257900AC-->  <MSGTEXT><![CDATA[New line added to Operation: ]]></MSGTEXT>
+<!--FF8081813224247D01322442257900AC-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--FF8081813224247D01322442257900AC-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--FF8081813224247D01322442257900AC--></AD_MESSAGE>
+
 </data>
--- a/src-db/database/sourcedata/AD_MODEL_OBJECT.xml	Tue Aug 30 10:28:33 2011 +0200
+++ b/src-db/database/sourcedata/AD_MODEL_OBJECT.xml	Thu Sep 01 12:44:07 2011 +0200
@@ -4119,4 +4119,16 @@
 <!--FF808181316BE3F001316C15D3D1000D-->  <OBJECT_TYPE><![CDATA[S]]></OBJECT_TYPE>
 <!--FF808181316BE3F001316C15D3D1000D--></AD_MODEL_OBJECT>
 
+<!--FF8081813219E68E013219EEC29C000D--><AD_MODEL_OBJECT>
+<!--FF8081813219E68E013219EEC29C000D-->  <AD_MODEL_OBJECT_ID><![CDATA[FF8081813219E68E013219EEC29C000D]]></AD_MODEL_OBJECT_ID>
+<!--FF8081813219E68E013219EEC29C000D-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--FF8081813219E68E013219EEC29C000D-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--FF8081813219E68E013219EEC29C000D-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--FF8081813219E68E013219EEC29C000D-->  <ACTION><![CDATA[P]]></ACTION>
+<!--FF8081813219E68E013219EEC29C000D-->  <CLASSNAME><![CDATA[org.openbravo.erpCommon.ad_actionButton.SequenceProductCreate]]></CLASSNAME>
+<!--FF8081813219E68E013219EEC29C000D-->  <ISDEFAULT><![CDATA[Y]]></ISDEFAULT>
+<!--FF8081813219E68E013219EEC29C000D-->  <AD_PROCESS_ID><![CDATA[FF8081813219E68E013219ECFE930004]]></AD_PROCESS_ID>
+<!--FF8081813219E68E013219EEC29C000D-->  <OBJECT_TYPE><![CDATA[S]]></OBJECT_TYPE>
+<!--FF8081813219E68E013219EEC29C000D--></AD_MODEL_OBJECT>
+
 </data>
--- a/src-db/database/sourcedata/AD_PROCESS.xml	Tue Aug 30 10:28:33 2011 +0200
+++ b/src-db/database/sourcedata/AD_PROCESS.xml	Thu Sep 01 12:44:07 2011 +0200
@@ -2782,6 +2782,7 @@
 <!--800081-->  <ISDIRECTPRINT><![CDATA[N]]></ISDIRECTPRINT>
 <!--800081-->  <ISBACKGROUND><![CDATA[N]]></ISBACKGROUND>
 <!--800081-->  <ISJASPER><![CDATA[N]]></ISJASPER>
+<!--800081-->  <ISEXTERNALSERVICE><![CDATA[N]]></ISEXTERNALSERVICE>
 <!--800081-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--800081-->  <UIPATTERN><![CDATA[M]]></UIPATTERN>
 <!--800081--></AD_PROCESS>
@@ -5561,4 +5562,24 @@
 <!--FB740AB61B0E42B198D2C88D3A0D0CE6-->  <UIPATTERN><![CDATA[S]]></UIPATTERN>
 <!--FB740AB61B0E42B198D2C88D3A0D0CE6--></AD_PROCESS>
 
+<!--FF8081813219E68E013219ECFE930004--><AD_PROCESS>
+<!--FF8081813219E68E013219ECFE930004-->  <AD_PROCESS_ID><![CDATA[FF8081813219E68E013219ECFE930004]]></AD_PROCESS_ID>
+<!--FF8081813219E68E013219ECFE930004-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--FF8081813219E68E013219ECFE930004-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--FF8081813219E68E013219ECFE930004-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--FF8081813219E68E013219ECFE930004-->  <VALUE><![CDATA[SequenceProductCreate]]></VALUE>
+<!--FF8081813219E68E013219ECFE930004-->  <NAME><![CDATA[Create Product Copy]]></NAME>
+<!--FF8081813219E68E013219ECFE930004-->  <DESCRIPTION><![CDATA[Create a product copied from the line product and insert a new line in the sequence using this new product created]]></DESCRIPTION>
+<!--FF8081813219E68E013219ECFE930004-->  <HELP><![CDATA[Create a product copied from the line product and insert a new line in the sequence using this new product created]]></HELP>
+<!--FF8081813219E68E013219ECFE930004-->  <ACCESSLEVEL><![CDATA[7]]></ACCESSLEVEL>
+<!--FF8081813219E68E013219ECFE930004-->  <ISUSERSTARTABLE><![CDATA[N]]></ISUSERSTARTABLE>
+<!--FF8081813219E68E013219ECFE930004-->  <ISREPORT><![CDATA[N]]></ISREPORT>
+<!--FF8081813219E68E013219ECFE930004-->  <ISDIRECTPRINT><![CDATA[N]]></ISDIRECTPRINT>
+<!--FF8081813219E68E013219ECFE930004-->  <ISBACKGROUND><![CDATA[N]]></ISBACKGROUND>
+<!--FF8081813219E68E013219ECFE930004-->  <ISJASPER><![CDATA[N]]></ISJASPER>
+<!--FF8081813219E68E013219ECFE930004-->  <ISEXTERNALSERVICE><![CDATA[N]]></ISEXTERNALSERVICE>
+<!--FF8081813219E68E013219ECFE930004-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--FF8081813219E68E013219ECFE930004-->  <UIPATTERN><![CDATA[S]]></UIPATTERN>
+<!--FF8081813219E68E013219ECFE930004--></AD_PROCESS>
+
 </data>
--- a/src-db/database/sourcedata/AD_PROCESS_PARA.xml	Tue Aug 30 10:28:33 2011 +0200
+++ b/src-db/database/sourcedata/AD_PROCESS_PARA.xml	Thu Sep 01 12:44:07 2011 +0200
@@ -4390,4 +4390,73 @@
 <!--F6C130E3B2DD4414A162FC6BA4F2808E-->  <AD_ELEMENT_ID><![CDATA[2000]]></AD_ELEMENT_ID>
 <!--F6C130E3B2DD4414A162FC6BA4F2808E--></AD_PROCESS_PARA>
 
+<!--FF80818132200CAA0132200F00B80007--><AD_PROCESS_PARA>
+<!--FF80818132200CAA0132200F00B80007-->  <AD_PROCESS_PARA_ID><![CDATA[FF80818132200CAA0132200F00B80007]]></AD_PROCESS_PARA_ID>
+<!--FF80818132200CAA0132200F00B80007-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--FF80818132200CAA0132200F00B80007-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--FF80818132200CAA0132200F00B80007-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--FF80818132200CAA0132200F00B80007-->  <NAME><![CDATA[SearchKey]]></NAME>
+<!--FF80818132200CAA0132200F00B80007-->  <AD_PROCESS_ID><![CDATA[FF8081813219E68E013219ECFE930004]]></AD_PROCESS_ID>
+<!--FF80818132200CAA0132200F00B80007-->  <SEQNO><![CDATA[10]]></SEQNO>
+<!--FF80818132200CAA0132200F00B80007-->  <AD_REFERENCE_ID><![CDATA[10]]></AD_REFERENCE_ID>
+<!--FF80818132200CAA0132200F00B80007-->  <COLUMNNAME><![CDATA[Value]]></COLUMNNAME>
+<!--FF80818132200CAA0132200F00B80007-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--FF80818132200CAA0132200F00B80007-->  <FIELDLENGTH><![CDATA[40]]></FIELDLENGTH>
+<!--FF80818132200CAA0132200F00B80007-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--FF80818132200CAA0132200F00B80007-->  <ISRANGE><![CDATA[N]]></ISRANGE>
+<!--FF80818132200CAA0132200F00B80007-->  <DEFAULTVALUE><![CDATA[Value]]></DEFAULTVALUE>
+<!--FF80818132200CAA0132200F00B80007--></AD_PROCESS_PARA>
+
+<!--FF80818132202C17013223D76B72002C--><AD_PROCESS_PARA>
+<!--FF80818132202C17013223D76B72002C-->  <AD_PROCESS_PARA_ID><![CDATA[FF80818132202C17013223D76B72002C]]></AD_PROCESS_PARA_ID>
+<!--FF80818132202C17013223D76B72002C-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--FF80818132202C17013223D76B72002C-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--FF80818132202C17013223D76B72002C-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--FF80818132202C17013223D76B72002C-->  <NAME><![CDATA[Name]]></NAME>
+<!--FF80818132202C17013223D76B72002C-->  <AD_PROCESS_ID><![CDATA[FF8081813219E68E013219ECFE930004]]></AD_PROCESS_ID>
+<!--FF80818132202C17013223D76B72002C-->  <SEQNO><![CDATA[20]]></SEQNO>
+<!--FF80818132202C17013223D76B72002C-->  <AD_REFERENCE_ID><![CDATA[10]]></AD_REFERENCE_ID>
+<!--FF80818132202C17013223D76B72002C-->  <COLUMNNAME><![CDATA[Name]]></COLUMNNAME>
+<!--FF80818132202C17013223D76B72002C-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--FF80818132202C17013223D76B72002C-->  <FIELDLENGTH><![CDATA[60]]></FIELDLENGTH>
+<!--FF80818132202C17013223D76B72002C-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--FF80818132202C17013223D76B72002C-->  <ISRANGE><![CDATA[N]]></ISRANGE>
+<!--FF80818132202C17013223D76B72002C-->  <DEFAULTVALUE><![CDATA[Name]]></DEFAULTVALUE>
+<!--FF80818132202C17013223D76B72002C--></AD_PROCESS_PARA>
+
+<!--FF80818132202C17013223D8B5BE0030--><AD_PROCESS_PARA>
+<!--FF80818132202C17013223D8B5BE0030-->  <AD_PROCESS_PARA_ID><![CDATA[FF80818132202C17013223D8B5BE0030]]></AD_PROCESS_PARA_ID>
+<!--FF80818132202C17013223D8B5BE0030-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--FF80818132202C17013223D8B5BE0030-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--FF80818132202C17013223D8B5BE0030-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--FF80818132202C17013223D8B5BE0030-->  <NAME><![CDATA[Production Type]]></NAME>
+<!--FF80818132202C17013223D8B5BE0030-->  <AD_PROCESS_ID><![CDATA[FF8081813219E68E013219ECFE930004]]></AD_PROCESS_ID>
+<!--FF80818132202C17013223D8B5BE0030-->  <SEQNO><![CDATA[30]]></SEQNO>
+<!--FF80818132202C17013223D8B5BE0030-->  <AD_REFERENCE_ID><![CDATA[17]]></AD_REFERENCE_ID>
+<!--FF80818132202C17013223D8B5BE0030-->  <AD_REFERENCE_VALUE_ID><![CDATA[800034]]></AD_REFERENCE_VALUE_ID>
+<!--FF80818132202C17013223D8B5BE0030-->  <COLUMNNAME><![CDATA[Productiontype]]></COLUMNNAME>
+<!--FF80818132202C17013223D8B5BE0030-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--FF80818132202C17013223D8B5BE0030-->  <FIELDLENGTH><![CDATA[60]]></FIELDLENGTH>
+<!--FF80818132202C17013223D8B5BE0030-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--FF80818132202C17013223D8B5BE0030-->  <ISRANGE><![CDATA[N]]></ISRANGE>
+<!--FF80818132202C17013223D8B5BE0030-->  <DEFAULTVALUE><![CDATA[+]]></DEFAULTVALUE>
+<!--FF80818132202C17013223D8B5BE0030--></AD_PROCESS_PARA>
+
+<!--FF8081813224247D0132246112F90130--><AD_PROCESS_PARA>
+<!--FF8081813224247D0132246112F90130-->  <AD_PROCESS_PARA_ID><![CDATA[FF8081813224247D0132246112F90130]]></AD_PROCESS_PARA_ID>
+<!--FF8081813224247D0132246112F90130-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--FF8081813224247D0132246112F90130-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--FF8081813224247D0132246112F90130-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--FF8081813224247D0132246112F90130-->  <NAME><![CDATA[Quantity]]></NAME>
+<!--FF8081813224247D0132246112F90130-->  <AD_PROCESS_ID><![CDATA[FF8081813219E68E013219ECFE930004]]></AD_PROCESS_ID>
+<!--FF8081813224247D0132246112F90130-->  <SEQNO><![CDATA[40]]></SEQNO>
+<!--FF8081813224247D0132246112F90130-->  <AD_REFERENCE_ID><![CDATA[29]]></AD_REFERENCE_ID>
+<!--FF8081813224247D0132246112F90130-->  <COLUMNNAME><![CDATA[Qty]]></COLUMNNAME>
+<!--FF8081813224247D0132246112F90130-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--FF8081813224247D0132246112F90130-->  <FIELDLENGTH><![CDATA[40]]></FIELDLENGTH>
+<!--FF8081813224247D0132246112F90130-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--FF8081813224247D0132246112F90130-->  <ISRANGE><![CDATA[N]]></ISRANGE>
+<!--FF8081813224247D0132246112F90130-->  <DEFAULTVALUE><![CDATA[0]]></DEFAULTVALUE>
+<!--FF8081813224247D0132246112F90130--></AD_PROCESS_PARA>
+
 </data>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/openbravo/erpCommon/ad_actionButton/SequenceProductCreate.java	Thu Sep 01 12:44:07 2011 +0200
@@ -0,0 +1,112 @@
+/*
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * Version  1.1  (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 SLU 
+ * All portions are Copyright (C) 2011 Openbravo SLU 
+ * All Rights Reserved. 
+ * Contributor(s):  ______________________________________.
+ ************************************************************************
+ */
+package org.openbravo.erpCommon.ad_actionButton;
+
+import java.math.BigDecimal;
+
+import org.openbravo.base.provider.OBProvider;
+import org.openbravo.base.secureApp.VariablesSecureApp;
+import org.openbravo.dal.core.DalUtil;
+import org.openbravo.dal.service.OBDal;
+import org.openbravo.database.ConnectionProvider;
+import org.openbravo.erpCommon.utility.OBError;
+import org.openbravo.erpCommon.utility.Utility;
+import org.openbravo.model.common.plm.Product;
+import org.openbravo.model.manufacturing.processplan.OperationProduct;
+import org.openbravo.scheduling.Process;
+import org.openbravo.scheduling.ProcessBundle;
+
+public class SequenceProductCreate implements Process {
+
+  @Override
+  public void execute(ProcessBundle bundle) throws Exception {
+
+    try {
+      VariablesSecureApp vars = bundle.getContext().toVars();
+      final String sequenceProductId = (String) bundle.getParams().get("MA_Sequenceproduct_ID");
+      final String value = (String) bundle.getParams().get("value");
+      final String name = (String) bundle.getParams().get("name");
+      final String productionType = (String) bundle.getParams().get("productiontype");
+      final String Qty = (String) bundle.getParams().get("qty");
+      final ConnectionProvider conn = bundle.getConnection();
+
+      // Create new product copy of selected
+      OperationProduct OpProduct = OBDal.getInstance().get(OperationProduct.class,
+          sequenceProductId);
+
+      Product originalProduct = OpProduct.getProduct();
+      Product newProduct = (Product) DalUtil.copy(originalProduct);
+
+      // Modifies values
+      newProduct.setSearchKey(value);
+      newProduct.setName(name);
+
+      // Empty values copied and filled by m_product_trg
+      newProduct.setProductAccountsList(null);
+      newProduct.setProductTrlList(null);
+
+      // Save product
+      OBDal.getInstance().save(newProduct);
+
+      OBDal.getInstance().flush();
+
+      // Create Operation Product line
+
+      OperationProduct newOpProduct = OBProvider.getInstance().get(OperationProduct.class);
+
+      newOpProduct.setMASequence(OpProduct.getMASequence());
+      newOpProduct.setClient(OpProduct.getClient());
+      newOpProduct.setOrganization(OpProduct.getOrganization());
+      newOpProduct.setProduct(newProduct);
+      newOpProduct.setQuantity(new BigDecimal(Qty));
+      newOpProduct.setUOM(newProduct.getUOM());
+      newOpProduct.setProductionType(productionType);
+
+      // Save Operation Product line
+      OBDal.getInstance().save(newOpProduct);
+
+      OBDal.getInstance().flush();
+
+      final OBError msg = new OBError();
+
+      msg.setType("Success");
+      msg.setTitle(Utility.messageBD(conn, "Success", bundle.getContext().getLanguage()));
+      msg.setMessage(Utility.messageBD(conn, "IOProductCreated", bundle.getContext().getLanguage())
+          + newProduct.getName() + " " + Qty + " P" + productionType);
+      bundle.setResult(msg);
+    } catch (final Exception e) {
+      OBDal.getInstance().rollbackAndClose();
+      e.printStackTrace(System.err);
+      final OBError msg = new OBError();
+      msg.setType("Error");
+      if (e instanceof org.hibernate.exception.GenericJDBCException) {
+        msg.setMessage(((org.hibernate.exception.GenericJDBCException) e).getSQLException()
+            .getNextException().getMessage());
+      } else if (e instanceof org.hibernate.exception.ConstraintViolationException) {
+        msg.setMessage(((org.hibernate.exception.ConstraintViolationException) e).getSQLException()
+            .getNextException().getMessage());
+      } else {
+        msg.setMessage(e.getMessage());
+      }
+      msg.setTitle("Error occurred");
+      bundle.setResult(msg);
+    }
+  }
+
+}
--- a/src/org/openbravo/erpCommon/ad_reports/ReportWorkRequirementDailyEnv_data.xsql	Tue Aug 30 10:28:33 2011 +0200
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportWorkRequirementDailyEnv_data.xsql	Thu Sep 01 12:44:07 2011 +0200
@@ -42,7 +42,7 @@
         AND wr.AD_CLIENT_ID IN ('1')
         AND wr.AD_ORG_ID IN ('1')
         AND 1=1
-      ORDER BY enddate, wrp.SeqNo
+      ORDER BY wr.enddate, wrp.SeqNo
      ]]></Sql>
     <Parameter name="adLanguageId"/>
     <Parameter name="adUserClient" type="replace" optional="true" after="AND wr.AD_CLIENT_ID IN (" text="'1'"/>