Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0035055Openbravo ERPA. Platformpublic2017-01-25 15:412017-03-15 20:19
umartirena 
NaroaIriarte 
highmajoralways
closedfixed 
5
 
3.0PR17Q2 
alostale
Core
No
0035055: Adding a Reference Search Key if type "List" for a "Button" type column that has a process definition defined works wrong.
Adding a Reference Search Key for a "Button" type column that has a process definition defined works wrong.
It assumes that a List of Button has been defined for that process definition as it will be a parameter and while opening the process it shows a list of buttons named as all options in the Reference Search Key List.
In https://livebuilds.openbravo.com/: [^]

 * Log In as System Administrator.
 * In modules window set "org.openbravo.advpaymentmngt" module as in development.
 * Open Tables and Columns window and search for "C_Order" table. In "Columns" tab search for "EM_APRM_AddPayment" column. Edit it and set as Reference Search Key "Add Payment Transaction Type".
 * Logout and Login as Client Admin Role.
 * Go to Sales Order window and create a new record with a line. Book it.
 * Click on "Add Payment" button. Check that instead of "OK" button 3 new buttons appears there: "Orders", "Invoices", "Orders and Invoices".
No tags attached.
Issue History
2017-01-25 15:41umartirenaNew Issue
2017-01-25 15:41umartirenaAssigned To => platform
2017-01-25 15:41umartirenaModules => Core
2017-01-25 15:41umartirenaTriggers an Emergency Pack => No
2017-01-26 10:09umartirenaResolution time => 1487199600
2017-01-27 07:42alostaleStatusnew => acknowledged
2017-01-30 09:29inigosanchezStatusacknowledged => scheduled
2017-01-30 09:29inigosanchezAssigned Toplatform => inigosanchez
2017-01-30 10:18inigosanchezAssigned Toinigosanchez => platform
2017-01-30 10:18inigosanchezStatusscheduled => acknowledged
2017-01-31 11:06NaroaIriarteAssigned Toplatform => NaroaIriarte
2017-02-01 11:18NaroaIriarteReview Assigned To => alostale
2017-02-01 11:18NaroaIriarteStatusacknowledged => scheduled
2017-02-02 10:05hgbotCheckin
2017-02-02 10:05hgbotNote Added: 0094007
2017-02-02 10:05hgbotStatusscheduled => resolved
2017-02-02 10:05hgbotResolutionopen => fixed
2017-02-02 10:05hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/26248d3e8c3d7c412bbff88340216887f062ee4d [^]
2017-02-03 09:37alostaleNote Added: 0094029
2017-02-03 09:37alostaleStatusresolved => new
2017-02-03 09:37alostaleResolutionfixed => open
2017-02-03 09:37alostaleNote Edited: 0094029bug_revision_view_page.php?bugnote_id=0094029#r14452
2017-02-03 14:03NaroaIriarteStatusnew => acknowledged
2017-02-03 14:03NaroaIriarteStatusacknowledged => scheduled
2017-02-07 15:00hgbotCheckin
2017-02-07 15:00hgbotNote Added: 0094125
2017-02-07 15:00hgbotStatusscheduled => resolved
2017-02-07 15:00hgbotResolutionopen => fixed
2017-02-07 15:00hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/26248d3e8c3d7c412bbff88340216887f062ee4d [^] => http://code.openbravo.com/erp/devel/pi/rev/ae663ef3e8c1b70f0214f5a0f5f93eb49c37f558 [^]
2017-02-10 08:35alostaleNote Added: 0094201
2017-02-10 08:35alostaleStatusresolved => closed
2017-02-10 08:35alostaleFixed in Version => 3.0PR17Q2
2017-03-15 20:18hudsonbotCheckin
2017-03-15 20:18hudsonbotNote Added: 0095152
2017-03-15 20:19hudsonbotCheckin
2017-03-15 20:19hudsonbotNote Added: 0095166

Notes
(0094007)
hgbot   
2017-02-02 10:05   
Repository: erp/devel/pi
Changeset: 26248d3e8c3d7c412bbff88340216887f062ee4d
Author: Naroa Iriarte <naroa.iriarte <at> openbravo.com>
Date: Wed Feb 01 18:10:11 2017 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/26248d3e8c3d7c412bbff88340216887f062ee4d [^]

Fixed issue 35055: It was not possible to use a button ref. with list subref.

If a process button had a button reference and a list sub reference was asigned, the behavior was not correct. It was acting like the main reference was button list instead of button.
The problem was that the parameter buttons was always set, this parameter is the one which contains the labels of the buttons. If this paramater is set, the code chooses a flow in which shows those buttons and the behaviour is just like having a button list reference with a list subreference.
To fix this, the button parameter must not be set. This is the action that has been taken. It is important to know that this will not break the behavior of the button list references with list subreferences, because that case is covered by the "ob-pick-and-execute-view-window.js.ftl" In this ftl, the buttons property is set.
Now, the buttons property is set if the process ui definition is Manual, even if there are no known cases, as we supported it before, now it have to be also.

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-action-button.js
---
(0094029)
alostale   
2017-02-03 09:37   
reopening due to failed manual test:

 In case the button has a list reference and the process definition a "list of buttons", button in window doesn't change label based on selected record value.

Case 1 (list ref, no button list) -> OK
1.1. Follow steps described in issue
1.2. Update in db EM_APRM_AddPayment column to 'B' for created order
1.3. Select it and realize button name is "Orders or Invoices" -> OK

Case 2 (no list ref, button list) -> OK
2.1. Don't set list reference to the button
2.2. In Add Payment process definition add a new parameter
  -Reference: Button list
  -Ref search key: APR_buttonList
2.3. Follow steps to reproduce and realize the Done button is now named "Submit" -> OK

Case 3 (list ref, button list) -> FAIL
3.1 Follow steps to reproduce described in issue
3.2 Add button list (step 2.2)
3.3 Follow steps to reproduce and realize the Done button is now named "Submit" -> OK
3.4 Follow steps in Case 1 -> FAIL: buttons is named "Add Payment" but expected "Order or Invoices"


https://docs.google.com/spreadsheets/d/18l2biKWeG6iGDIPqO6VuYQ_TtP_6YxyQU4KSrPvQlJ8/edit#gid=0 [^]

(0094125)
hgbot   
2017-02-07 15:00   
Repository: erp/devel/pi
Changeset: ae663ef3e8c1b70f0214f5a0f5f93eb49c37f558
Author: Naroa Iriarte <naroa.iriarte <at> openbravo.com>
Date: Tue Feb 07 12:30:45 2017 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/ae663ef3e8c1b70f0214f5a0f5f93eb49c37f558 [^]

Fixed issue 35055: Buttons with list reference where not working fine.

When having a button with list reference and a process definition with a button list parameter, it was not taking the label values from the column, it was only taking them from the parameters.
The code which was taking the labels of the parameters has been removed because the way of obtaining the parameters' lables is covered in the "ob-pick-and-execute-view-window.js.ftl".
The problem with the removed piece of code was that, at first, all the parameters were processed and this caused having the "labelValue" variable filled with the label values of the parameters. As the "labelValue" variable was not empty, the code which handled the label values of the button was never reached, because it was inside an if (labelValues != null).

---
M modules/org.openbravo.client.application/src/org/openbravo/client/application/ApplicationUtils.java
M modules/org.openbravo.client.application/src/org/openbravo/client/application/window/OBViewTab.java
---
(0094201)
alostale   
2017-02-10 08:35   
code reviewed

tested with cases explained avobe
(0095152)
hudsonbot   
2017-03-15 20:18   
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/54e102bef53e [^]
Maturity status: Test
(0095166)
hudsonbot   
2017-03-15 20:19   
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/54e102bef53e [^]
Maturity status: Test