details:   https://code.openbravo.com/erp/devel/pi/rev/66c0ea64eed9
changeset: 31315:66c0ea64eed9
user:      Mark <markmm82 <at> gmail.com>
date:      Thu Jan 26 11:23:05 2017 -0500
summary:   Related to issue 35015: Code review improvements

As Cost Adjustment Header's organization already is saved with the "legal"
organization, is not needed search it again to set as org of it lines, when
them are created. So the Cost Adjustment Line's organization will be taken
from the header's organization.

Also, as the header and lines will have the same organization is not needed to
show this field in the lines. So, the Organization field in the Cost Adjustment
Line tab has been hidden again.

diffstat:

 src-db/database/sourcedata/AD_FIELD.xml            |  2 +-
 src/org/openbravo/costing/CostAdjustmentUtils.java |  5 +----
 2 files changed, 2 insertions(+), 5 deletions(-)

diffs (29 lines):

diff -r 60800d545b59 -r 66c0ea64eed9 src-db/database/sourcedata/AD_FIELD.xml
--- a/src-db/database/sourcedata/AD_FIELD.xml   Fri Jan 27 14:38:19 2017 +0100
+++ b/src-db/database/sourcedata/AD_FIELD.xml   Thu Jan 26 11:23:05 2017 -0500
@@ -313904,7 +313904,7 @@
 <!--FD0D66CE5B74096DE040007F010024B1-->  
<AD_TAB_ID><![CDATA[06DCB72BB6D24F82BCDA5FFF8EA0425C]]></AD_TAB_ID>
 <!--FD0D66CE5B74096DE040007F010024B1-->  
<AD_COLUMN_ID><![CDATA[FD0CA136DD459858E040007F01001C35]]></AD_COLUMN_ID>
 <!--FD0D66CE5B74096DE040007F010024B1-->  
<IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
-<!--FD0D66CE5B74096DE040007F010024B1-->  
<ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--FD0D66CE5B74096DE040007F010024B1-->  
<ISDISPLAYED><![CDATA[N]]></ISDISPLAYED>
 <!--FD0D66CE5B74096DE040007F010024B1-->  
<DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
 <!--FD0D66CE5B74096DE040007F010024B1-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
 <!--FD0D66CE5B74096DE040007F010024B1-->  <SEQNO><![CDATA[15]]></SEQNO>
diff -r 60800d545b59 -r 66c0ea64eed9 
src/org/openbravo/costing/CostAdjustmentUtils.java
--- a/src/org/openbravo/costing/CostAdjustmentUtils.java        Fri Jan 27 
14:38:19 2017 +0100
+++ b/src/org/openbravo/costing/CostAdjustmentUtils.java        Thu Jan 26 
11:23:05 2017 -0500
@@ -119,12 +119,9 @@
   public static CostAdjustmentLine 
insertCostAdjustmentLine(MaterialTransaction transaction,
       CostAdjustment costAdjustmentHeader, BigDecimal costAdjusted, boolean 
isSource,
       Date accountingDate) {
-    final Organization orgLegal = OBContext.getOBContext()
-        .getOrganizationStructureProvider(transaction.getClient().getId())
-        .getLegalEntity(transaction.getOrganization());
     Long stdPrecission = transaction.getCurrency().getStandardPrecision();
     CostAdjustmentLine costAdjustmentLine = 
OBProvider.getInstance().get(CostAdjustmentLine.class);
-    costAdjustmentLine.setOrganization(orgLegal != null ? orgLegal : 
transaction.getOrganization());
+    costAdjustmentLine.setOrganization(costAdjustmentHeader.getOrganization());
     costAdjustmentLine.setCostAdjustment(costAdjustmentHeader);
     if (costAdjusted == null) {
       costAdjustmentLine.setAdjustmentAmount(null);

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to