Cannot save more than one order line when an _ID field is not displayed
Description
Environment
Attachments
is caused by
Activity
Carlos Ruiz June 12, 2023 at 9:33 AM
I don’t understand how this is the same issue and how does it relate to the changes make by this ticket.
The description of the ticket sounds suspiciously similar, just that the description of this ticket was in a grid record, and the new finding is in the master form, but maybe is a new different issue as you point.
I think the fix could be different, 0 is null for most _ID field and we don’t have to relied on WSearchEditor to peform that conversion.
Yes, created pull request 1896 implementing this idea.

Heng Sin Low June 11, 2023 at 2:41 PM
Hi ,
I don’t understand how this is the same issue and how does it relate to the changes make by this ticket.
I think the fix could be different, 0 is null for most _ID field and we don’t have to relied on WSearchEditor to peform that conversion.
Regards,
Low
Carlos Ruiz June 11, 2023 at 2:00 PM
I went deep debugging this.
I think the cause is the same, this is the finding:
CalloutInOut.order is setting the field User1_ID to zero
When the field is configured as displayed (even if is hidden because of DisplayLogic), then it has associated a WSearchEditor
The associated WSearchEditor has a PropertyChangeListener listening for changes on this field.
When the callout set the value to zero, the WSearchEditor notice that zero is not in the lookup and set the value back to null.
The problem is, when the field is configured as not displayed - then there is no WSearchEditor to set back to null the invalid zero value.
The workaround is pretty easy, set the field as displayed with a false DisplayLogic, but I’m not sure if is OK to have this as a documented issue with a workaround and cope with the error, or fix the problem. I guess to fix it we would need to treat all lookup fields as displayed, which can go against performance.
- WDYT?
Carlos Ruiz April 27, 2023 at 9:04 PM
Thanks for checking - I’ll take a deeper look when I got some time.

Heng Sin Low April 27, 2023 at 4:54 AM
hi , this should be a different issue. I think the M_InOut.User1_ID value is copy from PO inside the CalloutInOut.order(…) method.
Reported by
When you try to create an order with two lines and the M_Shipper_ID is hidden an error is thrown because it tries to set 0 instead of null as the value. It seems to be, that this only happens with FK hidden fields that are in the master and detail tables.
This is not reproducible in iDempiere 9.
Steps to reproduce:
Login as System
Open Window, Tab & Field
Navigate to Sales Order
Open the Order Line tab
Navigate to the Shipper record
Uncheck Displayed
Uncheck Show in Grid
Save
Log out and log back as Garden Admin
Create a new Sales Order
Create a new Order Line with any product and Save
Create a second line with any product
Expected result
The order line saves normally
Actual result
An error message is shown and the second line cannot be saved