Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
5974 Widoki

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
Awatar
Odrzuć
Najlepsza odpowiedź

Convert unicode string to ordinary string before append operation,

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

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
2
sie 22
11640
2
maj 21
8540
2
mar 24
11947
5
wrz 20
6263
1
gru 19
9670