call save data from grid tab bypass logic in X_Class.setMethod()
Description
to save value from gridField, idempiere call po.set_ValueNoCheck (columnName, value) to set data. it make logic at X_Class.setMethod() or at every override model class bypass.
it will make many potential issue. below is a test case i detect.
1. active Campaign or project dimension (but don't create any value for it). 2. make a sale order, let Campaign is null, complete it => Campaign of sale order line also null (but field campaign in sale order line not display) 3. make a shipment for this order 4. in shipment line select a order line by logic at CalloutInOut.orderLine, temp value of campaign in shipment line is 0 5. when save this shipment line at line 2182 class gridTable call po.set_ValueNoCheck (columnName, value) so logic convert 0 => null in X_M_InOutLine.setC_Campaign_ID is bypass => can't save shipment line
i think at po.set_ValueNoCheck (columnName, value) must use reflection to find correct setter method to call. in case can't find out. call po.set_ValueNoCheck (columnName, value) @Carlos Ruiz wdyt?
Environment
None
Activity
Murilo Habermann Torquato
June 25, 2020 at 5:04 AM
I was not able to reproduce this on a 7.1z server and i guess that this is already fixed.
I tried with Campaign field :
displayed on both Sales Order Line and Shipment Line
displayed only on Sales Order
displayed only on Shipment Line
not displayed on both Sales Order Line and Shipment Line
in all cases the record was saved correctly and the document completed.
if you have some additional information about that, please reopen this ticket. tks!
Carlos Ruiz
January 10, 2015 at 5:12 PM
from chat with @Hiep Lq on IRC - for the steps to reproduce provided above found the issue is raised if the field Campaign is not displayed on shipment line. workaround: set IsDisplayed to Y and set DisplayLogic to "1=2"
to save value from gridField, idempiere call po.set_ValueNoCheck (columnName, value) to set data.
it make logic at X_Class.setMethod() or at every override model class bypass.
it will make many potential issue.
below is a test case i detect.
1. active Campaign or project dimension (but don't create any value for it).
2. make a sale order, let Campaign is null, complete it
=> Campaign of sale order line also null (but field campaign in sale order line not display)
3. make a shipment for this order
4. in shipment line select a order line
by logic at CalloutInOut.orderLine, temp value of campaign in shipment line is 0
5. when save this shipment line
at line 2182 class gridTable call po.set_ValueNoCheck (columnName, value)
so logic convert 0 => null in X_M_InOutLine.setC_Campaign_ID is bypass
=> can't save shipment line
i think at po.set_ValueNoCheck (columnName, value)
must use reflection to find correct setter method to call. in case can't find out. call po.set_ValueNoCheck (columnName, value)
@Carlos Ruiz wdyt?