Skip to Content
Odoo Menu
  • Log ind
  • Prøv gratis
  • Apps
    Økonomi
    • Bogføring
    • Fakturering
    • Udgifter
    • Regneark (BI)
    • Dokumenter
    • e-Signatur
    Salg
    • CRM
    • Salg
    • POS Butik
    • POS Restaurant
    • Abonnementer
    • Udlejning
    Hjemmeside
    • Hjemmesidebygger
    • e-Handel
    • Blog
    • Forum
    • LiveChat
    • e-Læring
    Forsyningskæde
    • Lagerbeholdning
    • Produktion
    • PLM
    • Indkøb
    • Vedligeholdelse
    • Kvalitet
    HR
    • Medarbejdere
    • Rekruttering
    • Fravær
    • Medarbejdersamtaler
    • Anbefalinger
    • Flåde
    Marketing
    • Markedsføring på sociale medier
    • E-mailmarketing
    • SMS-marketing
    • Arrangementer
    • Automatiseret marketing
    • Spørgeundersøgelser
    Tjenester
    • Projekt
    • Timesedler
    • Udkørende Service
    • Kundeservice
    • Planlægning
    • Aftaler
    Produktivitet
    • Dialog
    • Godkendelser
    • IoT
    • VoIP
    • Vidensdeling
    • WhatsApp
    Tredjepartsapps Odoo Studio Odoo Cloud-platform
  • Brancher
    Detailhandel
    • Boghandel
    • Tøjforretning
    • Møbelforretning
    • Dagligvarebutik
    • Byggemarked
    • Legetøjsforretning
    Mad og værtsskab
    • Bar og pub
    • Restaurant
    • Fastfood
    • Gæstehus
    • Drikkevareforhandler
    • Hotel
    Ejendom
    • Ejendomsmægler
    • Arkitektfirma
    • Byggeri
    • Ejendomsadministration
    • Havearbejde
    • Boligejerforening
    Rådgivning
    • Regnskabsfirma
    • Odoo-partner
    • Marketingbureau
    • Advokatfirma
    • Rekruttering
    • Audit & certificering
    Produktion
    • Tekstil
    • Metal
    • Møbler
    • Fødevareproduktion
    • Bryggeri
    • Firmagave
    Heldbred & Fitness
    • Sportsklub
    • Optiker
    • Fitnesscenter
    • Kosmetolog
    • Apotek
    • Frisør
    Håndværk
    • Handyman
    • IT-hardware og support
    • Solenergisystemer
    • Skomager
    • Rengøringsservicer
    • VVS- og ventilationsservice
    Andet
    • Nonprofitorganisation
    • Miljøagentur
    • Udlejning af billboards
    • Fotografi
    • Cykeludlejning
    • Softwareforhandler
    Gennemse alle brancher
  • Community
    Få mere at vide
    • Tutorials
    • Dokumentation
    • Certificeringer
    • Oplæring
    • Blog
    • Podcast
    Bliv klogere
    • Udannelselsesprogram
    • Scale Up!-virksomhedsspillet
    • Besøg Odoo
    Få softwaren
    • Download
    • Sammenlign versioner
    • Udgaver
    Samarbejde
    • Github
    • Forum
    • Arrangementer
    • Oversættelser
    • Bliv partner
    • Tjenester til partnere
    • Registrér dit regnskabsfirma
    Modtag tjenester
    • Find en partner
    • Find en bogholder
    • Kontakt en rådgiver
    • Implementeringstjenester
    • Kundereferencer
    • Support
    • Opgraderinger
    Github Youtube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    Få en demo
  • Prissætning
  • Hjælp

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Bogføring
  • Lager
  • PoS
  • Projekt
  • MRP
All apps
Du skal være registreret for at interagere med fællesskabet.
All Posts People Emblemer
Tags (View all)
odoo accounting v14 pos v15
Om dette forum
Du skal være registreret for at interagere med fællesskabet.
All Posts People Emblemer
Tags (View all)
odoo accounting v14 pos v15
Om dette forum
Hjælp

User and unicode character error.

Tilmeld

Få besked, når der er aktivitet på dette indlæg

Dette spørgsmål er blevet anmeldt
erroruserunicode
6 Besvarelser
25292 Visninger
Avatar
Ricardo Balcácer

There is a problem creating a user with a character that is not in the 7-bit ASCII list inside the login field. For example accented characters in spanish produce the problem. You can create the user the problem arises once you try to access the form of the user again, the following error appears :

...

File "/usr/lib/python2.6/site-packages/openerp-7.0_20130716_231027-py2.6.egg/openerp/addons/auth_signup/res_users.py", line 87, in _get_signup_url_for_action res[partner.id] = urljoin(base_url, "?%s#%s" % (urlencode(query), urlencode(fragment))) File "/usr/lib/python2.6/urllib.py", line 1269, in urlencode v = quote_plus(str(v)) UnicodeEncodeError: 'ascii' codec can't encode character u'\xa1' in position 0: ordinal not in range(128)

0
Avatar
Kassér
Simplify it!

This is a common problem for python. Anyways it's better if you avoid non utf-8 characters.

Avatar
Andres Brigard
Bedste svar

I changed the openerp-server file and inserted these lines in the third line:

import sys
reload(sys)
sys.setdefaultencoding('utf-8')


1
Avatar
Kassér
Giezel Esteves

Thanks Andres. It worked.

Avatar
passat
Bedste svar

Find  in  addons/auth_signup/res_users.py a string 

                fragment['login'] = partner.user_ids[0].login 

and replace it with
                fragment['login'] = partner.user_ids[0].login.encode('utf-8')

 

 

2
Avatar
Kassér
Alejandro Santana

That's what I do in some cases with translated strings.

Avatar
Nishant Kashyap
Bedste svar

Once I got struck on the same error, When I was write a data into the excel file using xlrd python module. you can ignore the string encoded in ascii example:

str = u'\xa56'
print str.encode('ascii')  # If this fails then use next line to ignore
str.encode('ascii','ignore')

You will get the empty string .

But If you still want to use the string value then django smart_str will work.

in Django1.5 smart_text is used. Copy this .py code and put this in your module link text

Then :

from django.utils.encoding import smart_text, smart_unicode,smart_str

smart_text(str)
smart_str(str)
smart_unicode(str)

If you did not able to import the above module then download django zip code link text

get into its directory install django using :

python setup.py install

then open python in shell then use

from django.utils.encoding import smart_text, smart_unicode,smart_str
1
Avatar
Kassér
Ricardo Balcácer
Forfatter

Good point, thank you. I actually tried to use your same solution but with str.encode('utf8') works great quite alright what should be expected. I believe that the error is ocurring because the value of the string is being passed throught the 'str()', not sure if the login is intended to have only 7-bit ascii characters and if so the system shouldn't let you write those characters in the first place or if so then the functions selected should be able to handle UTF-8 out of the box. I already opened a bug in launchpad hope it raises concern. It seems like a simple error that a validation solves

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Tilmeld dig
Related Posts Besvarelser Visninger Aktivitet
Why does it say "Uncaught Record not correctly loaded" When creating password?
password error user
Avatar
Avatar
Avatar
3
mar. 15
9066
Unicode decode error after installation of Odoo V8
error unicode ascii
Avatar
Avatar
Avatar
Avatar
3
mar. 15
9389
Not able to Submit timesheet to my manager.
error manager user timsheet
Avatar
Avatar
1
mar. 15
12567
?"Your country might be blocked by our hosting provider" error when I create new website
error
Avatar
0
okt. 25
460
Payment Page Return Error with Razorpay on Mobile Devices
error
Avatar
0
sep. 25
1095
Community
  • Tutorials
  • Dokumentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Oversættelser
Tjenester
  • Odoo.sh-hosting
  • Support
  • Opgradere
  • Individuelt tilpasset udvikling
  • Uddannelse
  • Find en bogholder
  • Find en partner
  • Bliv partner
Om os
  • Vores virksomhed
  • Brandaktiver
  • Kontakt os
  • Stillinger
  • Arrangementer
  • Podcast
  • Blog
  • Kunder
  • Juridiske dokumenter • Privatlivspolitik
  • Sikkerhedspolitik
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo er en samling open source-forretningsapps, der dækker alle dine virksomhedsbehov – lige fra CRM, e-handel og bogføring til lagerstyring, POS, projektledelse og meget mere.

Det unikke ved Odoo er, at systemet både er brugervenligt og fuldt integreret.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now