odoo16 CSV文件问题
-
RPC_ERROR
Odoo Server Error
Traceback (most recent call last):
File "D:\odoo01\odoo-16.0\odoo\http.py", line 1534, in _serve_db
return service_model.retrying(self._serve_ir_http, self.env)
File "D:\odoo01\odoo-16.0\odoo\service\model.py", line 134, in retrying
result = func()
File "D:\odoo01\odoo-16.0\odoo\http.py", line 1563, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File "D:\odoo01\odoo-16.0\odoo\http.py", line 1760, in dispatch
result = self.request.registry['ir.http']._dispatch(endpoint)
File "D:\odoo01\odoo-16.0\odoo\addons\base\models\ir_http.py", line 138, in _dispatch
result = endpoint(**request.params)
File "D:\odoo01\odoo-16.0\odoo\http.py", line 673, in route_wrapper
result = endpoint(self, *args, **params_ok)
File "d:\odoo01\odoo-16.0\addons\web\controllers\dataset.py", line 46, in call_button
action = self._call_kw(model, method, args, kwargs)
File "d:\odoo01\odoo-16.0\addons\web\controllers\dataset.py", line 33, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "D:\odoo01\odoo-16.0\odoo\api.py", line 461, in call_kw
result = _call_kw_multi(method, model, args, kwargs)
File "D:\odoo01\odoo-16.0\odoo\api.py", line 448, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "", line 2, in button_immediate_upgrade
File "D:\odoo01\odoo-16.0\odoo\addons\base\models\ir_module.py", line 75, in check_and_log
return method(self, *args, **kwargs)
File "D:\odoo01\odoo-16.0\odoo\addons\base\models\ir_module.py", line 672, in button_immediate_upgrade
return self._button_immediate_function(type(self).button_upgrade)
File "D:\odoo01\odoo-16.0\odoo\addons\base\models\ir_module.py", line 610, in _button_immediate_function
registry = modules.registry.Registry.new(self._cr.dbname, update_module=True)
File "", line 2, in new
File "D:\odoo01\odoo-16.0\odoo\tools\func.py", line 87, in locked
return func(inst, *args, **kwargs)
File "D:\odoo01\odoo-16.0\odoo\modules\registry.py", line 91, in new
odoo.modules.load_modules(registry, force_demo, status, update_module)
File "D:\odoo01\odoo-16.0\odoo\modules\loading.py", line 478, in load_modules
processed_modules += load_marked_modules(cr, graph,
File "D:\odoo01\odoo-16.0\odoo\modules\loading.py", line 371, in load_marked_modules
loaded, processed = load_module_graph(
File "D:\odoo01\odoo-16.0\odoo\modules\loading.py", line 230, in load_module_graph
load_data(cr, idref, mode, kind='data', package=package)
File "D:\odoo01\odoo-16.0\odoo\modules\loading.py", line 71, in load_data
tools.convert_file(cr, package.name, filename, idref, mode, noupdate, kind)
File "D:\odoo01\odoo-16.0\odoo\tools\convert.py", line 756, in convert_file
convert_csv_import(cr, module, pathname, fp.read(), idref, mode, noupdate)
File "D:\odoo01\odoo-16.0\odoo\tools\convert.py", line 778, in convert_csv_import
fields = next(reader)
File "C:\Users\biao\AppData\Local\Programs\Python\Python38\lib\codecs.py", line 645, in next
line = self.readline()
File "C:\Users\biao\AppData\Local\Programs\Python\Python38\lib\codecs.py", line 558, in readline
data = self.read(readsize, firstline=True)
File "C:\Users\biao\AppData\Local\Programs\Python\Python38\lib\codecs.py", line 504, in read
newchars, decodedbytes = self.decode(data, self.errors)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb9 in position 0: invalid start byte
csv文件报这样的错误应该如何解决? -
@billchen0769 从你贴的错误log来看,应该是csv文件保存的时候不是用的
utf-8
编码。你可以用编辑器比如notepad打开这个文件在保存时将“编码”选择为“UTF-8”另外,下次提问时请您完整的告知你的Odoo的运行环境信息和你所进行的操作,所做的尝试,并提前感谢可能会帮到你的朋友。只有你表现出努力希望获得帮助的态度,才会真正有人愿意花时间来帮你。谢谢!
-
@digitalsatori 明白,另外我在写模块的时候在模型中写了字段就是死活刷不出来,views视图报错说找不到字段,请问应该怎样解决?
-
@billchen0769 你是不是更改了py文件后,没有重启Odoo服务呀。