|View Issue Details|
|Type||Category||Severity||Reproducibility||Date Submitted||Last Update|
|defect||[Openbravo ERP] 00. Application dictionary||minor||always||2012-12-19 18:27||2013-03-04 12:08|
|Priority||high||Resolution||fixed||Fixed in Version||3.0MP21|
|Status||closed||Fix in branch||Fixed in SCM revision||6549f19a33f2|
|OS Version||Database version||Ant version|
|Product Version||pi||SCM revision|
|Review Assigned To||marvintm|
|Regression introduced in release|
|Regression introduced by commit|
|Triggers an Emergency Pack||No|
0022638: Configure the Selector Display Field, of a selector based on a view, does not work
|Description||Configure the Selector Display Field, of a selector based on a view, does not work|
|Steps To Reproduce||As System Administrator|
create a new module in development.
Create a new reference:
Search as parent reference (because OBUISEL_Selector Reference as parent does not work)
Defined the selector based on m_product_price_warehouse_v view
Defined the fields of the selector (copy the Product reference, as a guide) and the product.id as the value field, and Name as Display field.
Assign this reference to the m_product_id column of the c_orderline table
It is not necessary to compile if you have your module in development.
Check it in Purchase/Sales order,
The product name is OK in grid view, but is not in Form view.
|Tags||No tags attached.|
The issue is, reference with Parent Reference as Selector with a view in defined selector does not work. Eg., m_product_price_warehouse_v.
I created a simple view in pi and mapped it to the reference and I was able to save the row properly. Here is the code of the view.
CREATE OR REPLACE VIEW m_product_simple AS
SELECT m_product.m_product_id AS id, m_product.name AS product
The view m_product_price_warehouse_v has more than one row for each product id and I think that is causing the issue.
I think this issue is not reproducible.
To test it, set the field Name as the Display Field in the Product search reference, restart tomcat, and check that the reference works properly in the Sales Order window.
After creating the selector and navigating to Purchase/Sales order, if you create a new register(Header and Line) the problem is not reproducible.
But if you log out and log in, you navigate to Purchase/Sales order window and check one register created you will be able to reproduce it.
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Wed Feb 27 13:46:25 2013 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/6549f19a33f28ea6804b8c18b26ae2dbc800ea61 [^]
Fixes issue 22638: Enables using display fields in selectors based on views
The root problem was in the implementation of DalUtil.getValueFromPath. Two parameters are passed to that function, a BOB and a propertyPath. In selectors based on tables, the property always belongs to the BOB, but this is not always true for selectors based on views. I.e., in the Product selector, if the Product field is selected as value field and the Name field as display field, the following call will be made:
The product BOB does not have a product (first part of product.name) property, but the view has. This has been solved by making recursive calls to getValueFromPath, stripping each time the first part of the propertyPath. This would be the execution for the previous example:
- The productBOB does not have a product property
- return DalUtil.getValueFromPath(productBOB, "name")
* The productBOB does have a name property, it returns its value
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/f5db629e7058 [^]
Maturity status: Test
|2012-12-19 18:27||VictorVillar||New Issue|
|2012-12-19 18:27||VictorVillar||Assigned To||=> AugustoMauch|
|2012-12-19 18:27||VictorVillar||Modules||=> Core|
|2012-12-19 18:27||VictorVillar||Triggers an Emergency Pack||=> No|
|2012-12-19 18:27||VictorVillar||Relationship added||depends on 0022523|
|2012-12-19 18:27||VictorVillar||Issue Monitored: networkb|
|2013-01-29 18:42||AugustoMauch||Assigned To||AugustoMauch => shankarb|
|2013-01-31 15:27||AugustoMauch||Status||new => feedback|
|2013-02-04 10:07||shankarb||Note Added: 0056118|
|2013-02-04 17:07||VictorVillar||Status||feedback => scheduled|
|2013-02-04 17:07||VictorVillar||fix_in_branch||=> pi|
|2013-02-05 17:50||jonalegriaesarte||Target Version||3.0MP20 => 3.0MP21|
|2013-02-05 17:50||jonalegriaesarte||fix_in_branch||pi =>|
|2013-02-06 10:34||AugustoMauch||Status||scheduled => acknowledged|
|2013-02-06 10:34||AugustoMauch||Assigned To||shankarb => AugustoMauch|
|2013-02-06 18:11||AugustoMauch||Status||acknowledged => scheduled|
|2013-02-06 18:11||AugustoMauch||fix_in_branch||=> pi|
|2013-02-06 18:12||AugustoMauch||Note Added: 0056234|
|2013-02-06 18:12||AugustoMauch||Status||scheduled => feedback|
|2013-02-19 09:42||VictorVillar||Status||feedback => scheduled|
|2013-02-19 09:42||VictorVillar||Note Added: 0056539|
|2013-02-27 13:38||AugustoMauch||Issue Monitored: marvintm|
|2013-02-27 13:38||AugustoMauch||Review Assigned To||=> marvintm|
|2013-02-27 13:38||AugustoMauch||fix_in_branch||pi =>|
|2013-02-27 13:47||hgbot||Note Added: 0056813|
|2013-02-27 13:47||hgbot||Status||scheduled => resolved|
|2013-02-27 13:47||hgbot||Resolution||open => fixed|
|2013-02-27 13:47||hgbot||Fixed in SCM revision||=> http://code.openbravo.com/erp/devel/pi/rev/6549f19a33f28ea6804b8c18b26ae2dbc800ea61 [^]|
|2013-03-02 05:48||hudsonbot||Note Added: 0056921|
|2013-03-04 12:08||marvintm||Status||resolved => closed|
|2013-03-04 12:08||marvintm||Fixed in Version||=> 3.0MP21|
|Copyright © 2000 - 2009 MantisBT Group|