Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0042051
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] 07. Sales managementminoralways2019-10-17 11:322019-12-12 23:01
ReportergorkaionView Statuspublic 
Assigned Tomarkmm82 
PrioritynormalResolutionfixedFixed in Version3.0PR20Q2
StatusclosedFix in branchFixed in SCM revisionbe648b321403
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned ToSandrahuguet
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0042051: cancel and replace sets messagebar as keepOnAutomaticRefresh even if no message is shown

DescriptionThe cancel and replace functionality adds 2 client event handlers on preSave and preDelete events. On these event handlers the messageBar.keepOnAutomaticRefresh is set to true even if no message is shown.

This flag is used to avoid a message to be automatically removed.

As the flag is enabled the next message shown, even if it is not related to the Cancel and Replace, it is fixed and is not automatically removed.
Steps To Reproduce1. Open developer tools and the generated js file.
2. Search for "ClientSideEventHandlersPreSaveUpdate" and put a breakpoint on the line setting the keepOnAutomaticRefresh true.
3. Search for "ClientSideEventHandlersPreDelete" and put a breakpoint on the line setting the keepOnAutomaticRefresh true.
4. Search for "OBMessageBar.addProperties" and then the hide function that it defines and set a breakpoint on "if (force || !this.keepOnAutomaticRefresh) {" line.
5. Now disable the breakpoints to be able to create a sales order header and line in draft status.
6. Leave the order line tab in grid mode.
7. Enable the breakpoints and edit the line changing the quantity.
8. Notice that it executes several times the hide() function and keepOnAutomaticRefresh is undefined until the cancel and replace event handler is executed and sets it to true. Later new executions of hide() function on the sales order line tab the flag is set as true.
9. Open form view and note that the flag is still set to true in the hide() method.


Alternative steps:
1. Create a Process Definition on Sales Order Line tab that can be executed in draft status and that shows the success message in the lines tab using:
        showMessage.put("showMsgInView", msg);
        responseActions.put(showMessage);
        result.put("responseActions", responseActions);
2. Create a Sales Order and Sales Order Line in draft status.
3. Modify the line in the grid mode.
4. Execute the process definition to show the message.
5. Open the line in form view and check the message is not removed.
6. Close the Sales Order window and open it again.
7. Load in grid view the same Sales Order Line.
8. Without editing the line execute the Process Definition to show the message.
9. Open the line in form view and check that the message is removed.
Proposed SolutionThe keepOnAutomaticRefresh should be set to true only in case the cancelAndReplace EventHandler shows a message.

It is even arguable if the flag needs to be set at all as it is changing the default behavior of any message shown in the application.
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0115237)
markmm82 (developer)
2019-10-23 02:27

Test Plan:
As System Admin set enabled the "Enable Cancel and Replace" preference.
As Group Admin:
  Create a new Sales Order.
  Add a line and complete it.

  Executes Cancel and Replace and Done.
  Notice a success message is shown:
     Process completed successfully
     Order in Temporal Status

  Do any change in lines and execute Confirm Cancel and Replace
  Notice a success message is shown:
     Process completed successfully
(0115281)
hgbot (developer)
2019-10-25 14:06

Repository: erp/devel/pi
Changeset: be648b321403252f2ff9327bc7c2c8fbd0c4b55d
Author: Mark Molina <mark.molina <at> doceleguas.com>
Date: Tue Oct 22 20:40:21 2019 -0300
URL: http://code.openbravo.com/erp/devel/pi/rev/be648b321403252f2ff9327bc7c2c8fbd0c4b55d [^]

Fixes issue 42051: Removed all the keepOnAutomaticRefresh flag activation as it
is not necessary and it is changing the default behavior of any message shown in
the application.

The keepOnAutomaticRefresh was set to true in all the cases inside the cancelAndReplace
EventHandlers, no matter if a message was shown or not, and this causes that next message shown,
even if it is not related to the Cancel and Replace, it is fixed and is not automatically removed.

The keepOnAutomaticRefresh flag is used to avoid a message to be automatically removed but it is
not needed on this functionality and it was removed.

---
M web/js/cancelAndReplace.js
---
(0115282)
Sandrahuguet (developer)
2019-10-25 14:07

code review + testing ok
(0116267)
hudsonbot (developer)
2019-12-12 23:01

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/954d2b7a66fb [^]
Maturity status: Test

- Issue History
Date Modified Username Field Change
2019-10-17 11:32 gorkaion New Issue
2019-10-17 11:32 gorkaion Assigned To => Triage Finance
2019-10-17 11:32 gorkaion Modules => Core
2019-10-17 11:32 gorkaion Triggers an Emergency Pack => No
2019-10-17 11:41 gorkaion Steps to Reproduce Updated View Revisions
2019-10-17 12:03 Sandrahuguet Assigned To Triage Finance => markmm82
2019-10-21 04:26 markmm82 Status new => scheduled
2019-10-23 02:27 markmm82 Note Added: 0115237
2019-10-25 14:06 hgbot Checkin
2019-10-25 14:06 hgbot Note Added: 0115281
2019-10-25 14:06 hgbot Status scheduled => resolved
2019-10-25 14:06 hgbot Resolution open => fixed
2019-10-25 14:06 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/be648b321403252f2ff9327bc7c2c8fbd0c4b55d [^]
2019-10-25 14:07 Sandrahuguet Review Assigned To => Sandrahuguet
2019-10-25 14:07 Sandrahuguet Note Added: 0115282
2019-10-25 14:07 Sandrahuguet Status resolved => closed
2019-10-25 14:07 Sandrahuguet Fixed in Version => 3.0PR20Q2
2019-12-12 23:01 hudsonbot Checkin
2019-12-12 23:01 hudsonbot Note Added: 0116267


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker