Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0037162Openbravo ERPB. User interfacepublic2017-10-25 16:172018-01-03 12:39
inaki_garcia 
caristu 
normalminoralways
closedfixed 
5
main 
3.0PR18Q1 
alostale
Core
No
0037162: [RR17Q4] [AWO] Bad spacing in the Order Line field of a Task record
The Line No. string that is part Order Line field in the More Information section of a Task record has unnecessary spacing preceding it, as shown in the picture.
PRECONDITION
- The AWO (Advanced Warehouse Operation) module must be installed

0. Log in to the backend (ERP) as user Openbravo
1. Create a Purchase Order, and book it
2. Click on the Receive process button, and click on Done. One or more Tasks should be created, depending on the amount of items added to the order
3. Go to the Task window and open a record
4. Click on the More Information section. NOTICE that the value in the Order Line field is displayed with some padding blank spaces

-------------------------------------------------------------------------------
An easier way to reproduce the same:

1. As system admin, go to the [Tables and Columns] table, and navigate to the "C_InvoiceLine" table in the header.
2. Move to the "Columns" subtab and select the "C_OrderLine" column. Change the reference of this column to "TableDir"
3. Recompile and restart tomcat
4. Go to the [Sales Invoice] window and select any invoice already booked.
5. Move to the "Lines" tab, expand the "More Information" window and notice that the problem can be seen in the "Sales Order Line" field.
No tags attached.
png order_line_items_not_correctly_spaced.png (141,262) 2017-10-25 16:17
https://issues.openbravo.com/file_download.php?file_id=11235&type=bug
png

? queryIdentifier.sql (1,022) 2017-11-23 19:30
https://issues.openbravo.com/file_download.php?file_id=11319&type=bug
Issue History
2017-10-25 16:17inaki_garciaNew Issue
2017-10-25 16:17inaki_garciaAssigned To => platform
2017-10-25 16:17inaki_garciaFile Added: order_line_items_not_correctly_spaced.png
2017-10-25 16:17inaki_garciaModules => Core
2017-10-25 16:17inaki_garciaTriggers an Emergency Pack => No
2017-11-23 19:22caristuSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=16369#r16369
2017-11-23 19:28caristuNote Added: 0100692
2017-11-23 19:28caristuSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=16370#r16370
2017-11-23 19:28caristuSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=16371#r16371
2017-11-23 19:29caristuNote Edited: 0100692bug_revision_view_page.php?bugnote_id=0100692#r16373
2017-11-23 19:30caristuFile Added: queryIdentifier.sql
2017-11-23 19:30caristuNote Edited: 0100692bug_revision_view_page.php?bugnote_id=0100692#r16374
2017-11-23 19:30caristuStatusnew => acknowledged
2017-11-24 08:03caristuNote Edited: 0100692bug_revision_view_page.php?bugnote_id=0100692#r16375
2017-11-24 08:03caristuNote Edited: 0100692bug_revision_view_page.php?bugnote_id=0100692#r16376
2017-11-24 08:04caristuNote Edited: 0100692bug_revision_view_page.php?bugnote_id=0100692#r16377
2017-11-24 08:04caristuNote Edited: 0100692bug_revision_view_page.php?bugnote_id=0100692#r16378
2017-11-24 08:12caristuNote Edited: 0100692bug_revision_view_page.php?bugnote_id=0100692#r16379
2017-11-24 08:13caristuSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=16380#r16380
2017-11-24 08:46caristuNote Edited: 0100692bug_revision_view_page.php?bugnote_id=0100692#r16381
2017-11-28 10:18hgbotCheckin
2017-11-28 10:18hgbotNote Added: 0100755
2017-11-28 10:18hgbotStatusacknowledged => resolved
2017-11-28 10:18hgbotResolutionopen => fixed
2017-11-28 10:18hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/67878ed5e392624e7bf35a606c2bbd1390b97305 [^]
2017-11-28 10:18caristuAssigned Toplatform => caristu
2017-11-28 10:18caristuReview Assigned To => alostale
2017-12-01 10:14alostaleNote Added: 0100881
2017-12-01 10:14alostaleStatusresolved => closed
2017-12-01 10:14alostaleFixed in Version => 3.0PR18Q1
2018-01-03 12:39hudsonbotCheckin
2018-01-03 12:39hudsonbotNote Added: 0101466

Notes
(0100692)
caristu   
2017-11-23 19:28   
(edited on: 2017-11-24 08:46)
The problem is caused by the way the identifier is calculated for the Table/TableDir references. The getValueInComboReference() method in the UIDefinition class builds the identifier based on a query like the one attached (queryIdentifier.sql) which adds extra blank spaces to the computed identifier (being in PostgreSQL, not in Oracle).

Note that the following query executed in PostgreSQL is adding some padding blank spaces to the result:

SELECT TO_CHAR(CAST(1 AS INTEGER)) FROM DUAL

This is because this function is defined in the prescript-PostgreSQL.sql to return the result with the following pattern: '999999999999D'.

Note that while this issue is not solved, it can be workarounded by using a search/obuisel_selector reference because using these kind of references the identifiers are generated in a different way: using the IdentifierProvider.

(0100755)
hgbot   
2017-11-28 10:18   
Repository: erp/devel/pi
Changeset: 67878ed5e392624e7bf35a606c2bbd1390b97305
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Tue Nov 28 10:09:09 2017 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/67878ed5e392624e7bf35a606c2bbd1390b97305 [^]

fixes issue 37162: wrong spacing for combo with identifiers that use integers

  Having a table with at least one integer as identifier and a combo reference (Table/TableDir) referencing to that table, fields using that reference were printed with some extra blank spaces.

  This was happening because the integer values were casted and the to_char(integer) function created for PostgresSQL[1] is adding some formatting which causes to print the result with those extra blank spaces.

  To avoid this problem integer identifiers in combo references are handled now in the same way as the rest of numeric references.

[1] https://code.openbravo.com/erp/devel/pi/file/tip/src-db/database/model/prescript-PostgreSql.sql#l272 [^]

---
M src/org/openbravo/reference/ui/UIReferenceUtility.java
---
(0100881)
alostale   
2017-12-01 10:14   
reviewed + tested
(0101466)
hudsonbot   
2018-01-03 12:39   
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/c81e0d3cbab5 [^]
Maturity status: Test