Odoo Help


This community 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.


Can't create ir.values with accent in value

on 4/24/14, 11:14 AM 1,281 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.


Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)


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