Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0031749Openbravo ERPA. Platformpublic2015-12-18 13:102015-12-29 22:16
NaroaIriarte 
NaroaIriarte 
normalminoralways
closedfixed 
5
 
 
inigosanchez
Core
No
0031749: When a record is saving a warning is thrown, the message is not correct.
If you create a record and click on "save" and if a callout which has to show a warning is thrown out, the warning message is not correct. It shows "Saving failed" message appended to the original warning message. That is not correct because a warning may not impede to save a record.
1- Create a callout with a simple logic that only shows a warning message.

http://wiki.openbravo.com/wiki/How_to_create_a_Callout [^]

2- Associate the callout to a column.
2.1- As System Admin, go to "Tables and Columns".
2.2- Go to the "Obuiapp_gc_system" table.
2.3- In the "Column" tab, open "Text_filter_behavior" record.
2.4- Fill the "callout" field with the callout you have just created.

3- export the database and compile with smartbuild.
4- As System Admin, go to "Grid configuration at System" window.
5- Create a new record.
6- Go to the "Text filter behavior" field and modify it (this is for throwing the callout).
7- Click on the save button.
8- Realize that the shown message is not correct, the warning shows the "Saving failed" message appended to the warning message. And that is not correct, it is possible to save the record.
The "setMessage" function of the "ob-messagebar.js" has to be modified.
There is a condition which have to be changed

"if ((form && form.isSaving) || (grid && grid.isSaving)) {
 text = OB.I18N.getLabel('OBUIAPP_ErrorSavingFailed') + ' ' + text;
 }"

Here it is necessary to add a logic to avoid showing the "Saving failed" text if it is not an error. For example an info message or as in this example, a warning.
No tags attached.
related to defect 00165083.0MP0 closed iperdomo Remove the light box at all times, the red message bar is enough. 
Issue History
2015-12-18 13:10NaroaIriarteNew Issue
2015-12-18 13:10NaroaIriarteAssigned To => NaroaIriarte
2015-12-18 13:10NaroaIriarteModules => Core
2015-12-18 13:10NaroaIriarteTriggers an Emergency Pack => No
2015-12-18 13:10NaroaIriarteRelationship addedrelated to 0016508
2015-12-18 14:39NaroaIriarteSummaryWhen a record is saved and a callout for showing a warning is thrown, the message is not correct. => When a record is saving a warning is thrown, the message is not correct.
2015-12-21 14:50hgbotCheckin
2015-12-21 14:50hgbotNote Added: 0082885
2015-12-21 14:50hgbotStatusnew => resolved
2015-12-21 14:50hgbotResolutionopen => fixed
2015-12-21 14:50hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/1b4cba742662a131987285c8c35313fd9d444f96 [^]
2015-12-21 16:47NaroaIriarteNote Added: 0082906
2015-12-21 16:47NaroaIriarteReview Assigned To => alostale
2015-12-21 20:21hudsonbotCheckin
2015-12-21 20:21hudsonbotNote Added: 0082912
2015-12-28 14:10inigosanchezReview Assigned Toalostale => inigosanchez
2015-12-29 22:16inigosanchezStatusresolved => closed
2015-12-29 22:16inigosanchezNote Added: 0083065

Notes
(0082885)
hgbot   
2015-12-21 14:50   
Repository: erp/devel/pi
Changeset: 1b4cba742662a131987285c8c35313fd9d444f96
Author: Naroa Iriarte <naroa.iriarte <at> openbravo.com>
Date: Fri Dec 18 14:17:11 2015 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/1b4cba742662a131987285c8c35313fd9d444f96 [^]

fixed issue 31749: The warning message is not correct.

When a warning message had to be shown when saving a record, it was not the proper message.
It showed "Saving failed" text appended to the original warning message.
That was not correct because it was possible to save the record.
To fix this the "setMessage" function of the "ob-messagebar.js" has been changed.
Now, it appends the "Saving failed" message only if the message type is an error.

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-messagebar.js
---
(0082906)
NaroaIriarte   
2015-12-21 16:47   
For testing it:
I have written following code:

this.view.messageBar.setMessage('error', 'test error message', 'test error');


In a block of code where the isSaving is set to true, and I have realized that it works properly when the message which has to be shown is error.

I have tested in my own case, where the warning message needed to be shown too and now it is shown without the "Saving failed" text appended, it works as expected.
(0082912)
hudsonbot   
2015-12-21 20:21   
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/1874af35afc7 [^]
Maturity status: Test
(0083065)
inigosanchez   
2015-12-29 22:16   
Reviewed and tested in pi@64dfe1cd7ea5