Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0020722Openbravo ERPA. Platformpublic2012-06-11 16:212012-08-23 13:50
ngarcia 
AugustoMauch 
highminoralways
closedfixed 
5
pi 
3.0MP153.0MP15 
dbaz
Core
No
0020722: Lines of purchase/sales order/invoice do not appear when creating them by process buttons, if the grid is filtered by BP
Lines of purchase/sales order/invoice do not appear when creating them by process buttons, if the grid is filtered by BP.

Example: if you filter the Sales Invoice grid by a Business Partner and then create a new record, when creating the lines from an order you get the following message in the lines:

"Select a parent record in order to view its children here"

Anyway, the documents are created correctly.
As a Group Admin Role:
   Go to the Sales Order screen
   Filter the grid by Business Partner
   Create a Sales Order for a different Business Partner
   Click on the "Copy from Order" button
   Select an order and click OK

Notice that the following message is showed in the Lines tab:
   Select a parent record in order to view its children here.
   
No tags attached.
has duplicate defect 00212953.0MP15 closed AugustoMauch After create lines from with the grid filtered, the document lines are not correctly refreshed 
related to defect 0021347 closed AugustoMauch Error: Boolean can not be cast to String in Pick and Execute 
related to defect 0021437 closed AugustoMauch The second/third/... lines of sales order do not appear when creating them by process buttons, if the grid is filtered by BP 
diff issue20722.diff (9,031) 2012-07-23 16:52
https://issues.openbravo.com/file_download.php?file_id=5471&type=bug
Issue History
2012-06-11 16:21ngarciaNew Issue
2012-06-11 16:21ngarciaAssigned To => mirurita
2012-06-11 16:21ngarciaModules => Core
2012-06-11 16:21ngarciaResolution time => 1345672800
2012-06-11 16:25miruritaAssigned Tomirurita => jonalegriaesarte
2012-06-12 12:55ngarciaIssue Monitored: networkb
2012-06-21 12:18ioritzCiaAssigned Tojonalegriaesarte => alostale
2012-06-21 12:18ioritzCiaCategory03. Procurement management => A. Platform
2012-07-20 11:19AugustoMauchNote Added: 0050771
2012-07-20 12:34AugustoMauchNote Added: 0050778
2012-07-20 12:49AugustoMauchNote Added: 0050779
2012-07-20 12:49AugustoMauchAssigned Toalostale => AugustoMauch
2012-07-20 12:51AugustoMauchNote Added: 0050780
2012-07-23 10:40rgorisNote Added: 0050790
2012-07-23 16:52AugustoMauchFile Added: issue20722.diff
2012-07-23 16:54AugustoMauchNote Added: 0050797
2012-07-23 16:55AugustoMauchStatusnew => scheduled
2012-07-23 16:55AugustoMauchfix_in_branch => pi
2012-07-23 17:03jonalegriaesarteTarget Version3.0MP14 => 3.0MP15
2012-07-23 17:03jonalegriaesartefix_in_branchpi =>
2012-08-06 08:35hgbotCheckin
2012-08-06 08:35hgbotNote Added: 0051102
2012-08-06 08:35hgbotStatusscheduled => resolved
2012-08-06 08:35hgbotResolutionopen => fixed
2012-08-06 08:35hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/d886ecbd34d679352b46ba22fe368727e5773fe8 [^]
2012-08-06 09:37AugustoMauchRelationship addedhas duplicate 0021295
2012-08-14 13:11AugustoMauchRelationship addedrelated to 0021352
2012-08-14 13:13AugustoMauchRelationship deletedrelated to 0021352
2012-08-14 13:13AugustoMauchRelationship addedrelated to 0021347
2012-08-14 13:16hgbotCheckin
2012-08-14 13:16hgbotNote Added: 0051280
2012-08-14 14:37AugustoMauchNote Added: 0051294
2012-08-14 14:37AugustoMauchStatusresolved => new
2012-08-14 14:37AugustoMauchResolutionfixed => open
2012-08-14 14:37AugustoMauchClosed by => dbaz
2012-08-21 21:53AugustoMauchStatusnew => scheduled
2012-08-21 21:53AugustoMauchfix_in_branch => pi
2012-08-21 21:53AugustoMauchStatusscheduled => resolved
2012-08-21 21:53AugustoMauchResolutionopen => fixed
2012-08-23 13:45dbazRelationship addedrelated to 0021437
2012-08-23 13:50dbazNote Added: 0051503
2012-08-23 13:50dbazStatusresolved => closed
2012-08-23 13:50dbazFixed in Version => 3.0MP15

Notes
(0050771)
AugustoMauch   
2012-07-20 11:19   
When a filter is set, the only visible records will be those filtered, and those created after the filter was set. If the form is reloaded, only those filtered will be visible, the ones created after the filter was set will not be shown.

In the steps to reproduce of this issue, a record with business partner 'A' is created after setting a filter on business partner 'B'. Then, the Copy from Order process is used to add lines to the new record. After this process is executed the grid is refreshed, so only the records that comply with the filter will be shown, making the last one created not visible.
(0050778)
AugustoMauch   
2012-07-20 12:34   
In this line [1] the current row is refreshed and at this point [2] the whole view is refreshed. When it is refreshed, the filter is used to retrieve the rows that will be shown, and the recently created row will not be shown if it does not comply with the filter.

[1] https://code.openbravo.com/erp/devel/pi/file/3da2aed89a8d/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-action-button.js#l172 [^]

[2] https://code.openbravo.com/erp/devel/pi/file/3da2aed89a8d/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-action-button.js#l159 [^]
(0050779)
AugustoMauch   
2012-07-20 12:49   
The view needs to be refreshed in order to show the new order lines.

Proposed solution: add a new flag, keepCurrentRow to ob-standard-view.refresh and to ob-view-grid.refresh. This flag should modify the criteria, so that not only the fields that comply with the filter are retrieved, but also the currently selected one.
(0050780)
AugustoMauch   
2012-07-20 12:51   
This flag would only be used when refreshing the view from the closeProcessPopup function. When the view is refreshed using the refresh button in the status bar, only the filtered rows should be retrieved.
(0050790)
rgoris   
2012-07-23 10:40   
In reply to Augusto´s question below [1]:

RGO: In grid mode it works as intended. When the user inserts a new row, and saves it, it should be visible, even though the column filter would exclude it. A refresh is an deliberate action and will re-apply the filter.

In form mode however, no grid filters should be applied at all. The form mode does not need or want to know about underlying grid filters. So after having saved a new form, no filters are applied. When the form view is closed, filters will be applied to the grid.

For processes (regardless whether they are invoked from grid or form view, and this is the initial issue mentioned by ngarcia) the behavior should be as such that the newly created record is visible until a user-initiated refresh is done. So, it should behave as if a new row was inserted into the grid regularly.

Generic statement: any new or modified record (either by the user or by a process) must be visible after having saved, regardless of filters.



[1] "Hi Rob,

Hi have been talking to Ivan about how the refresh in the grid view should work, and we would like to have your feedback.

This is how it currently works:
1) if the user enters a text in a filter (i.e. 'Hoteles buenas noches' in the business partner field of the header tab of the sales order window), initially only the records that comply with the filter are shown.
2) if the user then adds a new record, but with contents that do not comply with the filter (i.e. a new order with business partner = 'Alimentos y supermercados'), then the visible registers will be those that comply with the filter plus the new one.
3a) if the user then clicks the refresh button, then only the records that comply with the filter will be shown
3b) if the user executes a process (i.e. Copy from order) on the recently created record, the the process is completed there will be an implicit refresh, and the record will not be visible in the grid (see [1]).
I think that 3a) works as intented, but that in 3b) the record that has been used for the process should not dissapear after the process is completed should remain visible. So, the general rule would be:

if the user executes an explicit refresh, only the records that comply with the filter will be shown
after executing a process on a record, that record should remain visible after the implicit refresh is executed.
What do you think? Could you post a note in [1] about how this should work?"
(0050797)
AugustoMauch   
2012-07-23 16:54   
The fix for this issue is risky, because it has required to change the code used to filter the grid records.

The fix will be pushed to pi for mp15, and for now it is available attached to this issue.
(0051102)
hgbot   
2012-08-06 08:35   
Repository: erp/devel/pi
Changeset: d886ecbd34d679352b46ba22fe368727e5773fe8
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Mon Aug 06 08:34:05 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/d886ecbd34d679352b46ba22fe368727e5773fe8 [^]

Fixes issue 20722: Selected record does not dissapear after button processing

When the grid is refreshed due to the execution of a process, the selected record does not dissapear, even if it does not comply with the filter criteria. But, if the user clicks on the Refresh Grid button, the only records that will be shown will be those that match the filter.

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-grid.js
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-action-button.js
---
(0051280)
hgbot   
2012-08-14 13:16   
Repository: erp/devel/pi
Changeset: 0ce5bb9039c27899d455693e3e6895e8f9d345e1
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Tue Aug 14 13:15:32 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/0ce5bb9039c27899d455693e3e6895e8f9d345e1 [^]

Fixes issue 21347: Fixed call to old version of refresh()

In the fix os issue 20722, the signature of the refresh function was added to include a third parameter. There were in the code calls to a previous version of that function, that needed to be updated to support the new signature.

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-window.js
---
(0051294)
AugustoMauch   
2012-08-14 14:37   
Issue reopened to enter Closed by field
(0051503)
dbaz   
2012-08-23 13:50   
This issue strictly fixed what is described in it. But the solution is not complete, so new issue 21437 has been opened.

Anyway this issue is fixed, so I close it.

Reviewed @ changeset: 17752 - f1c506df75cd