Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0022766Openbravo ERPB. User interfacepublic2013-01-10 12:442013-03-04 09:36
caristu 
AugustoMauch 
highminoralways
closedfixed 
5
 
3.0MP213.0MP21 
mtaal
Core
No
0022766: Information is lost when the record is saved with errors
When saving a new record with wrong values in [List Reference] tab of [Reference] window, the information is not saved (see attachment). This forces the user to re-enter again all the information.
As System Admin Role:

1) Go to [Module] window and create a new module. Set it in 'In Development'
2) Go to [Reference] window, in [List Reference] tab insert a new record in grid mode, with the following values:

  - Module: Module created in step 1)
  - Search Key: 000000000100000
  - Name: by campaign

  (With this values the record is not valid because the search key has not the module db_prefix_ sub-string before 000000000100000)

3) Save the record
No tags attached.
png listReference.png (21,380) 2013-01-10 12:46
https://issues.openbravo.com/file_download.php?file_id=5885&type=bug
png

diff issue2276.diff (2,162) 2013-01-30 13:55
https://issues.openbravo.com/file_download.php?file_id=5917&type=bug
Issue History
2013-01-10 12:44caristuNew Issue
2013-01-10 12:44caristuAssigned To => dbaz
2013-01-10 12:44caristuFile Added: listReference.png
2013-01-10 12:44caristuModules => Core
2013-01-10 12:44caristuResolution time => 1362524400
2013-01-10 12:44caristuTriggers an Emergency Pack => No
2013-01-10 12:44caristuFile Deleted: listReference.png
2013-01-10 12:46caristuFile Added: listReference.png
2013-01-10 12:46caristuIssue Monitored: networkb
2013-01-10 12:58caristuSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=4258#r4258
2013-01-10 14:02dbazAssigned Todbaz => AugustoMauch
2013-01-30 13:54AugustoMauchIssue Monitored: mtaal
2013-01-30 13:55AugustoMauchReview Assigned To => mtaal
2013-01-30 13:55AugustoMauchFile Added: issue2276.diff
2013-01-30 13:58jonalegriaesarteTarget Version3.0MP20 => 3.0MP21
2013-01-30 13:59jonalegriaesarteNote Added: 0055973
2013-02-01 08:08mtaalNote Added: 0056033
2013-02-01 09:43AugustoMauchNote Added: 0056038
2013-02-01 09:45mtaalNote Added: 0056039
2013-02-01 12:28AugustoMauchRelationship addedhas duplicate 0022123
2013-02-01 13:35AugustoMauchStatusnew => scheduled
2013-02-01 13:35AugustoMauchfix_in_branch => pi
2013-02-12 13:14AugustoMauchRelationship deletedhas duplicate 0022123
2013-02-12 13:33hgbotCheckin
2013-02-12 13:33hgbotNote Added: 0056394
2013-02-12 13:33hgbotStatusscheduled => resolved
2013-02-12 13:33hgbotResolutionopen => fixed
2013-02-12 13:33hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/66e71edf502a8804809950b477858294ca8bf7d6 [^]
2013-02-20 04:50hudsonbotCheckin
2013-02-20 04:50hudsonbotNote Added: 0056583
2013-03-04 09:36mtaalNote Added: 0056955
2013-03-04 09:36mtaalStatusresolved => closed
2013-03-04 09:36mtaalFixed in Version => 3.0MP21

Notes
(0055973)
jonalegriaesarte   
2013-01-30 13:59   
Moved to MP21 because it needs to be tested in depth. In any case, the patch is attached to test it.
(0056033)
mtaal   
2013-02-01 08:08   
Hi Augusto,
The diff looks fine, but one question. I see this
record['_hasValidationErrors'] = true

but I don't see any code to set it back to false or to remove the hasValidationErrors.

I will close/check the issue again for MP21, okay?

gr. Martin
(0056038)
AugustoMauch   
2013-02-01 09:43   
Thanks Martin.

I saw no need to delete/reset the _hasValidationErrors property because when the record is saved without validation errors that property is no longer present in that record.
(0056039)
mtaal   
2013-02-01 09:45   
Ok, my impression is that the record will stay in memory during the lifetime of the grid/form. But I am not sure...

gr. Martin
(0056394)
hgbot   
2013-02-12 13:33   
Repository: erp/devel/pi
Changeset: 66e71edf502a8804809950b477858294ca8bf7d6
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Tue Feb 12 13:29:13 2013 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/66e71edf502a8804809950b477858294ca8bf7d6 [^]

Fixes issue 22766: Information is not lost when saving a record with errors

The problem was that when a record was saved and in the saving process it was returned with validation errors, the record was being cleared from the grid. This happened because the List
Grid recordHasChanges function returned false (the record had changes indeed, in fact it was not yet saved in the database).

This has been fixed by overwritting the recordHasChanges function, so that it always returns true if the record had validation errors. In that case we can be sure that the record has ch
anges, because we know that a record with validation changes can not be saved in the database.

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
---
(0056583)
hudsonbot   
2013-02-20 04: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/d828167a9e83 [^]

Maturity status: Test
(0056955)
mtaal   
2013-03-04 09:36   
Reviewed