Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0030944Openbravo ERP00. Application dictionarypublic2015-09-28 09:552015-10-01 03:36
alostale 
dmiguelez 
normalminorhave not tried
closedfixed 
5
 
3.0PR15Q4 
aferraz
Core
No
0030944: some auxiliary inputs might be useless
Auxiliary inputs can be used to define different default values for a field in a tab than the one defined in its associated column. This is done by naming the auxiliary input with the same name that column has.

There are some occurrences of this case in the distribution [1]. From them there are 4 cases for C_BPartner_ID in lines for these windows, they are present in the code since the beginning of the mercurial repository:

Goods Shipment
Goods Receipt
Purchase Invoice
Sales Invoice

They all look similar, having the code as, initially they were @C_BPartner_ID@ but they were changed to fix 0030495:

@SQL=SELECT COALESCE(C_InvoiceLine.C_BPartner_ID, C_Invoice.C_BPartner_ID) AS C_BPartner_ID
FROM C_Invoice JOIN C_InvoiceLine ON (C_Invoice.C_Invoice_ID = C_InvoiceLine.C_Invoice_ID)
WHERE C_InvoiceLine_ID=@C_InvoiceLine_ID@

There are 2 cases:

1. When in NEW mode (creating a new record in lines): they are always NULL because C_InvoiceLine_ID is not set yet. In this case the auxiliary input has no effect other than setting BP as null when which is the case if the column has no default.
2. When in EDIT mode: they take a value. After fixing issue 0030927, the auxiliary input value shouldn't overwrite the current column value. As there is no way to distinguish column and auxiliary input value (nor in display/readonly logic nor in callouts), actual value should be always preserved. Furthermore, none of them are used in display/readonly logic [2].

Because of this, these auxiliary inputs looks not to have any usage.


---
[1] Use this query to obtain auxiliary inputs named as a column in the tab they are defined in:
select i.name, w.name, t.name, f.name, i.code
from ad_auxiliarinput i, ad_field f, ad_column c, ad_window w, ad_tab t
where f.ad_tab_id = i.ad_tab_id
and f.ad_column_id = c.ad_column_id
and c.columnname ilike i.name
and t.ad_tab_id = f.ad_tab_id
and w.ad_window_id = t.ad_window_id

[2] Query to check if these auxiliary inputs are used in display/readonly logic, which returns no rows:
select i.name, w.name, t.name, f.name, i.code
from ad_auxiliarinput i, ad_field f, ad_column c, ad_window w, ad_tab t
where f.ad_tab_id = i.ad_tab_id
and f.ad_column_id = c.ad_column_id
and c.columnname ilike i.name
and t.ad_tab_id = f.ad_tab_id
and w.ad_window_id = t.ad_window_id
and (f.displaylogic ilike '%'||i.name||'%' or c.readonlylogic ilike '%'||i.name||'%' )
-
Review if there is any reason for these auxiliary inputs to exits, if not remove them.
No tags attached.
related to defect 0030927 closed alostale Auxiliary Input value is shown in Form view if its name is the same than the column associated to the field of the tab 
related to defect 0030495 closed aferraz Business Partner dimension is overwritten in Invoice Lines if another field is updated after changing it 
Issue History
2015-09-28 09:55alostaleNew Issue
2015-09-28 09:55alostaleAssigned To => Triage Finance
2015-09-28 09:55alostaleModules => Core
2015-09-28 09:55alostaleTriggers an Emergency Pack => No
2015-09-28 09:55alostaleIssue Monitored: alostale
2015-09-28 09:55alostaleRelationship addedrelated to 0030927
2015-09-28 09:58alostaleDescription Updatedbug_revision_view_page.php?rev_id=9491#r9491
2015-09-28 10:14alostaleRelationship addedrelated to 0030495
2015-09-28 10:16alostaleDescription Updatedbug_revision_view_page.php?rev_id=9492#r9492
2015-09-29 16:46hgbotCheckin
2015-09-29 16:46hgbotNote Added: 0080714
2015-09-29 16:46hgbotStatusnew => resolved
2015-09-29 16:46hgbotResolutionopen => fixed
2015-09-29 16:46hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/1bd0b0e1846f5c8d5531ced3dacd6c622bd8afb6 [^]
2015-09-29 16:49aferrazAssigned ToTriage Finance => dmiguelez
2015-09-29 18:02aferrazReview Assigned To => aferraz
2015-09-29 18:02aferrazNote Added: 0080719
2015-09-29 18:02aferrazStatusresolved => closed
2015-09-29 18:02aferrazFixed in Version => 3.0PR15Q4
2015-10-01 03:36hudsonbotCheckin
2015-10-01 03:36hudsonbotNote Added: 0080763

Notes
(0080714)
hgbot   
2015-09-29 16:46   
Repository: erp/devel/pi
Changeset: 1bd0b0e1846f5c8d5531ced3dacd6c622bd8afb6
Author: David Miguelez <david.miguelez <at> openbravo.com>
Date: Tue Sep 29 16:46:01 2015 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/1bd0b0e1846f5c8d5531ced3dacd6c622bd8afb6 [^]

Fixes Issue 30944. Reverts fix done in Issue 30495 since it is no
longer needed due to a fix for Issue 30927 done by platform team.

---
M src-db/database/sourcedata/AD_AUXILIARINPUT.xml
---
(0080719)
aferraz   
2015-09-29 18:02   
Code review + Testing OK
(0080763)
hudsonbot   
2015-10-01 03:36   
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/f63a11a49473 [^]
Maturity status: Test