Related to ISSUE-42879. Code Review Changes:
authorDavid Miguelez <david.miguelez@openbravo.com>
Tue, 21 Jan 2020 13:44:08 +0100
changeset 36995 5ab3c9946be6
parent 36994 4b54c2f66cb0
child 36996 5da059cf95b8
Related to ISSUE 42879. Code Review Changes:
* Use id instead of object in query
src/org/openbravo/event/ProductServiceConfigurationObserver.java
--- a/src/org/openbravo/event/ProductServiceConfigurationObserver.java	Fri Jan 17 09:35:25 2020 +0530
+++ b/src/org/openbravo/event/ProductServiceConfigurationObserver.java	Tue Jan 21 13:44:08 2020 +0100
@@ -75,12 +75,12 @@
     String hql = "as ol "
                + "join ol.salesOrder as o "
                + "where o.documentStatus = 'CO' "
-               + "and ol.product = :product "
+               + "and ol.product.id = :productId "
                + "and ol.deliveredQuantity <> ol.orderedQuantity ";
     //@formatter:on
     OrderLine notDeliveredOrderLine = OBDal.getInstance()
         .createQuery(OrderLine.class, hql)
-        .setNamedParameter("product", product)
+        .setNamedParameter("productId", product.getId())
         .setMaxResult(1)
         .uniqueResult();
     if (notDeliveredOrderLine != null) {