Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0012319Openbravo ERPB. User interfacepublic2010-02-17 12:032010-05-18 12:12
networkb 
shuehner 
highminoralways
closedno change required 
5
2.50MP11 
2.50MP17 
OBPS
Core
No
0012319: Confuse error when inserting a record from a PL with wrong referenced value
If you have a PL which executes INSERT statements to a certain table and you set a wrong value in a column defined as foreign key from another one, you will get the following error when executing your process from the application:

Error:
No se puede eliminar el registro porque existen elementos asociados. Por favor consulte Referencia
    
This error is confused for end-user.
1. Modify any of existent PL adding an INSERT clause trying to set a non-existent value in a column defined as foreign key
2. Execute modified procedure from application.

(For example, you can try to add a record into m_product_uom table setting a wrong value in C_UOM_ID column, by copying this statement into M_INOUT_POST procedure:

insert into m_product_uom values (1000005, 1000000, 1000002,'Y',sysdate,100,sysdate,100,888888,1000067);
 )
No tags attached.
related to feature request 0012792 new Triage Platform Base Review and improve error handling 
Issue History
2010-02-17 12:03networkbNew Issue
2010-02-17 12:03networkbAssigned To => dbaz
2010-02-17 12:03networkbOBNetwork customer => Yes
2010-02-17 12:07dbazAssigned Todbaz => alostale
2010-02-22 08:21alostaleStatusnew => scheduled
2010-02-22 08:21alostaleAssigned Toalostale => shuehner
2010-02-22 08:21alostalefix_in_branch => pi
2010-03-08 16:05jpabloaeTarget Version2.50MP14 => 2.50MP15
2010-03-24 12:25shuehnerNote Added: 0025699
2010-03-24 12:25shuehnerStatusscheduled => feedback
2010-03-24 13:55networkbStatusfeedback => new
2010-03-24 13:55networkbfix_in_branchpi =>
2010-03-24 15:01shuehnerNote Added: 0025704
2010-03-24 17:54networkbRelationship addedrelated to 0012792
2010-03-24 17:55networkbNote Added: 0025707
2010-03-24 17:58shuehnerNote Added: 0025708
2010-03-24 17:58shuehnerStatusnew => closed
2010-03-24 17:58shuehnerResolutionopen => no change required
2010-03-25 00:00anonymoussf_bug_id0 => 2976198
2010-05-18 12:12gorka_gilTarget Version2.50MP15 => 2.50MP17

Notes
(0025699)
shuehner   
2010-03-24 12:25   
Some questions..

The issue with the error handling is clear, and currently not fixable easily, as at the time of the error message generating we don't have the info if the statement leading to the problem is an insert, update or delete.

However please state a valid use-case where this error might happen in any 'correct' pl-code.
(0025704)
shuehner   
2010-03-24 15:01   
Hi,

i agree that the complexity should not reject an issue out of the box (just because its complex), but it could/should perhaps affect priority when viewed together with the severity (i.e. common case or only happen if some i.e. pl code is not working correctly).

My request for info here is just to get this severity clarified, as i have some possible change in mind but need to worry about regressions vs. rejecting a change.
(0025707)
networkb   
2010-03-24 17:55   
After evaluating effort for this solution, FR 12792 has been created.

Regards
(0025708)
shuehner   
2010-03-24 17:58   
Rejecting after ok from support team. Issue should only happen with incorrect code, and effort/risk in changed involved is too high with respect to benefit.

However feature request to improve the situation later if its easier to implement is created to track the possible improvement.