Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-5916

Cutting List Report from Manufacturing Shipment Plans throws error due to due to missing EntityCondition import

    Details

    • Sprint:
      Bug Crush Event - 21/2/2015

      Description

      This error occurs when clicking the "Cutting List Report" button from the Manufacturing -> Shipment Plans page once a production run has been created for a planned shipment:

      Problems with the response writer/output stream: org.ofbiz.widget.renderer.ScreenRenderException: Error rendering screen component://manufacturing/widget/manufacturing/ReportScreens.xml#CuttingListReport: java.lang.IllegalArgumentException: Error running script at location [component://manufacturing/webapp/manufacturing/WEB-INF/actions/reports/CuttingListReport.groovy]: groovy.lang.MissingPropertyException: No such property: EntityCondition for class: CuttingListReport (Error running script at location [component://manufacturing/webapp/manufacturing/WEB-INF/actions/reports/CuttingListReport.groovy]: groovy.lang.MissingPropertyException: No such property: EntityCondition for class: CuttingListReport)

      To reproduce:
      1. Create a shipment with status Schedued and a planned item
      2. Navigate to Manufacturing -> Shipment Plans and click "Create Production Runs" for the shipment
      3. Click the "Cutting List Report" button that appears once Production Runs have been created

      1. OFBIZ-5916.patch
        0.8 kB
        Christian Carlow
      2. OFBIZ-5916-2.patch
        1 kB
        Christian Carlow

        Activity

        Hide
        lektran Scott Gray added a comment -

        I'm a little confused here, your patch fix seems valid but not for the error you reported above.

        The issue in the error posted in the description is that 'records' variable doesn't exist when records.add(...) is called in ShipmentWorkEffortTasks.groovy. Did you upload the wrong patch for this ticket?

        Show
        lektran Scott Gray added a comment - I'm a little confused here, your patch fix seems valid but not for the error you reported above. The issue in the error posted in the description is that 'records' variable doesn't exist when records.add(...) is called in ShipmentWorkEffortTasks.groovy. Did you upload the wrong patch for this ticket?
        Hide
        ofbizzer Christian Carlow added a comment -

        Thanks Scott,

        I must have accidentally clicked the wrong Shipment Plan button when troubleshooting this issue. I changed the description to match patch resolution. The original problem with the Task Report on the same page for which this issue was orginally created still needs resolution. I'll open a separate JIRA for it.

        Show
        ofbizzer Christian Carlow added a comment - Thanks Scott, I must have accidentally clicked the wrong Shipment Plan button when troubleshooting this issue. I changed the description to match patch resolution. The original problem with the Task Report on the same page for which this issue was orginally created still needs resolution. I'll open a separate JIRA for it.
        Hide
        jacques.le.roux Jacques Le Roux added a comment -

        Christian,

        The fix seems good indeed, but I'm a bit lost to test. I re-used the OOTB 9998 shipment, set as scheduled, added an item (a GZ-1000, I did not fine how to plan it).
        Then got to Manufacturing -> Shipment Plans. Clicked the View button, then the "Generate Production Runs" button. Then nothing happened, I guess I'm missing how to plan the item?

        I also tried to issue the shipment at facility/control/issueOrderItemShipGrpInvResToShipment. Then clicking on the "Generate Production Runs" button I got this error

        2015-01-11 11:37:46,280 |ttp-bio-8443-exec-32 |ScriptUtil |W| Error running script at location [component://manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/WorkWithShipmentPlans.groovy]: java.lang.NullPointerException: Cannot set property 'shipmentId' on null object

        I guess you created OFBIZ-5915 for that, right? Then could you please create a patch for the trunk? Thanks!

        Show
        jacques.le.roux Jacques Le Roux added a comment - Christian, The fix seems good indeed, but I'm a bit lost to test. I re-used the OOTB 9998 shipment, set as scheduled, added an item (a GZ-1000, I did not fine how to plan it). Then got to Manufacturing -> Shipment Plans. Clicked the View button, then the "Generate Production Runs" button. Then nothing happened, I guess I'm missing how to plan the item? I also tried to issue the shipment at facility/control/issueOrderItemShipGrpInvResToShipment. Then clicking on the "Generate Production Runs" button I got this error 2015-01-11 11:37:46,280 |ttp-bio-8443-exec-32 |ScriptUtil |W| Error running script at location [component://manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/WorkWithShipmentPlans.groovy] : java.lang.NullPointerException: Cannot set property 'shipmentId' on null object I guess you created OFBIZ-5915 for that, right? Then could you please create a patch for the trunk? Thanks!
        Hide
        ofbizzer Christian Carlow added a comment -

        Hey Jacques,

        For production runs to be created, the scheduled product must have assembly elements and routes associated with them (productAssocTypeId=MANUF_COMPONENT). I'm not sure if any demo data is already setup. I just created product "test" and element "test_1" and associated them to their corresponding routes as product links. Then I created an order for product "test" and a shipment and planned a quantity.

        I'm wondering if another JIRA should be created to hide any schedules for which production runs cannot be created because they do not have assembly elements or route associated so that users aren''t left confused when clicking the "Generate Production Runs" and nothing happens. I'm not sure if other functionality is supported requiring those schedules for products without routes and assembly elements to still appear in the list.

        The "Cannot set property 'shipmentId' on null object" error you received after issuing does seem related OFBIZ-5915 but that issue was actually created to resolve a "java.util.LinkedHashMap cannot be cast to java.lang.String" error caused by a call to delegator.findByAnd with invalid number of parameters in the same file WorkWithShipmentPlans.groovy.

        Show
        ofbizzer Christian Carlow added a comment - Hey Jacques, For production runs to be created, the scheduled product must have assembly elements and routes associated with them (productAssocTypeId=MANUF_COMPONENT). I'm not sure if any demo data is already setup. I just created product "test" and element "test_1" and associated them to their corresponding routes as product links. Then I created an order for product "test" and a shipment and planned a quantity. I'm wondering if another JIRA should be created to hide any schedules for which production runs cannot be created because they do not have assembly elements or route associated so that users aren''t left confused when clicking the "Generate Production Runs" and nothing happens. I'm not sure if other functionality is supported requiring those schedules for products without routes and assembly elements to still appear in the list. The "Cannot set property 'shipmentId' on null object" error you received after issuing does seem related OFBIZ-5915 but that issue was actually created to resolve a "java.util.LinkedHashMap cannot be cast to java.lang.String" error caused by a call to delegator.findByAnd with invalid number of parameters in the same file WorkWithShipmentPlans.groovy.
        Hide
        jacques.le.roux Jacques Le Roux added a comment -

        I'm wondering if another JIRA should be created to hide any schedules for which production runs cannot be created because they do not have assembly elements or route associated so that users aren''t left confused when clicking the "Generate Production Runs" and nothing happens. I'm not sure if other functionality is supported requiring those schedules for products without routes and assembly elements to still appear in the list.

        Yes, at least we can create a Jira to report that the "Generate Production Runs" should not show in some cases. Then later we will see how to improve that...

        Show
        jacques.le.roux Jacques Le Roux added a comment - I'm wondering if another JIRA should be created to hide any schedules for which production runs cannot be created because they do not have assembly elements or route associated so that users aren''t left confused when clicking the "Generate Production Runs" and nothing happens. I'm not sure if other functionality is supported requiring those schedules for products without routes and assembly elements to still appear in the list. Yes, at least we can create a Jira to report that the "Generate Production Runs" should not show in some cases. Then later we will see how to improve that...
        Hide
        jacques.le.roux Jacques Le Roux added a comment -

        Yes, since the error reported in OFBIZ-5915 was only in R13.07 and I was using the trunk it's indeed unrelated.

        I was able to bypass it with the patch below, but I'm unsure it does not hide something (did not review all code)

        Index: applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/WorkWithShipmentPlans.groovy
        ===================================================================
        --- applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/WorkWithShipmentPlans.groovy	(revision 1651288)
        +++ applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/WorkWithShipmentPlans.groovy	(working copy)
        @@ -59,7 +59,9 @@
                             if (issuance.cancelQuantity) {
                                 qtyInShipment -= issuance.cancelQuantity;
                             }
        -                    qtyIssuedInShipment.issuance.shipmentId = qtyInShipment;
        +                    if (qtyIssuedInShipment.issuance) {
        +                        qtyIssuedInShipment.issuance.shipmentId = qtyInShipment;
        +                    }
                         }
                     }
                 }
        
        Show
        jacques.le.roux Jacques Le Roux added a comment - Yes, since the error reported in OFBIZ-5915 was only in R13.07 and I was using the trunk it's indeed unrelated. I was able to bypass it with the patch below, but I'm unsure it does not hide something (did not review all code) Index: applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/WorkWithShipmentPlans.groovy =================================================================== --- applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/WorkWithShipmentPlans.groovy (revision 1651288) +++ applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/WorkWithShipmentPlans.groovy (working copy) @@ -59,7 +59,9 @@ if (issuance.cancelQuantity) { qtyInShipment -= issuance.cancelQuantity; } - qtyIssuedInShipment.issuance.shipmentId = qtyInShipment; + if (qtyIssuedInShipment.issuance) { + qtyIssuedInShipment.issuance.shipmentId = qtyInShipment; + } } } }
        Hide
        ofbizzer Christian Carlow added a comment -

        This is a revised patch that uses the new from().where().orderBy() methods which prevents the need for EntityCondition imports. For future patches, is it worth making an effort to change any delegator.find methods with the new ones?

        Show
        ofbizzer Christian Carlow added a comment - This is a revised patch that uses the new from().where().orderBy() methods which prevents the need for EntityCondition imports. For future patches, is it worth making an effort to change any delegator.find methods with the new ones?
        Hide
        deepak.dixit Deepak Dixit added a comment -

        Thanks Christian Carlow
        This has been fixed at
        Trunk at r#1679740
        14.12 at r#1679741
        13.07 at r#1679742

        Show
        deepak.dixit Deepak Dixit added a comment - Thanks Christian Carlow This has been fixed at Trunk at r#1679740 14.12 at r#1679741 13.07 at r#1679742

          People

          • Assignee:
            deepak.dixit Deepak Dixit
            Reporter:
            ofbizzer Christian Carlow
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development

                Agile