Can not create new field and use directly when PO is already initialized

Description

I created a new boolean column and field in the BPartner table (in one Swing Client instance). I tried to use that in another (already running long before) Swing Client instance. I got an error "data is too long for character(1)". The error went away after a restart of the client.

I found out that idempiere tried to write 'Y' instead of Y into the column (Y with quotes). Some debugging brough me to the following analysis:

For some reason (I do not understand exactly) some fields in an PO are "custom" and are stored in m_custom and not in the normal columns array (I guess this happens if I extend a table while the PO has been already in use for it). This is done e.g. from GridTable.java, line 2112. The method "setCustomColumnReturningBoolean" (PO.java, line 1027) writes all the values into it's value storage m_custom in "SQL syntax" (with quotes). Later m_custom is used in doInsert() at line 2903. There the (quoted!) values are given as a parameter to a stored procedure. This call will quote the (quoted) value again.

I think this error did not stand out earlier because it does only shine up if you change a tables structure without restarting the client. I have to admit that I do not fully understand what this m_custom is for and how it is used. I hope someone with more knowledge will step in and think about it.

As far as I see this should also be a problem in zk (and the server is not restarted as often as a desktop client) but I did not try it.

Environment

None

Activity

Show:
Nicolas Micoud
November 12, 2013, 11:17 AM
Edited

Hi,

Issue confirmed on zk : I added a YesNo column on a table using Swing.
I've opened the window in zk, see the new field, fill it. And when trying to save, it fails :

Database Error.: DBExecuteError:ORA-12899: valeur trop grande pour la colonne "database"."tableName"."columnName" (réelle : 3, maximum : 1)

Closing window, resetting cache (using console monitor) solves it.

Regards,

Nicolas

Carlos Ruiz
July 11, 2018, 4:06 PM

Closing - Reset Cache is the correct process after adding/changing dictionary stuff.

Assignee

Unassigned

Reporter

Thomas Bayen

Labels

Tested By

None

Components

Affects versions

Priority

Minor
Configure