[Production-Development] fb: 2317 2318 2314
authorrafaeldemiguel <rdm@openbravo.com>
Tue, 25 Oct 2011 13:59:44 +0200
changeset 15004 a5826ec3994b
parent 15003 e32394357910
child 15005 74bf1e05bc72
[Production-Development] fb: 2317 2318 2314
src-db/database/sourcedata/AD_ELEMENT.xml
src-db/database/sourcedata/AD_FIELD.xml
src/org/openbravo/erpCommon/ad_actionButton/CreateStandars.java
--- a/src-db/database/sourcedata/AD_ELEMENT.xml	Fri Oct 21 09:35:23 2011 +0200
+++ b/src-db/database/sourcedata/AD_ELEMENT.xml	Tue Oct 25 13:59:44 2011 +0200
@@ -19253,6 +19253,8 @@
 <!--0FF8F04EC4204CA3AC8F003F38C0502A-->  <COLUMNNAME><![CDATA[Productionplandate]]></COLUMNNAME>
 <!--0FF8F04EC4204CA3AC8F003F38C0502A-->  <NAME><![CDATA[Movement Date]]></NAME>
 <!--0FF8F04EC4204CA3AC8F003F38C0502A-->  <PRINTNAME><![CDATA[Movement Date]]></PRINTNAME>
+<!--0FF8F04EC4204CA3AC8F003F38C0502A-->  <PO_NAME><![CDATA[Movement Date]]></PO_NAME>
+<!--0FF8F04EC4204CA3AC8F003F38C0502A-->  <PO_PRINTNAME><![CDATA[Movement Date]]></PO_PRINTNAME>
 <!--0FF8F04EC4204CA3AC8F003F38C0502A-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--0FF8F04EC4204CA3AC8F003F38C0502A--></AD_ELEMENT>
 
--- a/src-db/database/sourcedata/AD_FIELD.xml	Fri Oct 21 09:35:23 2011 +0200
+++ b/src-db/database/sourcedata/AD_FIELD.xml	Tue Oct 25 13:59:44 2011 +0200
@@ -118153,7 +118153,7 @@
 <!--801990-->  <GRID_SEQNO><![CDATA[120]]></GRID_SEQNO>
 <!--801990-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
 <!--801990-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
-<!--801990-->  <ISSHOWNINSTATUSBAR><![CDATA[Y]]></ISSHOWNINSTATUSBAR>
+<!--801990-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
 <!--801990--></AD_FIELD>
 
 <!--801991--><AD_FIELD>
@@ -185798,7 +185798,7 @@
 <!--84657947D4434EC0AA0495E58F3B8DCF-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
 <!--84657947D4434EC0AA0495E58F3B8DCF-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--84657947D4434EC0AA0495E58F3B8DCF-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--84657947D4434EC0AA0495E58F3B8DCF-->  <NAME><![CDATA[Productionplandate]]></NAME>
+<!--84657947D4434EC0AA0495E58F3B8DCF-->  <NAME><![CDATA[Movement Date]]></NAME>
 <!--84657947D4434EC0AA0495E58F3B8DCF-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
 <!--84657947D4434EC0AA0495E58F3B8DCF-->  <AD_TAB_ID><![CDATA[C9B5394DBA8C465C9CE26A361696B06E]]></AD_TAB_ID>
 <!--84657947D4434EC0AA0495E58F3B8DCF-->  <AD_COLUMN_ID><![CDATA[539C4E45B3FB477BAD74E46CD96F6B33]]></AD_COLUMN_ID>
@@ -185815,7 +185815,7 @@
 <!--84657947D4434EC0AA0495E58F3B8DCF-->  <GRID_SEQNO><![CDATA[7]]></GRID_SEQNO>
 <!--84657947D4434EC0AA0495E58F3B8DCF-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
 <!--84657947D4434EC0AA0495E58F3B8DCF-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
-<!--84657947D4434EC0AA0495E58F3B8DCF-->  <ISSHOWNINSTATUSBAR><![CDATA[Y]]></ISSHOWNINSTATUSBAR>
+<!--84657947D4434EC0AA0495E58F3B8DCF-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
 <!--84657947D4434EC0AA0495E58F3B8DCF--></AD_FIELD>
 
 <!--8467FF65B3154C9183A9250E5B203B4E--><AD_FIELD>
--- a/src/org/openbravo/erpCommon/ad_actionButton/CreateStandars.java	Fri Oct 21 09:35:23 2011 +0200
+++ b/src/org/openbravo/erpCommon/ad_actionButton/CreateStandars.java	Tue Oct 25 13:59:44 2011 +0200
@@ -250,20 +250,6 @@
             OBContext.restorePreviousMode();
           } // END LOOP ATTRIBUTES
 
-          // CREATE ATRIBUTE
-          AttributeSetInstanceValueData[] data = AttributeSetInstanceValueData.select(conn,
-              opProduct.getProduct().getAttributeSet().getId());
-          OBError createAttributeInstanceError = attSetInstanceTo.setAttributeInstance(conn, vars,
-              data, opProduct.getProduct().getAttributeSet().getId(), "", "", "N", opProduct
-                  .getProduct().getId(), attValues);
-          if (!createAttributeInstanceError.getType().equals("Success"))
-            throw new OBException(createAttributeInstanceError.getMessage());
-
-          OBDal.getInstance().flush();
-
-          AttributeSetInstance newAttSetinstance = OBDal.getInstance().get(
-              AttributeSetInstance.class, attSetInstanceTo.getAttSetInstanceId());
-
           // UPDATE LINES
 
           OBCriteria ProductionLineCriteria = OBDal.getInstance().createCriteria(
@@ -278,6 +264,21 @@
           List<ProductionLine> plinesToCopyTo = ProductionLineCriteria.list();
 
           for (ProductionLine pline : plinesToCopyTo) {
+
+            // CREATE ATRIBUTE
+            AttributeSetInstanceValueData[] data = AttributeSetInstanceValueData.select(conn,
+                opProduct.getProduct().getAttributeSet().getId());
+            OBError createAttributeInstanceError = attSetInstanceTo.setAttributeInstance(conn,
+                vars, data, opProduct.getProduct().getAttributeSet().getId(), "", "", "N",
+                opProduct.getProduct().getId(), attValues);
+            if (!createAttributeInstanceError.getType().equals("Success"))
+              throw new OBException(createAttributeInstanceError.getMessage());
+
+            OBDal.getInstance().flush();
+
+            AttributeSetInstance newAttSetinstance = OBDal.getInstance().get(
+                AttributeSetInstance.class, attSetInstanceTo.getAttSetInstanceId());
+
             pline.setAttributeSetValue(newAttSetinstance);
             OBDal.getInstance().save(pline);
           }