Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0039414Openbravo ERPB. User interfacepublic2018-09-28 11:222018-10-16 10:40
Mozilla Firefox
User Interface Application
0039414: Quantities replaced by line numer (only displayed in window, not in database)
When editing a record with a line number (orderline, inoviceline, inoutline), if the quantity is updated and click on the header (without changing field), the line numer is displayed in the updated quantity.
1. Go to the sales order window, double click on a sale order to go into form view
2. Double click on a sale order line to go in form view
3. Update the quantity on the sale order line and stay on field (no tab or clicking on another field)
4. Click in the sale order header

It saves the quantity and displays the line numer in the updated quantity.

If you change field (tab or click else where) or are not in form view on the header when you click on it, it does not do this.

If you refresh the data, it displays the quantity with what you entered, the information in the database is correct.

The problem is if you go back to the line and change something else and save, the wrong quantity is saved in the database!!!

For me, it does not work on the orders, shipments and invoices (sales and purchases). I didn't try other windows where there is a line number...

It has the same comportment in creation if the last field you enter is the quantity, don't change fields and click on the header (always in form view).

This is a big issue as the quantity can be saved wrong in certain conditions!
No tags attached.
blocks defect 0039373 closed AugustoMauch Quantities replaced by line number (only displayed in window, not in database) 
Issue History
2018-10-05 11:36AugustoMauchTypedefect => backport
2018-10-05 11:36AugustoMauchTarget Version => 3.0PR18Q2.3
2018-10-08 13:30hgbotCheckin
2018-10-08 13:30hgbotNote Added: 0107215
2018-10-08 13:30hgbotStatusscheduled => resolved
2018-10-08 13:30hgbotResolutionopen => fixed
2018-10-08 13:30hgbotFixed in SCM revision => [^]
2018-10-08 14:56AugustoMauchAssigned Toplatform => AugustoMauch
2018-10-08 14:57AugustoMauchReview Assigned To => caristu
2018-10-08 14:57AugustoMauchWeb browserMozilla Firefox => Mozilla Firefox
2018-10-16 10:40caristuNote Added: 0107319
2018-10-16 10:40caristuStatusresolved => closed
2018-10-16 10:40caristuFixed in Version => 3.0PR18Q2.3

2018-10-08 13:30   
Repository: erp/backports/3.0PR18Q2.3
Changeset: dfde2da2f864d4be00317f67f63b6f63680a4bce
Author: Augusto Mauch <augusto.mauch <at>>
Date: Mon Oct 08 13:26:04 2018 +0200
URL: [^]

Fixes issue 39414: Prevents unintended formitem value change if focus changes

There was a problem in this redraw function [1]. It did the following:
1) Get the value of the focused item (this.getFocusItem().getValue())
2) Redraw the form (this.Super('redraw', arguments);)
3) Restore the value of the focused item if the value changed during the redraw (this.getFocusItem().setElementValue(focusItemValue);)

The problem was that under some circumstances the focusedItem itself changed during the redraw, so the form items returned by this.getFocusItem()
in steps 1) and 3) are different, and the value from one form item was copied into another form item.

This problem has been fixed by storing in a variable the focused form item before the step 1), and the use that reference in the rest of the
function instead of reinvoking this.getFocusItem()

[1] [^]

M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js
2018-10-16 10:40   
Code reviewed + tested OK.