Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
3 Trả lời
2333 Lượt xem

Hi, i installed odoo 10 community on windows OS a couple of days ago and I noticed that when I try to make a purchase order on the purchase module the system does not allow me to make the order with substentional amount (for example 10 000 euro) – a window (connection error) pops up in the right corner of the screen. Could you please tell me if there is something wrong that I have done or there is a bug with the module

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi,

your error is a problem of string encoding (you are using a special caracter somewhere) :

  File "C:\Odoo10\server\odoo\addons\purchase\models\purchase.py", line 188, in name_get

  File "C:\Odoo10\server\odoo\tools\misc.py", line 1182, in formatLang

  File "C:\Odoo10\server\odoo\addons\base\res\res_lang.py", line 263, in format

UnicodeDecodeError: 'ascii' codec can't decode byte 0xa0 in position 2: ordinal not in range(128)

the fonction called where you have the error is name_get, see the code here line 181 :

https://github.com/odoo/odoo/blob/10.0/addons/purchase/models/purchase.py


so, verify values for fields Order reference, Vendor Reference, currency name (probally, problem with formatlang line 188 ), check for spécial caracter / symbol.

note that the currency name should be ISO 4217, see field name line 20 in the file here:

https://github.com/odoo/odoo/blob/10.0/odoo/addons/base/res/res_currency.py


regards

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

Hello,

thank you  for the advice. this si the log:

2018-10-12 06:45:22,401 3780 ERROR 123 odoo.http: Exception during JSON request handling.

Traceback (most recent call last):

  File "C:\Odoo10\server\odoo\http.py", line 642, in _handle_exception

  File "C:\Odoo10\server\odoo\http.py", line 684, in dispatch

  File "C:\Odoo10\server\odoo\http.py", line 334, in _call_function

  File "C:\Odoo10\server\odoo\service\model.py", line 101, in wrapper

  File "C:\Odoo10\server\odoo\http.py", line 327, in checked_call

  File "C:\Odoo10\server\odoo\http.py", line 942, in __call__

  File "C:\Odoo10\server\odoo\http.py", line 507, in response_wrap

  File "C:\Odoo10\server\odoo\addons\web\controllers\main.py", line 895, in call_kw

  File "C:\Odoo10\server\odoo\addons\web\controllers\main.py", line 887, in _call_kw

  File "C:\Odoo10\server\odoo\api.py", line 687, in call_kw

  File "C:\Odoo10\server\odoo\api.py", line 672, in call_kw_model

  File "C:\Odoo10\server\odoo\addons\purchase\models\purchase.py", line 196, in create

  File "C:\Odoo10\server\odoo\addons\mail\models\mail_thread.py", line 233, in create

  File "C:\Odoo10\server\odoo\addons\mail\models\mail_thread.py", line 1886, in message_post

  File "C:\Odoo10\server\odoo\addons\mail\models\mail_message.py", line 740, in create

  File "C:\Odoo10\server\odoo\addons\mail\models\mail_message.py", line 696, in _get_record_name

  File "C:\Odoo10\server\odoo\addons\purchase\models\purchase.py", line 188, in name_get

  File "C:\Odoo10\server\odoo\tools\misc.py", line 1182, in formatLang

  File "C:\Odoo10\server\odoo\addons\base\res\res_lang.py", line 263, in format

UnicodeDecodeError: 'ascii' codec can't decode byte 0xa0 in position 2: ordinal not in range(128)

2018-10-12 06:45:22,401 3780 ERROR 123 odoo.http: Exception during JSON request handling.

Traceback (most recent call last):

  File "C:\Odoo10\server\odoo\http.py", line 642, in _handle_exception

  File "C:\Odoo10\server\odoo\addons\base\ir\ir_http.py", line 195, in _dispatch

  File "C:\Odoo10\server\odoo\http.py", line 700, in dispatch

  File "C:\Odoo10\server\odoo\http.py", line 662, in _handle_exception

  File "C:\Odoo10\server\odoo\http.py", line 630, in _json_response

  File "json\__init__.pyc", line 244, in dumps

  File "json\encoder.pyc", line 207, in encode

  File "json\encoder.pyc", line 270, in iterencode

UnicodeDecodeError: 'utf8' codec can't decode byte 0xa0 in position 2: invalid start byte

2018-10-12 06:45:22,457 3780 INFO 123 werkzeug: 10.10.15.1 - - [12/Oct/2018 06:45:22] "POST /web/dataset/call_kw/purchase.order/create HTTP/1.1" 500 -

2018-10-12 06:45:22,467 3780 ERROR 123 werkzeug: Error on request:

Traceback (most recent call last):

  File "werkzeug\serving.py", line 177, in run_wsgi

    

  File "werkzeug\serving.py", line 165, in execute

    

  File "C:\Odoo10\server\odoo\service\server.py", line 245, in app

    return self.app(e, s)

  File "C:\Odoo10\server\odoo\service\wsgi_server.py", line 186, in application

    return application_unproxied(environ, start_response)

  File "C:\Odoo10\server\odoo\service\wsgi_server.py", line 172, in application_unproxied

    result = handler(environ, start_response)

  File "C:\Odoo10\server\odoo\http.py", line 1326, in __call__

    return self.dispatch(environ, start_response)

  File "C:\Odoo10\server\odoo\http.py", line 1300, in __call__

    return self.app(environ, start_wrapped)

  File "werkzeug\wsgi.py", line 579, in __call__

    

  File "C:\Odoo10\server\odoo\http.py", line 1499, in dispatch

    result = ir_http._dispatch()

  File "C:\Odoo10\server\odoo\addons\web_editor\models\ir_http.py", line 21, in _dispatch

    return super(IrHttp, cls)._dispatch()

  File "C:\Odoo10\server\odoo\addons\base\ir\ir_http.py", line 199, in _dispatch

    return cls._handle_exception(e)

  File "C:\Odoo10\server\odoo\addons\base\ir\ir_http.py", line 169, in _handle_exception

    return request._handle_exception(exception)

  File "C:\Odoo10\server\odoo\http.py", line 662, in _handle_exception

    return self._json_response(error=error)

  File "C:\Odoo10\server\odoo\http.py", line 630, in _json_response

    body = json.dumps(response)

  File "json\__init__.py", line 244, in dumps

    

  File "json\encoder.py", line 207, in encode

    

  File "json\encoder.py", line 270, in iterencode

    

UnicodeDecodeError: 'utf8' codec can't decode byte 0xa0 in position 2: invalid start byte

2018-10-12 06:45:24,486 3780 INFO 123 werkzeug: 10.10.15.1 - - [12/Oct/2018 06:45:24] "POST /web/webclient/version_info HTTP/1.1" 200 -

could you please tell me if this is a bug in the purchase module or i  made some mistake during installation.

thank you in advance.

best regards,
Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

you can check the log file for better understand

Ảnh đại diện
Huỷ bỏ