Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0030993Openbravo ERPA. Platformpublic2015-09-30 17:262015-11-23 21:16
egoitz 
alostale 
normalmajoralways
closedfixed 
5
pi 
3.0PR16Q13.0PR16Q1 
caristu
Core
No
0030993: It is not possible to define a preference as default value when column has a default defined in ad_column
Right now it is possible to default value by using a preference defined with attribute using the column name, and the default value you want on the value field.

That works properly whenever the column for that field has not a default value in AD, but it case it has preference is not taken into account.
-Define a Preference with.
  * attribute='M_PRODUCT_CATEGORY_ID' (Note M_Product.M_Product_Category_ID has a default value in Table > Column)
  * value=ID_OF_ONE_EXISTING_CATEGORY (different that the first one on the dropdown)

-Select the visible at fields to apply to your client and the product window
-Logout and login
-Access to product window
-The product category fields has not got selected as default the category you defined. The default value is the first element of the dropdown.
Default values defined by preferences should prevail over the ones defined at column level.
No tags attached.
related to defect 00309483.0PR16Q1 closed alostale auxiliary input used to default a FK doesn't display FK's value identifier 
depends on defect 0031038 closed alostale API change: default value defined as preference will prevail over default defined in column 
related to defect 0027584 closed inigosanchez Wrong value is taken from context when session variable and context field name are the same 
Issue History
2015-09-30 17:26egoitzNew Issue
2015-09-30 17:26egoitzAssigned To => platform
2015-09-30 17:26egoitzModules => Core
2015-09-30 17:26egoitzResolution time => 1446678000
2015-09-30 17:26egoitzTriggers an Emergency Pack => No
2015-10-05 09:40alostaleSummaryIt is not possible to define a preference as default value for a column with reference tabledir => It is not possible to define a preference as default value when column has a default defined in ad_column
2015-10-05 09:40alostaleDescription Updatedbug_revision_view_page.php?rev_id=9593#r9593
2015-10-05 09:40alostaleSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=9595#r9595
2015-10-05 09:40alostaleProposed Solution updated
2015-10-05 09:51alostaleRelationship addeddepends on 0031038
2015-10-05 09:54alostaleAssigned Toplatform => alostale
2015-10-05 09:54alostaleReview Assigned To => caristu
2015-10-05 09:55alostaleRelationship addedrelated to 0030948
2015-10-05 09:58hgbotCheckin
2015-10-05 09:58hgbotNote Added: 0080809
2015-10-05 09:58hgbotStatusnew => resolved
2015-10-05 09:58hgbotResolutionopen => fixed
2015-10-05 09:58hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/241c38dab7cedb1e44d3d130d73315dcb7caf479 [^]
2015-10-23 11:05caristuFixed in Version => 3.0PR16Q1
2015-10-23 11:05caristuTarget Version => 3.0PR16Q1
2015-10-23 11:31caristuNote Added: 0081253
2015-10-23 11:31caristuStatusresolved => closed
2015-11-06 11:47alostaleRelationship addedrelated to 0027584
2015-11-23 21:16hudsonbotCheckin
2015-11-23 21:16hudsonbotNote Added: 0082107

Notes
(0080809)
hgbot   
2015-10-05 09:58   
Repository: erp/devel/pi
Changeset: 241c38dab7cedb1e44d3d130d73315dcb7caf479
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Mon Oct 05 09:57:41 2015 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/241c38dab7cedb1e44d3d130d73315dcb7caf479 [^]

fixed bug 30993: can't define default with preference if column has default

  When a column had a default value, it was not possible to overwrite it using a
  preference. This was possible if the column had not default value.

  This behavior has been changed: now default value defined at preference prevails
  over the one defined at column level.

---
M modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/UIDefinition.java
---
(0081253)
caristu   
2015-10-23 11:31   
Code reviewed and tested in pi@de5117f7de98
(0082107)
hudsonbot   
2015-11-23 21:16   
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/7b56bebaaa88 [^]
Maturity status: Test