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

Hello All,

I want to get string form unicode. For this my code is here:

@api.multi

    def _select_service_product(self):

        r = []

        for order in self.order_line:

            res = order.product_id.type_service

            r.append(res)

            self.services_infor = r

            l = self.services_infor

            print "test,,,", res, self.services_infor, l


    services_infor = fields.Char(compute='_select_service_product')


Now terminal showes: 

test,,, d [False, u'a', u'd'] [False, u'a', u'd']

From here i want values a, b
الصورة الرمزية
إهمال
أفضل إجابة

Convert unicode string to ordinary string before append operation,

res = res.encode('ascii','ignore')

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
2
أغسطس 22
11614
2
مايو 21
8504
2
مارس 24
11905
5
سبتمبر 20
6241
1
ديسمبر 19
9663