Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0035346Openbravo ERPA. Platformpublic2017-02-23 10:002017-03-15 20:20
JONHM 
alostale 
highmajoralways
closedfixed 
5
 
3.0PR17Q2 
caristu
Core
No
0035346: can't save grid record after opening form if there's a selector with multi field pick list
The problem happens when saving a record in form mode on a tab which contains a selector with multiple fields in the pick list (ie. 'Product Complete' selector), and then return to grid view and create and save more records in that view. Also, some of the toolbar buttons does not respond anymore unless you close the window and reopen again.

The problem is setPickListWidth is invoked for this kind of selectors because space needs to be recalculated, in this situation it is invoked on an already closed pick list which does not contain grid field, so it fails trying to access elements of an undefined object.
First, we need the 'Product Complete' selector to be shown in a tab, so as System Administrator:
1) Open [Windows, tabs and fields] > 'Sales Order' window > 'Lines' tab > 'Product' field, and open its related column
2) With a module in development, change its 'Reference search key' and select 'Product Complete' selector

Then, as F&B International Group Admin role:
3) Open [Sales Order] window and create a record
4) Switch to 'Lines' tab and create a record (selecting the product) and save it in FORM view, then return to grid view
5) Create more records in Grid View, also selecting products
--> The toolbar icons does not respond anymore
    check js error:

    at cons.setPickListWidth (c619db9….js:54772)
    at cons.setUpPickList (c619db9….js:54668)
    at cons.setValueMap (ComboBoxItem.js:1717)
    at cons.setEntries (c619db9….js:54650)
    at cons.addValueMapEntry (c619db9….js:54611)
    at cons.transformResponse (c619db9….js:23922)
    at cons._completeResponseProcessing (DataSource.js:13531)
    at cons._handleJSONReply (DataSource.js:11651)
    at cons._handleJSONTextReply (DataSource.js:11744)
    at cons.fireCallback (Class.js:1789)

*** Watch the attached video for a demonstration of how to reproduce ***
No tags attached.
? gridViewError.mp4 (4,625,784) 2017-02-23 10:00
https://issues.openbravo.com/file_download.php?file_id=10478&type=bug
Issue History
2017-02-23 10:00JONHMNew Issue
2017-02-23 10:00JONHMAssigned To => platform
2017-02-23 10:00JONHMFile Added: gridViewError.mp4
2017-02-23 10:00JONHMModules => Core
2017-02-23 10:00JONHMResolution time => 1489618800
2017-02-23 10:00JONHMTriggers an Emergency Pack => No
2017-02-23 10:09PracticsIssue Monitored: Practics
2017-02-24 12:55alostaleSummaryCannot save multiple records if a tab contains a 'Product Complete' selector => can't save grid record after opening form if there's a selector with multi field pick list
2017-02-24 12:55alostaleDescription Updatedbug_revision_view_page.php?rev_id=14671#r14671
2017-02-24 12:55alostaleSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=14673#r14673
2017-02-24 13:01alostaleStatusnew => scheduled
2017-02-24 13:01alostaleAssigned Toplatform => alostale
2017-02-24 13:01alostaleReview Assigned To => caristu
2017-02-24 13:27hgbotCheckin
2017-02-24 13:27hgbotNote Added: 0094611
2017-02-24 13:27hgbotStatusscheduled => resolved
2017-02-24 13:27hgbotResolutionopen => fixed
2017-02-24 13:27hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/0d4102902eea3c2a36ee9ab9d443cb03f0d05a7b [^]
2017-02-27 12:28caristuNote Added: 0094635
2017-02-27 12:28caristuStatusresolved => closed
2017-02-27 12:28caristuFixed in Version => 3.0PR17Q2
2017-03-15 20:20hudsonbotCheckin
2017-03-15 20:20hudsonbotNote Added: 0095232

Notes
(0094611)
hgbot   
2017-02-24 13:27   
Repository: erp/devel/pi
Changeset: 0d4102902eea3c2a36ee9ab9d443cb03f0d05a7b
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Fri Feb 24 13:07:53 2017 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/0d4102902eea3c2a36ee9ab9d443cb03f0d05a7b [^]

fixed bug 35346: can't save grid record with multi field pick list selector

  Records in tabs with a column having a selector with multiple fields in pick
  list couldn't be saved in grid after opening form view.

  The problem was casued becasue this kind of selectors require to calculate the
  size for the picking list, but when saving it is already closed so it failed
  assuming it has a grid.

  Fixed by checking if grid is present which indirectly checks if it is visible.

---
M modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-selector-item.js
---
(0094635)
caristu   
2017-02-27 12:28   
Code review + testing OK in pi@1f961fdb2035.
(0095232)
hudsonbot   
2017-03-15 20:20   
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