info window evaluate wrong logic when un-selected parameter

Description

  1. Create a Purchase Order, then complete it (example Purchase Order ID = 10000).

  2. Create a Material Receipt header

  3. Click “create lines from“ to open the “Create lines from Shipment/Receipt“ info window

  4. In the Order parameter, select the Purchase Order created in step 1 => the Invoice field becomes invisible, and a row is selected.

  5. Clear the Order field => the result shows no records, but the Invoice field is still invisible

Reason:

  1. The invoice display logic depends on the order (… &@C_Order_ID@=0) and uses InfoWindow.infoContext as the context for evaluation. If infoContext is not provided, it falls back to Env.getCtx by default

  2. In step 4, when selecting a purchase order, the flow proceeds as follows:

    1. The parameter value of C_Order_ID is stored in InfoWindow.infoContext by call valueChange

    2. The display logic of the Invoice parameter is evaluated using InfoWindow.infoContext as the context let it invisible

    3. It performs a query

    4. It calls InfoPanel.onQueryCallback, followed by InfoPanel.updateContext. These are called with checkQueryCriteria = true, which causes the value of C_Order_ID from the parameter to be put in Env.getCtx (introduce by IDEMPIERE-5772)

  3. In step 5, when the Order parameter is cleared, the code flow is as follows:

    1. The value of C_Order_ID in the parameter is removed from InfoWindow.infoContext.

    2. The display logic of the Invoice parameter is evaluated using InfoWindow.infoContext as the context. However, if it falls back to Env.getCtx, it retrieves @C_Order_ID@ as 10000, causing the Invoice field to remain invisible

    3. It performs a query

    4. It calls InfoPanel.onQueryCallback, followed by InfoPanel.updateContext, with checkQueryCriteria = true. This removes C_Order_ID from Env.getCtx.

workaround
for variable relate to info window, use 1113 (info window context)

why does IDEMPIERE-5772 require setting the parameter to a window context variable?

Environment

None

Attachments

4

Activity

Show:

Peter Takacs4 days ago

why does IDEMPIERE-5772 require setting the parameter to a window context variable?

Hi

in we wanted to make parameters as well as values from the actual rows accessible in the quick info (see the comments in the ticket) to be able to create various widgets from relevant data.

Hiep Lqlast week

Setting environment variables from another scope (such as an Info Window or Process) into the window scope is risky, as it can potentially introduce new values or override existing ones.

Details

Assignee

Reporter

Priority

Created April 5, 2025 at 3:42 AM
Updated 4 days ago