How the default values within 'ir.values' are supposed to work?

Asked by Lorenzo Battistini

I was trying to modify the default value of field 'taxes_id' of 'product.template'. I found that ir_values contains a row with something like this:

"taxes_id";"default";"";"product.product";"(lp0
L1L
a.";...

I noticed that 'pickle.loads' at line 208 of
http://bazaar.launchpad.net/~openerp/openobject-server/6.0/view/3454/bin/addons/base/ir/ir_values.py#L207
returns the ID of the tax to be loaded as default for 'product.template'

Why the use of pickle?

Why the format

"(lp0
L1L
a."

?

Isn't it editable through OpenERP?

Question information

Language:
English Edit question
Status:
Answered
For:
Odoo Server (MOVED TO GITHUB) Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) said :
#1

Hi Lorenzo,

pickle is the Python serializer. Serialization makes it possible to store field values of every type in the same database column, from boolean to binary. The contents of the database cell is just that, a pickle of the actual default field value.

There does not seem to be a way to edit the values in the OpenERP user interface, which actually surprises me as it might just be possible using an orm_memory wizard and a little bit of model introspection.

Cheers,
Stefan.

Revision history for this message
Mariano Ruiz (marianoruiz) said :
#2

We fix this in https://code.launchpad.net/~eoc/openobject-server/6.1-server_fix_pickle_ir_values

The patch allows saves ``ir_values.value`` field in "pickled" format. Also get results with key2 = '' (before query patch registries only with NULL value was retrieved).

Can you help with this problem?

Provide an answer of your own, or ask Lorenzo Battistini for more information if necessary.

To post a message you must log in.