Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0026820Openbravo ERPA. Platformpublic2014-06-10 10:082014-06-12 16:41
caristu 
AugustoMauch 
immediatemajoralways
closedfixed 
5
pi 
3.0PR14Q33.0PR14Q3 
shankarb
Core
No
0026820: Unexpected behavior using an obuisel_selector reference with the id as display field
If we configure an obuisel_selector reference and put the id of the referenced table as display field, then unexpected behavior occurs when saving a record with this reference:

 - A new empty record is shown when saving the first time
 - The second time, the save operation doesn't finish
As system role:
1) Create a new obuisel_selector reference with the following information:
   - Table: any
   - Value field: ID
   - Create field: ID
   - Selector Template

  where ID is a selector field referencing the id property of the table.

2) Assign this reference to a new column of a table
3) Create the field for this column
As group admin role:
4) Go to the window which contains the new column
5) Save a new record in grid view
The source of the problem is that the column that uses that reference is being considered as primary key for the table. This is causing that an additional wrong object is being created in the localData object of the grid.
No tags attached.
Issue History
2014-06-10 10:08caristuNew Issue
2014-06-10 10:08caristuAssigned To => AugustoMauch
2014-06-10 10:08caristuModules => Core
2014-06-10 10:08caristuResolution time => 1402351200
2014-06-10 10:08caristuTriggers an Emergency Pack => No
2014-06-10 10:08caristuIssue Monitored: networkb
2014-06-10 10:08caristuversion => pi
2014-06-10 10:08caristuTarget Version => PR14Q3
2014-06-10 10:09caristuReproducibilityhave not tried => always
2014-06-10 14:20johnfandlIssue Monitored: johnfandl
2014-06-10 15:19AugustoMauchIssue Monitored: shankarb
2014-06-10 15:19AugustoMauchReview Assigned To => shankarb
2014-06-10 15:20hgbotCheckin
2014-06-10 15:20hgbotNote Added: 0067848
2014-06-10 15:20hgbotStatusnew => resolved
2014-06-10 15:20hgbotResolutionopen => fixed
2014-06-10 15:20hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/5e171f9e8353a8356f006b19a1a38c72943b6b3f [^]
2014-06-12 07:57shankarbNote Added: 0067915
2014-06-12 07:57shankarbStatusresolved => closed
2014-06-12 07:57shankarbFixed in Version => PR14Q3
2014-06-12 16:41hudsonbotCheckin
2014-06-12 16:41hudsonbotNote Added: 0067958

Notes
(0067848)
hgbot   
2014-06-10 15:20   
Repository: erp/devel/pi
Changeset: 5e171f9e8353a8356f006b19a1a38c72943b6b3f
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Tue Jun 10 15:19:07 2014 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/5e171f9e8353a8356f006b19a1a38c72943b6b3f [^]

Fixes issue 26820: Additional properties should not be used as primary keys.

When setting the primary keys of a datasource, its additional properties should not be taken into account. Only those that belong to the main entity should be considered.

For instance, consider the following case. The SalesInvoiceLine entity has a product property, which uses a selector reference. The field used as the Display Field of the selector will be added to the additional properties of SalesInvoiceLine. If the product.id property were used as Display Field, then it would be added to the additional properties, but should not be considered a primary key for SalesInvoiceLine even though that property is a primary key in its referenced entity.

---
M modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/templates/datasource.ftl
---
(0067915)
shankarb   
2014-06-12 07:57   
Code reviewed and verified in pi changeset b4ba48792e48.
(0067958)
hudsonbot   
2014-06-12 16:41   
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/f7e99944d00b [^]
Maturity status: Test