Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0022025Openbravo ERPA. Platformpublic2012-10-22 12:212012-10-31 13:30
ngarcia 
shankarb 
immediatemajoralways
closedfixed 
5
 
3.0MP173.0MP17 
dbaz
Core
No
0022025: A line of an order cannot be saved in grid view when configuring the 2nd UOM
A line of an order cannot be saved in grid view when configuring the 2nd UOM. If you first select a value in the Order UOM field and insert a value in the Order Quantity field and then, change to empty the Order UOM field the record cannot be saved. The obtained error is:

Saving failed. You have filled in Quantity order without selecting a corresponding UOM order , or viceversa. Fill in both fields, or leave them empty
As system admin role:
   Activate the following tabs:
      Product - UOM
      Unit of Measure - Conversion
   and display the following fields:
      Sales/Purchase Order - Lines - Order UOM
      Sales/Purchase Order - Lines - Order Quantity

As group admin role:
   Create a new Unit of Measure and configure a conversion to an existing UOM
   Add this new created UOM to a product with the existing UOM
   Create a sales or purchase order
   Display the Order UOM and Order Quantity columns in grid view
   Add a line to it in grid view:
   Select the UOM in the Order UOM field and add a value in the Order Quantity field
   Check that the converted value has been copied in the Quantity field
   Now, leave empty the Order UOM field (the Order Quantity value will be left empty)
   Try to save the record and notice that you get an error
   
No tags attached.
related to defect 0031901 closed caristu decimal value can't be changed by trigger/observer after manual edition in form view 
diff 22025_2.diff (2,631) 2012-10-25 14:04
https://issues.openbravo.com/file_download.php?file_id=5681&type=bug
Issue History
2012-10-22 12:21ngarciaNew Issue
2012-10-22 12:21ngarciaAssigned To => AugustoMauch
2012-10-22 12:21ngarciaModules => Core
2012-10-22 12:21ngarciaResolution time => 1356217200
2012-10-22 12:22ngarciaIssue Monitored: networkb
2012-10-22 13:16ngarciaResolution time1356217200 => 1350943200
2012-10-22 17:48AugustoMauchAssigned ToAugustoMauch => shankarb
2012-10-24 23:32mtaalFile Added: 22025.diff
2012-10-24 23:35mtaalNote Added: 0053668
2012-10-25 14:03mtaalFile Deleted: 22025.diff
2012-10-25 14:04mtaalFile Added: 22025_2.diff
2012-10-26 00:46shankarbStatusnew => scheduled
2012-10-26 00:46shankarbfix_in_branch => pi
2012-10-26 00:47shankarbReview Assigned To => dbaz
2012-10-26 00:47shankarbfix_in_branchpi =>
2012-10-26 00:48shankarbIssue Monitored: dbaz
2012-10-26 00:59hgbotCheckin
2012-10-26 00:59hgbotNote Added: 0053726
2012-10-26 01:00hgbotStatusscheduled => resolved
2012-10-26 01:00hgbotResolutionopen => fixed
2012-10-26 01:00hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/f786d405627ea5465bb6a330af5aed800790ca6d [^]
2012-10-26 01:01shankarbNote Added: 0053727
2012-10-30 12:58dbazNote Added: 0053815
2012-10-30 12:58dbazStatusresolved => closed
2012-10-30 12:58dbazFixed in Version => 3.0MP17
2012-10-31 13:30hudsonbotCheckin
2012-10-31 13:30hudsonbotNote Added: 0053927
2016-01-19 11:12alostaleRelationship addedrelated to 0031901

Notes
(0053668)
mtaal   
2012-10-24 23:35   
I think the diff solves it. The textual value needs to be set explicitly also when the setValue is called.
Note: setValue is called when the value is changed programmatically, the FormItem also has an updateValue method, this one is called by the UI when the user changes something, that function again calls the changed method.
But this does not apply here (the value is set manually).

If you like the patch, can you test it in different windows, to see if anything changes.

I also changed 2 other lines from setValue to setItemValue, I think this is correct/better as setItemValue also calls other change notification methods which should also be called if the value is set to null.

gr. Martin
(0053726)
hgbot   
2012-10-26 00:59   
Repository: erp/devel/pi
Changeset: f786d405627ea5465bb6a330af5aed800790ca6d
Author: Shankar Balachandran <shankar.balachandran <at> openbravo.com>
Date: Fri Oct 26 00:58:22 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/f786d405627ea5465bb6a330af5aed800790ca6d [^]

Fixes Issue 0022025: Error while saving Order lines.

Error occured when null values was set in numeric fields through callouts. The value was not retained on save. Forced retain for the same. Refactored code to use setItemValue() in ob-view-form.js instead of setValue(), so that null values are handled better.

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js
---
(0053727)
shankarb   
2012-10-26 01:01   
Hi Martin,

The fix works for all the cases that I could think of. I have updated it to pi. Thank you.

Shankar
(0053815)
dbaz   
2012-10-30 12:58   
Reviewed @ changeset: 18367 - 2c82168e2836
(0053927)
hudsonbot   
2012-10-31 13:30   
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/9e773cbcb723 [^]

Maturity status: Test