Convert to Order throws 500 server error when requisition does not have an Approved Quantity column (it is disabled in requisition template). We do not need to support convert to order without approved quantity, but at least a meaningful error message should be displayed, rather than NPE.
Validation exists that checks whether approved quantity column is enabled for the requisition that is being converted to an order
An error message is displayed if trying to convert requisition that does not have approved quantity field enabled in its template
Converting to an order still works properly if approved quantity exists
It is not possible to approve a requisition with a blank "Approved Quantity" field because now the field is required. For this reason, it is not possible to convert requisitions with a blank "Approved Quantity" field because now the field can't be blank at the convert to order step.
Oh, I think there's some confusion here. The approved quantity value has always been required. What this ticket called for was handling cases where approved quantity is not present at all (that is - it is disabled in the requisition template and therefore the "approved quantity" column does not display in requisition at all). It should be possible to approve such requisitions but not convert them to order. I will updatd the ticket description to more clearly explain that.
I checked, and the issue no longer occurs. It is still possible to approve requisitions and convert them to orders when they contain the "Approved Quantity" column. When they don't, it's still possible to approve them but it's not possible to convert them to orders. When trying to do so, the "400" error occurs, along with the following error message:
I assume the root cause is we didn't account for such a possibility?
Yes, I'd say so. We never considered a workflow that doesn't involve converting to an order and therefore doesn't require approved quantity.