Fixes issue 31041: Insuffient stock error message when processing an inventory
authorAlvaro Ferraz <alvaro.ferraz@openbravo.com>
Mon, 19 Oct 2015 17:11:49 +0200
changeset 27810 9a8285081a69
parent 27809 c761249a7ca3
child 27811 4fe0b9e4b25c
Fixes issue 31041: Insuffient stock error message when processing an inventory

Avoid "insufficient stock" error message when processing an Inventory Amount Update created in the past.
Now, when processing related closing and opening inventories, negative stock will not be checked.
src/org/openbravo/materialmgmt/InventoryCountProcess.java
--- a/src/org/openbravo/materialmgmt/InventoryCountProcess.java	Fri Oct 23 14:14:37 2015 +0200
+++ b/src/org/openbravo/materialmgmt/InventoryCountProcess.java	Mon Oct 19 17:11:49 2015 +0200
@@ -1,3 +1,22 @@
+/*
+ *************************************************************************
+ * 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) 2012-2015 Openbravo SLU
+ * All Rights Reserved.
+ * Contributor(s):  ______________________________________.
+ ************************************************************************
+ */
+
 package org.openbravo.materialmgmt;
 
 import java.text.SimpleDateFormat;
@@ -262,7 +281,7 @@
     queryInsert.executeUpdate();
 
     if (!inventory.getClient().getClientInformationList().get(0).isAllowNegativeStock()
-        && !"C".equals(inventory.getInventoryType())) {
+        && !"C".equals(inventory.getInventoryType()) && !"O".equals(inventory.getInventoryType())) {
       checkStock(inventory);
     }