Create Inventory Count List - Inventory Quantity = 0 - broken

Description

The process Create Inventory Count List with Inventory Quantity = 0 is broken:

19:06:00.956===========> DB.executeUpdate: INSERT INTO M_StorageOnHand (AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy, M_Locator_ID, M_Product_ID, M_AttributeSetInstance_ID, QtyOnHand, DateLastInventory) SELECT l.AD_CLIENT_ID, l.AD_ORG_ID, 'Y', getDate(), 0,getDate(), 0, l.M_Locator_ID, p.M_Product_ID, 0, 0,null FROM M_Locator l INNER JOIN M_Product p ON (l.AD_Client_ID=p.AD_Client_ID) WHERE l.M_Warehouse_ID=50002 AND l.IsDefault='Y' AND p.IsActive='Y' AND p.IsStocked='Y' and p.ProductType='I' AND NOT EXISTS (SELECT * FROM M_StorageOnHand s INNER JOIN M_Locator sl ON (s.M_Locator_ID=sl.M_Locator_ID) WHERE sl.M_Warehouse_ID=l.M_Warehouse_ID AND s.M_Product_ID=p.M_Product_ID) [SvrProcess_4ab11b18-ca4b-465c-b231-1e9757f9a8a7] [325] org.postgresql.util.PSQLException: ERROR: el valor null para la columna «datematerialpolicy» viola la restricción not null Detail: La fila que falla contiene (11, 50001, 2021-12-20 19:06:00.924812, 0, null, Y, 0, 50001, 136, 0, 2021-12-20 19:06:00.924812, 0, null, null).; State=23502; ErrorCode=0 at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2674) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2364) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:354) at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:484) at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:404) at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:162) at org.postgresql.jdbc.PgPreparedStatement.executeUpdate(PgPreparedStatement.java:130) at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:1502) at jdk.internal.reflect.GeneratedMethodAccessor89.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.compiere.db.StatementProxy.invoke(StatementProxy.java:130) at com.sun.proxy.$Proxy14.executeUpdate(Unknown Source) at org.compiere.util.DB.executeUpdate(DB.java:1045) at org.compiere.util.DB.executeUpdate(DB.java:904) at org.compiere.util.DB.executeUpdate(DB.java:891) at org.compiere.process.InventoryCountCreate.doIt(InventoryCountCreate.java:159)

Environment

None

Activity

Fixed

Details

Assignee

Reporter

Fix versions

Priority

Created December 20, 2021 at 6:13 PM
Updated February 1, 2022 at 12:53 PM
Resolved December 23, 2021 at 11:40 AM