Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0026286Openbravo ERPA. Platformpublic2014-04-15 14:112014-05-07 18:12
naiaramartinez 
AugustoMauch 
normalminorhave not tried
closedfixed 
5
 
3.0PR14Q3 
alostale
Core
No
0026286: Unexpected behaviour when same column name exists in header and lines tab
Unexpected behaviour when same column name exists in header and lines tab.

Go to 'windows, tabs a fields' and select Commisions window and commisions lines tab. Select 'C_bPARNER_ID' field and uncheck show in grid view.

Go to tables and columns and select C_Commission table.
select c_bpartner_id column and check as stored in session.

Login as Group admin
create new commision and select a business partner.

Create new commission line and leave bp in blank.
Refresh 'commission line' and notice that bp is now populated with the same BP that is in the header.
Modify any field (that is not the BP) in 'Commission line' tab and save it. Notice that the following error is raised: 'Saving failed. There is a constraint defined that was not satisfied. Please check the data entered'. So, the data in BP has to be removed in order to be able to save the record. If you refresh the tab, check that BP has again the same value that in the header. Check the database and the column is null.
No tags attached.
has duplicate defect 0026369 closed naiaramartinez Modules Service Contract line level Bill is populated and giving a error while save the line 
has duplicate defect 0026708 closed vmromanos Modules Get Constraint error while updating any column in Subscribed Services Tab 
Issue History
2014-04-15 14:11naiaramartinezNew Issue
2014-04-15 14:11naiaramartinezAssigned To => AugustoMauch
2014-04-15 14:11naiaramartinezModules => Core
2014-04-15 14:11naiaramartinezTriggers an Emergency Pack => No
2014-04-15 16:34jonalegriaesarteResolution time => 1397944800
2014-04-15 17:49naiaramartinezSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=5710#r5710
2014-04-16 18:21AugustoMauchFile Added: issue26286.patch
2014-04-16 18:23AugustoMauchFile Deleted: issue26286.patch
2014-04-16 18:24AugustoMauchFile Added: issue26286.patch
2014-04-22 13:24AugustoMauchFile Deleted: issue26286.patch
2014-04-24 11:33AugustoMauchIssue Monitored: alostale
2014-04-24 11:34AugustoMauchReview Assigned To => alostale
2014-04-24 11:35hgbotCheckin
2014-04-24 11:35hgbotNote Added: 0066572
2014-04-24 11:35hgbotStatusnew => resolved
2014-04-24 11:35hgbotResolutionopen => fixed
2014-04-24 11:35hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/de359036d46be34e5f86267664c040bc1a2a9826 [^]
2014-04-25 10:08naiaramartinezRelationship addedhas duplicate 0026369
2014-05-05 09:32alostaleNote Added: 0066799
2014-05-05 09:32alostaleStatusresolved => closed
2014-05-05 09:32alostaleFixed in Version => PR14Q3
2014-05-07 18:12hudsonbotCheckin
2014-05-07 18:12hudsonbotNote Added: 0066967
2014-05-28 10:24naiaramartinezRelationship addedhas duplicate 0026708

Notes
(0066572)
hgbot   
2014-04-24 11:35   
Repository: erp/devel/pi
Changeset: de359036d46be34e5f86267664c040bc1a2a9826
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Thu Apr 24 11:33:41 2014 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/de359036d46be34e5f86267664c040bc1a2a9826 [^]

Fixes issue 26286: Wrong behaviour if same column name exists in tab and subtab

This problem was reproducible if:
- There is a column in a subtab with the same column name as another column in its parent tab
- The column of the parent tab is flagged as stored in session
- The column of the subtab is not shown in the grid
- The value of the record in the subtab has a null value in that column

If all these conditions are met, then when the record in the subtab is opened in the form view, its null value will be replaced with the value of the column of its parent tab.

This bug happens because the FIC does the following:
- It invokes setSessionVariablesInParent. This method stores in the RequestContext the session variables of the parent tab, among others. At this point the stored in session column of the parent tab is stored in the RequestContext
- It invokes setValuesInRequest. This method stores in the RequestContext the values of the row being opened in the form, but only if does it for the values that are not null. In this case, the value is null so it is not stored in the RequestContext, so then when the RequestContext is accessed to fetch the column values, the value stored in the setSessionVariablesInParent method will be returned.

The fix only affects to the FIC calls in EDIT mode. In these calls the actual value of the record should take precedence over the values stored in session.

---
M modules/org.openbravo.client.application/src/org/openbravo/client/application/window/FormInitializationComponent.java
---
(0066799)
alostale   
2014-05-05 09:32   
Code reviewed + tested
(0066967)
hudsonbot   
2014-05-07 18:12   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/02ca2648bcdc [^]
Maturity status: Test