Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0041664Openbravo ERPA. Platformpublic2019-08-19 12:062019-08-25 06:50
joniturralde93 
AugustoMauch 
urgentmajoralways
closedfixed 
5
pi 
pi3.0PR19Q4 
caristu
Core
No
0041664: Smartclient behaves wrongly when creating a record with a filled filter
If you fill a filter in grid view in a window, then create a new record in form view and switch tabs with a subtab or scroll up/down, many error logs appear. Also if you try to delete the created record, it asks for confirmation to delete 0 records.
1. Go to Sales Order window: https://livebuilds.openbravo.com/erp_pi_pgsql/ [^]
2. Filter in Document No. by: "test" -> 0 results
3. Without clearing the filter, create new record in form view.
4. Assign a business partner and save the record.
5. Click on lines tab.
6. Click on header tab -> Error appears in console log:
Uncaught TypeError: Cannot read property 'id' of undefined (...)
7. Open some sections in the header so you can scroll (Dimensions, Audit, More Information...)
8. Scroll up and down -> New errors appear:
[Intervention] Unable to preventDefault inside passive event listener due to target being treated as passive. See <URL>
9. Delete record -> Are you sure that you want to delete the 0 selected records? This will also delete all their child records.
10. When deleting, the page is already broken and the process doesn't end.
No tags attached.
related to defect 0041155 new Triage Platform Base Mouse scrolling generates errors in the browser console in chrome 73+ 
Issue History
2019-08-19 12:06joniturralde93New Issue
2019-08-19 12:06joniturralde93Assigned To => platform
2019-08-19 12:06joniturralde93Modules => Core
2019-08-19 12:06joniturralde93Resolution time => 1567980000
2019-08-19 12:06joniturralde93Triggers an Emergency Pack => No
2019-08-19 12:16malsasuaIssue Monitored: malsasua
2019-08-19 15:35rafarodaIssue Monitored: rafaroda
2019-08-22 10:30AugustoMauchAssigned Toplatform => AugustoMauch
2019-08-22 10:31AugustoMauchStatusnew => scheduled
2019-08-22 10:31AugustoMauchReview Assigned To => caristu
2019-08-22 10:45hgbotCheckin
2019-08-22 10:45hgbotNote Added: 0114115
2019-08-22 10:45hgbotStatusscheduled => resolved
2019-08-22 10:45hgbotResolutionopen => fixed
2019-08-22 10:45hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/4e85e97f7efac09c149f386abb5e534985d994ed [^]
2019-08-23 18:25caristuNote Added: 0114254
2019-08-23 18:25caristuStatusresolved => closed
2019-08-23 18:25caristuFixed in Version => 3.0PR19Q4
2019-08-23 18:25caristuRelationship addedrelated to 0041155
2019-08-25 06:50hudsonbotCheckin
2019-08-25 06:50hudsonbotNote Added: 0114256

Notes
(0114115)
hgbot   
2019-08-22 10:45   
Repository: erp/devel/pi
Changeset: 4e85e97f7efac09c149f386abb5e534985d994ed
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Thu Aug 22 10:40:55 2019 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/4e85e97f7efac09c149f386abb5e534985d994ed [^]

Fixes issue 41664: Record added in filtered empty grid is not filtered out

This code [1] was already in charge of manually adding to the grid records that have been created
in the form but that do not comply with the grid filter.

But that code was not working properly if the grid was empty when just before adding the new
 record, because in that case view.viewGrid.body.getVisibleRows() (which is used to determine where
the new row should be placed) returns [-1, -1] (meaning that at that moment there are no visible
 records), so the visibleRows[0] !== -1 was not met.

An extra else clause has been added to handle the case where the grid total rows is 0. In that case
the new record is added in the position 0.

[1] https://code.openbravo.com/erp/devel/pi/file/a3916b3d436d/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js#l2013 [^]

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js
---
(0114254)
caristu   
2019-08-23 18:25   
Code reviewed + tested OK

Note that the error: "[Intervention] Unable to preventDefault inside passive event listener due to target being treated as passive. See <URL>" is still appearing but is not caused by this issue. See 0041155.
(0114256)
hudsonbot   
2019-08-25 06:50   
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/2915449dde15 [^]
Maturity status: Test