Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
5928 มุมมอง

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')

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
2
ส.ค. 22
11610
2
พ.ค. 21
8503
2
มี.ค. 24
11903
5
ก.ย. 20
6239
Filter field domain one2many to many2one แก้ไขแล้ว
1
ธ.ค. 19
9662