details: https://code.openbravo.com/erp/devel/pi/rev/a1ae555f0807 changeset: 29723:a1ae555f0807 user: Sanjota <sanjota.nelagi <at> promantia.com> date: Tue Jun 28 18:17:20 2016 +0200 summary: Fixes issue 33296: Fix to value attributeSetValue on inventoryline is incorrect
Fixed issue related to,the information on the attribute value set on inventory line is not properly shown, which was due to GR attribute set value creation. details: https://code.openbravo.com/erp/devel/pi/rev/291e57012457 changeset: 29724:291e57012457 user: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com> date: Fri Jul 01 13:06:12 2016 +0200 summary: Related to issue 33296: Code review improvements diffstat: src/org/openbravo/erpCommon/info/AttributeSetInstance.java | 28 +++++++++++--- 1 files changed, 22 insertions(+), 6 deletions(-) diffs (60 lines): diff -r 59f5c92e9921 -r 291e57012457 src/org/openbravo/erpCommon/info/AttributeSetInstance.java --- a/src/org/openbravo/erpCommon/info/AttributeSetInstance.java Fri Jul 01 10:00:46 2016 +0200 +++ b/src/org/openbravo/erpCommon/info/AttributeSetInstance.java Fri Jul 01 13:06:12 2016 +0200 @@ -11,7 +11,7 @@ * under the License. * The Original Code is Openbravo ERP. * The Initial Developer of the Original Code is Openbravo SLU - * All portions are Copyright (C) 2001-2014 Openbravo SLU + * All portions are Copyright (C) 2001-2016 Openbravo SLU * All Rights Reserved. * Contributor(s): ______________________________________. ************************************************************************ @@ -27,6 +27,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import org.apache.commons.lang.StringUtils; import org.openbravo.base.secureApp.HttpSecureAppServlet; import org.openbravo.base.secureApp.VariablesSecureApp; import org.openbravo.dal.core.OBContext; @@ -138,10 +139,14 @@ "AttributeSetInstance.product"); String strIsSOTrx = Utility.getContext(this, vars, "isSOTrx", strWindowId); + // Get attribute related variable values + String lotNo = vars.getStringParameter("inplot"); + String serialNo = vars.getStringParameter("inpserno"); + String expiryDate = vars.getStringParameter("inpDateFrom"); + // Set Attributes - AttributeSetInstanceValue attSetValue = new AttributeSetInstanceValue( - vars.getStringParameter("inplot"), vars.getStringParameter("inpserno"), - vars.getStringParameter("inpDateFrom"), vars.getStringParameter("inpislocked", "N"), + AttributeSetInstanceValue attSetValue = new AttributeSetInstanceValue(lotNo, serialNo, + expiryDate, vars.getStringParameter("inpislocked", "N"), vars.getStringParameter("inplockDescription")); AttributeSet attSet = OBDal.getInstance().get(AttributeSet.class, strAttributeSet); HashMap<String, String> attValues = new HashMap<String, String>(); @@ -162,8 +167,19 @@ } finally { OBContext.restorePreviousMode(); } - OBError myMessage = attSetValue.setAttributeInstance(this, vars, strAttributeSet, - strInstance, strWindowId, strIsSOTrx, strProduct, attValues); + + OBError myMessage = null; + if (StringUtils.isEmpty(lotNo) && StringUtils.isEmpty(serialNo) + && StringUtils.isEmpty(expiryDate)) { + myMessage = new OBError(); + myMessage.setTitle(""); + myMessage.setType("Success"); + myMessage.setMessage(Utility.messageBD(this, "Success", vars.getLanguage())); + } else { + myMessage = attSetValue.setAttributeInstance(this, vars, strAttributeSet, strInstance, + strWindowId, strIsSOTrx, strProduct, attValues); + } + vars.setSessionValue("AttributeSetInstance.instance", attSetValue.getAttSetInstanceId()); vars.setSessionValue("AttributeSetInstance.attribute", strAttributeSet); vars.setSessionValue("AttributeSetInstance.close", "Y"); ------------------------------------------------------------------------------ Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San Francisco, CA to explore cutting-edge tech and listen to tech luminaries present their vision of the future. This family event has something for everyone, including kids. Get more information and register today. http://sdm.link/attshape _______________________________________________ Openbravo-commits mailing list Openbravo-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbravo-commits