تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
5177 أدوات العرض

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.

Thanks

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
0
مارس 23
1424
4
نوفمبر 18
5935
2
نوفمبر 24
37602
2
سبتمبر 24
3376
2
مارس 25
3684