콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
2 답글
335 화면

When upgrading a custom module to Odoo 19, I get the following error is odoo log:

ValueError: Unicode strings with encoding declaration are not supported. Please use bytes input or XML fragments without declaration.


I have removed the following line from the beginning of the XML files, but still have the same error:

<?xml version="1.0" encoding="utf-8" ?>


Note: I am upgrading from v15 to v19.

What is the fix to such error message?

아바타
취소

A piece of source code would be beneficial to your question's chance of being answered.

The upgrade scripts for Odoo 19 are not yet available except to Odoo Online database deployment and only for testing.

See https://upgrade.odoo.com/

베스트 답변

Hi,


To fix this, ensure that all XML files start directly with <odoo> or <record> and do not include the line <?xml version="1.0" encoding="utf-8"?>. You should also check for invisible BOM characters, which are often added by text editors. Re-save the files using UTF-8 encoding without BOM, preferably in a clean editor like VS Code.


Finally, verify that all XML files listed in the module manifest (__manifest__.py) are properly encoded and do not contain unwanted characters or spaces before the <odoo> tag. Once all files are saved as UTF-8 without BOM, the error will be resolved.


Hope it helps

아바타
취소
베스트 답변

Hello,

<?xml version="1.0" encoding="utf-8" ?>
 I found the space near question mark inside the tag.
Please try below:

<?xml version="1.0" encoding="utf-8"?>

아바타
취소

Not only did OP state he has removed that line, it's also not invalid XML either way.