Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0028505Openbravo ERPA. Platformpublic2014-12-31 10:192015-02-04 20:33
AugustoMauch 
AugustoMauch 
highminorhave not tried
closedfixed 
5
 
3.0PR15Q1 
alostale
Core
No
0028505: Document Number field has different length in grid and form view
The document number field of the header tab of the Sales Order window has a differente length in the form view (30) and in the grid view (20). The length of the documentno column in the c_order table is 30.

This disparity is a problem when a record with a document number longer than 30 characters is edited in grid view, because only its first 20 characters will be saved
As F&B Admin:
- Open the Sales Order window
- Create a new record in form view and save.
- Modify the document number of the record and set this: 012345678901234567890123456789 (30 characters).
- Save the record and go back to the grid view.
- Edit the record in grid view. See that only the first 20 characters are shown. Modify any other field and save. See that the document number has been truncated without you modifying it.
No tags attached.
Issue History
2014-12-31 10:19AugustoMauchNew Issue
2014-12-31 10:19AugustoMauchAssigned To => AugustoMauch
2014-12-31 10:19AugustoMauchModules => Core
2014-12-31 10:19AugustoMauchTriggers an Emergency Pack => No
2014-12-31 10:19AugustoMauchNote Added: 0073285
2014-12-31 10:20AugustoMauchNote Edited: 0073285bug_revision_view_page.php?bugnote_id=0073285#r7372
2014-12-31 10:21AugustoMauchResolution time => 1421794800
2014-12-31 12:32AugustoMauchNote Added: 0073288
2014-12-31 13:59daniOpenbravoIssue Monitored: daniOpenbravo
2014-12-31 13:59daniOpenbravoIssue Monitored: malsasua
2015-01-07 10:27AugustoMauchNote Added: 0073324
2015-01-07 10:27AugustoMauchSeveritymajor => minor
2015-01-07 12:42AugustoMauchIssue Monitored: alostale
2015-01-07 12:54AugustoMauchReview Assigned To => alostale
2015-01-07 12:54hgbotCheckin
2015-01-07 12:54hgbotNote Added: 0073329
2015-01-07 12:54hgbotStatusnew => resolved
2015-01-07 12:54hgbotResolutionopen => fixed
2015-01-07 12:54hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/2722f629170e8d1426ebc21dfe5dbfef57508274 [^]
2015-01-12 12:08alostaleNote Added: 0073414
2015-01-12 12:08alostaleStatusresolved => closed
2015-01-12 12:08alostaleFixed in Version => 3.0PR15Q1
2015-02-04 20:33hudsonbotCheckin
2015-02-04 20:33hudsonbotNote Added: 0074117

Notes
(0073285)
AugustoMauch   
2014-12-31 10:19   
(edited on: 2014-12-31 10:20)
This is the document number field definition included in the view definition:

{name:'documentNo',id:'1081',title:'Document No.',required:true,columnName:'DocumentNo',inpColumnName:'inpdocumentno',"length":30,gridProps:{sort:2,showHover:true,length:20,displaylength:10},type:'_id_10'}

See that the field length is 30 in the form view but 20 in the grid view.

(0073288)
AugustoMauch   
2014-12-31 12:32   
Problem caused in this changeset [1], that hardcodes the document number grid length to 20

[1] https://code.openbravo.com/erp/devel/pi/rev/ae5c327c567f#l3.14 [^]
(0073324)
AugustoMauch   
2015-01-07 10:27   
Updated to minor since it only happens in the Document Number field, and it has been working that way since the beginning of Openbravo 3.0
(0073329)
hgbot   
2015-01-07 12:54   
Repository: erp/devel/pi
Changeset: 2722f629170e8d1426ebc21dfe5dbfef57508274
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Wed Jan 07 12:42:34 2015 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/2722f629170e8d1426ebc21dfe5dbfef57508274 [^]

Fixes issue 28505: Document number field length is not always hardcoded to 20

In this changeset [1], that was included in the first release of Openbravo 3.0, the length of the document number field length for the grids is hardcoded to 20. The length of the form field is taken from the length of the column in the application dictionary.

Having a different length in the grid and form fields resulted in the value of the field being truncated when it is edited in the view with the shortest length. It is not possible to remove the hardcoded code because it is possible that some Openbravo instances depend on it (i.e. if the length of the document number column is set to 0). In order to fix this issue, now the hardcoded code only affects the fields whose length is 0. For all the other cases, the length of the grid field will be taken from the length of the column.

[1] https://code.openbravo.com/erp/devel/pi/rev/ae5c327c567f#l3.14 [^]

---
M modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/StringUIDefinition.java
---
(0073414)
alostale   
2015-01-12 12:08   
code reviewed

tested
(0074117)
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