Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0018761Openbravo ERPB. User interfacepublic2011-10-11 18:272011-11-04 13:58
dmitry_mezentsev 
mtaal 
normalminoralways
closedfixed 
5
 
3.0MP5 
Core
No
0018761: There is no way to cancel new record in the form view using menu buttons
Now if you press new in a form and then want to get rid of this new record you need to press Cross icon on the form itself or Esc on the keyboard but Cancel button in the menu is not active (see screenshot).

It is confusing because:
* I personally without this button usually start clicking on another one - save and close and get an error as a response.
* If the record receives all required for it to be saved parameters then pressing Cross does not delete it but closes and saves it. That is a quite a different behavior to cancelling the record by the same button (see above) if no info is introduced into the form.

I also mentioned that the same scenario in grid works as I would expect it :-)
* Cancel button appears.
* If grid contained Cancel button
live.builds.pi (11.10.2011)
* New Sales Invoice
* Mention that Cancel button is not active (see screenshot).
* Enter BP.
* Cancel button appears but if you press it only BP field is cleaned but record is still present.

Repeat the same steps in the grid to compare.
* Cancel in a form should work like Cancel in a grid for freshly created New form and for the form with some parameters entered - delete it if was not saved before.
* Close cross in a form should work like "Save and close" button in a menu.
No tags attached.
has duplicate defect 00188513.0MP5 closed mtaal Save buttons must be disabled when you can´t save 
png 1034311.png (84,311) 2011-10-11 18:27
https://issues.openbravo.com/file_download.php?file_id=4634&type=bug
png

png littleMissX.PNG (1,121) 2011-10-14 10:41
https://issues.openbravo.com/file_download.php?file_id=4643&type=bug
png

png saveandclose.PNG (75,436) 2011-11-02 13:39
https://issues.openbravo.com/file_download.php?file_id=4698&type=bug
png

png close.PNG (44,480) 2011-11-02 13:40
https://issues.openbravo.com/file_download.php?file_id=4699&type=bug
png
Issue History
2011-10-11 18:27dmitry_mezentsevNew Issue
2011-10-11 18:27dmitry_mezentsevAssigned To => rgoris
2011-10-11 18:27dmitry_mezentsevFile Added: 1034311.png
2011-10-11 18:27dmitry_mezentsevModules => Core
2011-10-14 09:36rgorisNote Added: 0041821
2011-10-14 09:36rgorisAssigned Torgoris => mtaal
2011-10-14 09:36rgorisStatusnew => scheduled
2011-10-14 09:36rgorisTarget Version => 3.0MP5
2011-10-14 09:53rgorisNote Added: 0041822
2011-10-14 09:54rgorisIssue Monitored: rgoris
2011-10-14 10:37dmitry_mezentsevNote Added: 0041825
2011-10-14 10:41rgorisFile Added: littleMissX.PNG
2011-10-14 10:43rgorisNote Added: 0041828
2011-10-14 11:27dmitry_mezentsevNote Added: 0041832
2011-10-14 11:43rgorisNote Added: 0041833
2011-10-14 15:48dmitry_mezentsevNote Added: 0041841
2011-10-23 00:13mtaalNote Added: 0041993
2011-10-23 00:13mtaalStatusscheduled => feedback
2011-10-24 15:57rgorisNote Added: 0042070
2011-10-25 10:23mtaalNote Added: 0042084
2011-10-25 10:23mtaalStatusfeedback => new
2011-10-26 18:59mtaalRelationship addedhas duplicate 0018851
2011-10-26 19:36hgbotCheckin
2011-10-26 19:36hgbotNote Added: 0042125
2011-10-26 19:36hgbotStatusnew => resolved
2011-10-26 19:36hgbotResolutionopen => fixed
2011-10-26 19:36hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/f9b05776d6570f5074ff4e112b27ed44bf0f1969 [^]
2011-10-31 17:26rgorisNote Added: 0042419
2011-11-02 10:26hgbotCheckin
2011-11-02 10:26hgbotNote Added: 0042433
2011-11-02 13:20marvintmNote Added: 0042445
2011-11-02 13:38rgorisNote Added: 0042448
2011-11-02 13:39rgorisFile Added: saveandclose.PNG
2011-11-02 13:40rgorisFile Added: close.PNG
2011-11-02 13:40rgorisNote Added: 0042450
2011-11-02 13:41rgorisNote Edited: 0042450bug_revision_view_page.php?bugnote_id=0042450#r2864
2011-11-02 15:58marvintmNote Added: 0042451
2011-11-02 17:03rgorisNote Added: 0042456
2011-11-03 10:03rgorisStatusresolved => closed
2011-11-04 13:56hudsonbotCheckin
2011-11-04 13:56hudsonbotNote Added: 0042571
2011-11-04 13:58hudsonbotCheckin
2011-11-04 13:58hudsonbotNote Added: 0042618

Notes
(0041821)
rgoris   
2011-10-14 09:36   
Agree with Dmitry. Although technically creating a new form does not have any data to be canceled yet (as no fields have been filled in yet), for the user canceling means "abort my current action and go back to where i came from". Pressing the Cancel button to kill a new form is very obvious behavior that must be supported.
(0041822)
rgoris   
2011-10-14 09:53   
So here is the proposed solution
1) let Cancel button kill the new window
2) keep Close button as it is now (kills the new window)
3) let Save&Close button also kill the new window (note that only the little X should be enabled, not the floppy disk icon)
4) Disable the Save button (until something really has changed in the form)
(0041825)
dmitry_mezentsev   
2011-10-14 10:37   
Rob,

Sorry, don´t fully understand you.
>1) let Cancel button kill the new window
>3) let Save&Close button also kill the new window (note that only the little X should be enabled, not the floppy disk icon)
In this case we will have 2 buttons enabled for doing the same? Why? Why couldn't we let Save&Close button to work like it is now but just not show it (as you mentioned) if there are no changes in the form?
(0041828)
rgoris   
2011-10-14 10:43   
Dmitry, the button Save&Close has two appearances: save&close (both floppy and x are enabled) and close (only the x is enabled, see image attached).

In the x-only case it does the same as the big X (close button) in the top right of a window. Right now, this also kills a new window, which is good. So the little x should do the same.

Also, as YOU told me you always clicked the save&close button, we´ll have one more happy user :-)
(0041832)
dmitry_mezentsev   
2011-10-14 11:27   
> Also, as YOU told me you always clicked the save&close button, we´ll have one more happy user :-)
I was primarily clicking on it because Cancel button was not there. If Cancel is there and Save&Close is disabled :-) - I would not.

But what is strange for me as I mentioned above is to have 2 active buttons just near to each other (Save&Close and Cancel) that do the same. For me not very clean but won´t fight for this.
(0041833)
rgoris   
2011-10-14 11:43   
Could be but does not do any harm.

More important is that the big X (top right of window) and the small x (toolbar button)always do the same.
(0041841)
dmitry_mezentsev   
2011-10-14 15:48   
>1) let Cancel button kill the new window
>3) let Save&Close button also kill the new window (note that only the little X should be enabled, not the floppy disk icon)

Did not want to continue but has just came across the case where it does not work OK.
There are some forms which after pressing new contain all the required info to be saved without the need to enter info (ex, Financial Account - Payment Method tab).
In this case Cancel as killing such form - makes sense, but Save&Close button will undermine its own meaning if it also kills it. So we should take this case into account in deciding where Save - cancels and where Save - saves :-).
(0041993)
mtaal   
2011-10-23 00:13   
Rob,
Any final comments on this one?

gr. Martin
(0042070)
rgoris   
2011-10-24 15:57   
Dmitry/Martin

Save&Close button can have two states:
1) It saves and closes (this is when both floppy disk and x are enabled in the button graphic)
2) It only closes (this is when only the x is enabled in the button graphic) because there is nothing to save (no changes). This does exactly the same as the Close button (X).

So in case of Financial Account - Payment Method tab (new record that has all the necessary field values at the start) the Save&Close button will be a real Save&Close button (with both floppy and x enabled in the graphic). To cancel you would click the Cancel button (or the big X close button top right). To save&close you would click the save&close button.

Note that clicking the big close (X) in the top right of the form works as follows: it always saves & closes UNLESS no changes have taken place: in this case it kills the window.
(0042084)
mtaal   
2011-10-25 10:23   
Changes to do:
- save button should be disabled if there are no changes
- save-close should be in close status if there are no changes
- cancel should be enabled if there are no changes, in this case it should abort the form.
(0042125)
hgbot   
2011-10-26 19:36   
Repository: erp/devel/pi
Changeset: f9b05776d6570f5074ff4e112b27ed44bf0f1969
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Wed Oct 26 19:33:38 2011 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/f9b05776d6570f5074ff4e112b27ed44bf0f1969 [^]

Fixes issue 18761: There is no way to cancel new record in the form view using menu buttons
Changed when the cancel button is enabled (always in form mode) with different behavior
Only enable save if all required fields have been set and there are no errors in the form

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-statusbar.js
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-toolbar.js
---
(0042419)
rgoris   
2011-10-31 17:26   
Just tested on live builds pi and we´re almost there. Only (- save-close should be in close status if there are no changes) is not entirely doing what it should.

If you click the little x it should do the same as the big X (close the form even though it cant be saved)
(0042433)
hgbot   
2011-11-02 10:26   
Repository: erp/devel/pi
Changeset: 7445c86c656d83ff4075353bccfe10826442eabb
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Wed Nov 02 10:25:34 2011 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/7445c86c656d83ff4075353bccfe10826442eabb [^]

Related to issue 18761: There is no way to cancel new record in the form view using menu buttons

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-toolbar.js
---
(0042445)
marvintm   
2011-11-02 13:20   
I see a problem with these changes: there are windows in which even if no change was done by the user after creating a record, the current values are correct.

In this case, the system behaves inconsistently. For example, in the Sales Invoice Lines tab, you can create lines without specifying anything. If you create a new line and then click on the close button, the line will not be saved. However, if you create the line, then change the quantity from 1 to 2, and then click on close, the line will be saved.

This is not consistent in my opinion.
(0042448)
rgoris   
2011-11-02 13:38   
marvintm: if you create a new record and the defaults are good (to be saved) and you hit the save&close button, then it will be saved. Note that the button will both have the floppy (save) and the x (close) enabled.

So, summarizing
If the form can´t be saved: only close (only little x enabled)
If the form can be saved: save&close (both little x and floppy enabled)

If only the little x of the save&close button is enabled, then its behavior is exactly the same as when clikcing the big X close button in the top right.
(0042450)
rgoris   
2011-11-02 13:40   
(edited on: 2011-11-02 13:41)
see attached images for the difference. In the last case (close) it should do the same as the close (big X) in the top right of the form, which is abort/cancel, return to grid without creating anything

(0042451)
marvintm   
2011-11-02 15:58   
I didn't explain myself well enough. After the changes Martin did, the following happens:

- If you create a Sales Invoice Line in form view, and immediately click on the gray "x" button (the one shown in the first screenshot), the line is _not_ saved
- If you create a Sales Invoice Line in form view, change the quantity to 2, and click on the gray "x" button, the line IS saved.

This behaviour complies with the description Martin wrote in the comment 0042084, but in my opinion is clearly inconsistent, because the line was perfectly correct in both cases, and therefore it should have been saved in both.
(0042456)
rgoris   
2011-11-02 17:03   
Correct but this has is related to the behavior of the form-close (big gray X) button and not the little x.

The little x now tries to save, this is not good. So first let´s fix this behavior (last image). The little X must cancel/abort the form creation.

The other case you mention can be fixed later, can you open a separate issue for that?
(0042571)
hudsonbot   
2011-11-04 13:56   
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/d10da320df2a [^]

Maturity status: Test
(0042618)
hudsonbot   
2011-11-04 13:58   
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/d10da320df2a [^]

Maturity status: Test