Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0025455Openbravo ERPA. Platformpublic2014-01-09 18:552014-02-12 18:29
caristu 
shankarb 
highminoralways
closedfixed 
5
 
3.0PR14Q23.0PR14Q2 
AugustoMauch
Core
No
0025455: Problem when setting an email template as default
The behavior for selecting the default email template is not working fine. Is not filtering by template definition
1) Go to the [Document Type] window and look for an already created document, for example AR Invoice
2) Navigate to the [Email Definitions tab]
3) Un-check the default checkbox for the already existing record
4) Try to check it again. The following error message appears: "There is more than one record set as default."
The callout SL_IsDefault is not retrieving the parent record properly. It is using String parentColumn = vars.getStringParameter("inpParentKeyColumnId"); but that parameter doesn't exists

Thus, the the query to check if other default values exists is not generated properly.

Use KernelUtils.getInstance().getParentRecord() to retrieve the parent record.

Note: this callout is also used in the Module window

No tags attached.
Issue History
2014-01-09 18:55caristuNew Issue
2014-01-09 18:55caristuAssigned To => caristu
2014-01-09 18:55caristuModules => Core
2014-01-09 18:55caristuResolution time => 1394060400
2014-01-09 18:55caristuTriggers an Emergency Pack => No
2014-01-09 18:56caristuIssue Monitored: networkb
2014-01-09 19:19caristuAssigned Tocaristu => AugustoMauch
2014-01-09 19:20caristuProposed Solution updated
2014-01-10 08:12caristuSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=5310#r5310
2014-01-12 11:04shankarbIssue Monitored: AugustoMauch
2014-01-13 07:06shankarbAssigned ToAugustoMauch => shankarb
2014-01-13 07:06shankarbReview Assigned To => AugustoMauch
2014-01-13 07:08hgbotCheckin
2014-01-13 07:08hgbotNote Added: 0063365
2014-01-13 07:08hgbotStatusnew => resolved
2014-01-13 07:08hgbotResolutionopen => fixed
2014-01-13 07:08hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/f49878862cba0675e9f26dba390455d4320179fc [^]
2014-01-17 15:49hudsonbotCheckin
2014-01-17 15:49hudsonbotNote Added: 0063493
2014-01-20 14:09AugustoMauchNote Added: 0063537
2014-01-20 14:09AugustoMauchStatusresolved => new
2014-01-20 14:09AugustoMauchResolutionfixed => open
2014-01-21 10:35hgbotCheckin
2014-01-21 10:35hgbotNote Added: 0063563
2014-01-27 07:20shankarbStatusnew => scheduled
2014-01-27 07:20shankarbfix_in_branch => pi
2014-01-28 10:32hgbotCheckin
2014-01-28 10:32hgbotNote Added: 0063740
2014-01-28 10:32hgbotStatusscheduled => resolved
2014-01-28 10:32hgbotResolutionopen => fixed
2014-01-28 10:32hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/f49878862cba0675e9f26dba390455d4320179fc [^] => http://code.openbravo.com/erp/devel/pi/rev/7b6a2eecd1fa0a73da98b46c597027d4a1e0bdcd [^]
2014-01-28 13:08AugustoMauchNote Added: 0063752
2014-01-28 13:08AugustoMauchStatusresolved => closed
2014-01-28 13:08AugustoMauchFixed in Version => 3.0MP32
2014-02-12 18:29hudsonbotCheckin
2014-02-12 18:29hudsonbotNote Added: 0064097
2014-02-12 18:29hudsonbotCheckin
2014-02-12 18:29hudsonbotNote Added: 0064124

Notes
(0063365)
hgbot   
2014-01-13 07:08   
Repository: erp/devel/pi
Changeset: f49878862cba0675e9f26dba390455d4320179fc
Author: Shankar Balachandran <shankar.balachandran <at> openbravo.com>
Date: Mon Jan 13 11:36:10 2014 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/f49878862cba0675e9f26dba390455d4320179fc [^]

Fixes Issue 0025455: Problem when setting an email template as default

The parent key column is computed based on tableId instead of runtime parameters as it is null in few cases.

---
M src/org/openbravo/erpCommon/ad_callouts/SL_IsDefault.java
---
(0063493)
hudsonbot   
2014-01-17 15:49   
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/9669102eb541 [^]
Maturity status: Test
(0063537)
AugustoMauch   
2014-01-20 14:09   
Reopened because the fix is not proper. Several columns of a table can have the linktoparentcolumn property set to true. This code is getting and arbitrary column that has the linktoparentcolumn, but it might not be the proper one

OBCriteria<Column> columnCriteria = OBDal.getInstance().createCriteria(Column.class);
columnCriteria.add(Restrictions.eq(Column.PROPERTY_TABLE, currentTable));
columnCriteria.add(Restrictions.eq(Column.PROPERTY_LINKTOPARENTCOLUMN, true));
for (Column column : columnCriteria.list()) {
  parentColumn = column.getDBColumnName();
}

An alternate way of getting the parent column should only be used if the inpParentKeyColumn parameter is null.
(0063563)
hgbot   
2014-01-21 10:35   
Repository: erp/devel/pi
Changeset: 8b00b87d54e27f263cb24e5a5926ca7446886e74
Author: Shankar Balachandran <shankar.balachandran <at> openbravo.com>
Date: Tue Jan 21 15:05:08 2014 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/8b00b87d54e27f263cb24e5a5926ca7446886e74 [^]

Backout Issue 0025455: Problem when setting an email template as default

The fix has been backed out as it does not handle cases where multiple columns are set as linkToParentColumn.

---
M src/org/openbravo/erpCommon/ad_callouts/SL_IsDefault.java
---
(0063740)
hgbot   
2014-01-28 10:32   
Repository: erp/devel/pi
Changeset: 7b6a2eecd1fa0a73da98b46c597027d4a1e0bdcd
Author: Shankar Balachandran <shankar.balachandran <at> openbravo.com>
Date: Wed Jan 22 15:14:29 2014 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/7b6a2eecd1fa0a73da98b46c597027d4a1e0bdcd [^]

Fixes Issue 0025455: Problem when setting an email template as default

Added new method getParentColumnName in kernel utils.
Modified the logic in getParentRecord, the issue was parentTab.getEntity() always returns ADTab and not the actual entity.
Modified logic in SL_IsDefault callout to handle cases where parentColumn is not provided in parameters.

---
M modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/KernelUtils.java
M src/org/openbravo/erpCommon/ad_callouts/SL_IsDefault.java
---
(0063752)
AugustoMauch   
2014-01-28 13:08   
Code reviewed and verified in pi@7b6a2eecd1fa
(0064097)
hudsonbot   
2014-02-12 18:29   
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/d1a5bb862230 [^]
Maturity status: Test
(0064124)
hudsonbot   
2014-02-12 18:29   
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/d1a5bb862230 [^]
Maturity status: Test