Odoo Help


Can't create ir.values with accent in value

on 4/24/14, 11:14 AM 2,053 views

Hi everybody,

I want to create some default value, for that i create an ir.value. When i save my ir.value i have a encoding error:

DataError: invalid byte sequence for encoding "UTF8": 0xe97365

I set this values:

name: note
model: sale.order
value_unpickle: Clause de réserve de propriété: En application de la loi 80-335 du 12 mai 1980, les marchandises livrées demeurent la propriété du vendeur jusqu'au complet règlement de leur prix.

After inspection i found that the method _value_pickle in .ir.values.py won't work correctly:

def _value_pickle(self, cursor, user, id, name, value, arg, context=None):
    if context is None:
        context = {}
    ctx = context.copy()
    if self.CONCURRENCY_CHECK_FIELD in ctx:
        del ctx[self.CONCURRENCY_CHECK_FIELD]
    record = self.browse(cursor, user, id, context=context)
    if record.key == 'default':
        # default values are pickled on the fly
        value = pickle.dumps(value)
    self.write(cursor, user, id, {name[:-9]: value}, context=ctx)

It's exactly the line "value = pickle.dumps(value)" which is the cause.

How i can fix this bug? There is some fix for this? There is the same bug on runbot with 7 version.


About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 4/24/14, 11:14 AM
Seen: 2053 times
Last updated: 3/16/15, 8:10 AM