Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0028466Openbravo ERPA. Platformpublic2014-12-22 17:332015-02-04 20:33
naiaramartinez 
NaroaIriarte 
normalminorhave not tried
closedfixed 
5
 
3.0PR15Q2 
AugustoMauch
Core
No
0028466: Autosave is executed just after creating a new record
Just after clicking in the new button, autosave is executed when all the subtabs of the header tab have display logic.

 
Loggin as system administrator:
   Go to 'window, tabs and fields' and select 'Product' window.
   Deactivate the following tabs:
     - Price
     - Product customer
     - Accounting
     - Costing Rule
     - Substitute
     - Costing
     - Transactions
     - Transaction Costs
     - Purchasing
     - Manufacturing
     - UOM
     - Translation
     - characteristics
     - Characteristics Values
   Select 'Bill of materials' tab and modify its display logic: @C_UOM_ID@='100'

Login as Group Admin
  Go to 'Product' window
  Click on 'new button'

Notice the following error is thrown: Error
One or more fields contain illegal values, check the errors for each field.
No tags attached.
Issue History
2014-12-22 17:33naiaramartinezNew Issue
2014-12-22 17:33naiaramartinezAssigned To => AugustoMauch
2014-12-22 17:33naiaramartinezModules => Core
2014-12-22 17:33naiaramartinezTriggers an Emergency Pack => No
2014-12-23 09:36AugustoMauchSummaryAutosave is executing just click in new button => Autosave is executed just after creating a new record
2014-12-23 09:36AugustoMauchDescription Updatedbug_revision_view_page.php?rev_id=7323#r7323
2014-12-23 09:36AugustoMauchSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=7325#r7325
2014-12-23 09:36AugustoMauchAssigned ToAugustoMauch => NaroaIriarte
2015-01-05 10:55hgbotCheckin
2015-01-05 10:55hgbotNote Added: 0073299
2015-01-05 10:56hgbotCheckin
2015-01-05 10:56hgbotNote Added: 0073300
2015-01-05 10:56hgbotStatusnew => resolved
2015-01-05 10:56hgbotResolutionopen => fixed
2015-01-05 10:56hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/8965d2c4301b9e43c9783864ab0523cb7312c5a1 [^]
2015-01-05 10:59AugustoMauchReview Assigned To => AugustoMauch
2015-01-05 10:59AugustoMauchNote Added: 0073301
2015-01-05 10:59AugustoMauchStatusresolved => closed
2015-01-05 10:59AugustoMauchFixed in Version => 3.0PR15Q2
2015-02-04 20:33hudsonbotCheckin
2015-02-04 20:33hudsonbotNote Added: 0074101
2015-02-04 20:33hudsonbotCheckin
2015-02-04 20:33hudsonbotNote Added: 0074102

Notes
(0073299)
hgbot   
2015-01-05 10:55   
Repository: erp/devel/pi
Changeset: b878d4b1ee9adbd6ce02639cac1870d8a02d9b3b
Author: Naroa Iriarte <naroa.iriarte <at> openbravo.com>
Date: Mon Dec 29 11:13:30 2014 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/b878d4b1ee9adbd6ce02639cac1870d8a02d9b3b [^]

Related with issue 28466: Autosave was executed when creating a new record.

The function "saveEditorReply" of the "ob-view-form.js" class has been changed in order to not
having duplicate code.

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js
---
(0073300)
hgbot   
2015-01-05 10:56   
Repository: erp/devel/pi
Changeset: 8965d2c4301b9e43c9783864ab0523cb7312c5a1
Author: Naroa Iriarte <naroa.iriarte <at> openbravo.com>
Date: Wed Dec 24 16:42:09 2014 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/8965d2c4301b9e43c9783864ab0523cb7312c5a1 [^]

Fixed issue 28466: Autosave was executed when creating a new record.

When a window only has one subtab, and that subtab has a display logic, just after clicking the proper button to create a new
record in the header tab (both in grid and in form mode), the autosave is executed. This happens only the first time that a record is
created.

The problem was in the "updateSubtabVisibility" function of the "ob-standard-view.js".

The problem was that at first, in the function, there was a logic that was not taking into account the fact that if it was the record selected in the header tab has not been saved yet, its subtabs are empty, and it is not neccesary to refresh them.

Before the fix it tried to refresh the subtabs, which resulted in a call to autosave.

For fixing it a new condition has been added to the "updateSubtabVisibility" function. With this new condition
now, the call to the autosave is avoided in the case of the new record.

A new function called "isEditingNewRecord" has been created too. This function returns true if a new record is being edited in the view.

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js
---
(0073301)
AugustoMauch   
2015-01-05 10:59   
Code reviewed and verified in pi@8965d2c4301b
(0074101)
hudsonbot   
2015-02-04 20:33   
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/f36c91d0ad63 [^]
Maturity status: Test
(0074102)
hudsonbot   
2015-02-04 20:33   
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/f36c91d0ad63 [^]
Maturity status: Test