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

While do so I got a error 

2023-10-04 05:43:14,215 13878 DEBUG odoo15 OpenUpgrade: 1 rows affected after 0:00:00.000350 running UPDATE ir_model_data SET module = 'web', name = 'external_layout_striped' WHERE module = 'web' and name = 'external_layout_background' 

2023-10-04 05:43:14,216 13878 DEBUG odoo15 OpenUpgrade: 1 rows affected after 0:00:00.000308 running UPDATE ir_model_data SET module = 'web', name = 'external_layout_bold' WHERE module = 'web' and name = 'external_layout_clean' 

2023-10-04 05:43:14,217 13878 DEBUG odoo15 OpenUpgrade: 1 rows affected after 0:00:00.000311 running UPDATE ir_model_data SET module = 'web', name = 'report_layout_striped' WHERE module = 'web' and name = 'report_layout_background' 

2023-10-04 05:43:14,217 13878 DEBUG odoo15 OpenUpgrade: 1 rows affected after 0:00:00.000236 running UPDATE ir_model_data SET module = 'web', name = 'report_layout_bold' WHERE module = 'web' and name = 'report_layout_clean' 

2023-10-04 05:43:14,256 13878 WARNING odoo15 odoo\\\\.modules\\\\.loading:\\\\ Transient\\\\ module\\\\ states\\\\ were\\\\ reset 

2023\\\\-10\\\\-04\\\\ 05:43:14,261\\\\ 13878\\\\ ERROR\\\\ odoo15\\\\ odoo\\\\.modules\\\\.registry:\\\\ Failed\\\\ to\\\\ load\\\\ registry 

2023\\\\-10\\\\-04\\\\ 05:43:14,262\\\\ 13878\\\\ CRITICAL\\\\ odoo15\\\\ odoo\\\\.service\\\\.server:\\\\ Failed\\\\ to\\\\ initialize\\\\ database\\\\ `odoo15`\\\\. 

Traceback\\\\ \\\\(most\\\\ recent\\\\ call\\\\ last\\\\):

 \\\\ File\\\\ "/opt/odoo15/odoo/service/server\\\\.py",\\\\ line\\\\ 1258,\\\\ in\\\\ preload_registries

 \\\\  \\\\ registry\\\\ =\\\\ Registry\\\\.new\\\\(dbname,\\\\ update_module=update_module\\\\)

 \\\\ File\\\\ "/opt/odoo15/odoo/modules/registry\\\\.py",\\\\ line\\\\ 87,\\\\ in\\\\ new

 \\\\  \\\\ odoo\\\\.modules\\\\.load_modules\\\\(registry,\\\\ force_demo,\\\\ status,\\\\ update_module\\\\)

 \\\\ File\\\\ "/opt/odoo15/odoo/modules/loading\\\\.py",\\\\ line\\\\ 470,\\\\ in\\\\ load_modules

 \\\\  \\\\ processed_modules\\\\ \\\\+=\\\\ load_marked_modules\\\\(cr,\\\\ graph,

 \\\\ File\\\\ "/opt/odoo15/odoo/modules/loading\\\\.py",\\\\ line\\\\ 363,\\\\ in\\\\ load_marked_modules

 \\\\  \\\\ loaded,\\\\ processed\\\\ =\\\\ load_module_graph\\\\(

 \\\\ File\\\\ "/opt/odoo15/odoo/modules/loading\\\\.py",\\\\ line\\\\ 198,\\\\ in\\\\ load_module_graph

 \\\\  \\\\ registry\\\\.setup_models\\\\(cr\\\\)

 \\\\ File\\\\ "/opt/odoo15/odoo/modules/registry\\\\.py",\\\\ line\\\\ 290,\\\\ in\\\\ setup_models

 \\\\  \\\\ model\\\\._setup_fields\\\\(\\\\)

 \\\\ File\\\\ "/opt/odoo15/odoo/models\\\\.py",\\\\ line\\\\ 3049,\\\\ in\\\\ _setup_fields

 \\\\  \\\\ field\\\\.setup\\\\(self\\\\)

 \\\\ File\\\\ "/opt/odoo15/odoo/fields\\\\.py",\\\\ line\\\\ 462,\\\\ in\\\\ setup

 \\\\  \\\\ self\\\\.setup_related\\\\(model\\\\)

 \\\\ File\\\\ "/opt/odoo15/odoo/fields\\\\.py",\\\\ line\\\\ 538,\\\\ in\\\\ setup_related

 \\\\  \\\\ raise\\\\ TypeError\\\\("Type\\\\ of\\\\ related\\\\ field\\\\ %s\\\\ is\\\\ inconsistent\\\\ with\\\\ %s"\\\\ %\\\\ \\\\(self,\\\\ field\\\\)\\\\)

TypeError:\\\\ Type\\\\ of\\\\ related\\\\ field\\\\ base\\\\.document\\\\.layout\\\\.report_header\\\\ is\\\\ inconsistent\\\\ with\\\\ res\\\\.company\\\\.report_header

When\\\\ i\\\\ check\\\\ this\\\\ odoo14\\\\ have\\\\ text\\\\ field\\\\(report_header\\\\)\\\\ in\\\\ base\\\\.document\\\\.layout\\\\ but\\\\ in\\\\ the\\\\ script\\\\ they\\\\ are\\\\ not\\\\ tying\\\\ to\\\\ change\\\\ it\\\\ in\\\\ html\\\\ field\\\\.\\\\.\\\\.\\\\.\\\\.\\\\.



When\\\\ i\\\\ try\\\\ to\\\\ change\\\\ in\\\\ pre_migration\.py\ i\ got\ pysopg2\ error


i\ have changed\ the\ pre_migration\.py\ file\ of\ web\ like\ below

from\ openupgradelib\ import\ openupgrade


rename_xmlids_web\ =\ \[

 \  \ \("web\.external_layout_background",\ "web\.external_layout_striped"\),

 \  \ \("web\.external_layout_clean",\ "web\.external_layout_bold"\),

 \  \ \("web\.report_layout_background",\ "web\.report_layout_striped"\),

 \  \ \("web\.report_layout_clean",\ "web\.report_layout_bold"\),

\]


@openupgrade\.migrate\(use_env=False\)

def\ migrate\(cr,\ version\):

 \  \ openupgrade\.rename_xmlids\(cr,\ rename_xmlids_web\)

 \   

 \  \ openupgrade\.convert_field_to_html\(

 \  \  \  \ cr,\ "base_document_layout",\ "report_footer",\ "report_footer"

 \  \ \)

 \  \ openupgrade\.convert_field_to_html\(

 \  \  \  \ cr,\ "base_document_layout",\ "report_header",\ "report_header"

 \  \ \)


ERROR:

2023\-10\-04\ 06:17:35,449\ 15762\ ERROR\ odoo15\ odoo\.sql_db:\ bad\ query:\ SELECT\ id,\ report_footer\ FROM\ base_document_layout\ WHERE\ report_footer\ IS\ NOT\ NULL

ERROR:\ column\ "report_footer"\ does\ not\ exist

LINE\ 1:\ SELECT\ id,\ report_footer\ FROM\ base_document_layout\ WHERE\ rep\.\.\.

 \  \  \  \  \  \  \  \  \  \^


2023\-10\-04\ 06:17:35,449\ 15762\ ERROR\ odoo15\ OpenUpgrade:\ web:\ error\ in\ migration\ script\ /opt/odoo15/custom\-addons/OpenUpgrade\-15\.0/openupgrade_scripts/scripts/web/15\.0\.1\.0/pre\-migration\.py:\ column\ "report_footer"\ does\ not\ exist

LINE\ 1:\ SELECT\ id,\ report_footer\ FROM\ base_document_layout\ WHERE\ rep\.\.\.

 \  \  \  \  \  \  \  \  \  \^


2023\-10\-04\ 06:17:35,449\ 15762\ ERROR\ odoo15\ OpenUpgrade:\ column\ "report_footer"\ does\ not\ exist

LINE\ 1:\ SELECT\ id,\ report_footer\ FROM\ base_document_layout\ WHERE\ rep\.\.\.

 \  \  \  \  \  \  \  \  \  \^


Traceback\ \(most\ recent\ call\ last\):

 \ File\ "/usr/local/lib/python3\.8/dist\-packages/openupgradelib/openupgrade\.py",\ line\ 2054,\ in\ wrapped_function

 \  \ func\(

 \ File\ "/opt/odoo15/custom\-addons/OpenUpgrade\-15\.0/openupgrade_scripts/scripts/web/15\.0\.1\.0/pre\-migration\.py",\ line\ 14,\ in\ migrate

 \  \ openupgrade\.convert_field_to_html\(

 \ File\ "/usr/local/lib/python3\.8/dist\-packages/openupgradelib/openupgrade\.py",\ line\ 2204,\ in\ convert_field_to_html

 \  \ cr\.execute\(

 \ File\ "",\ line\ 2,\ in\ execute

 \ File\ "/opt/odoo15/odoo/sql_db\.py",\ line\ 89,\ in\ check

 \  \ return\ f\(self,\ \*args,\ \*\*kwargs\)

 \ File\ "/opt/odoo15/odoo/sql_db\.py",\ line\ 310,\ in\ execute

 \  \ res\ =\ self\._obj\.execute\(query,\ params\)

psycopg2\.errors\.UndefinedColumn:\ column\ "report_footer"\ does\ not\ exist

LINE\ 1:\ SELECT\ id,\ report_footer\ FROM\ base_document_layout\ WHERE\ rep\.\.\.

 \  \  \  \  \  \  \  \  \  \^


2023\-10\-04\ 06:17:35,453\ 15762\ WARNING\ odoo15\ odoo\.modules\.loading:\ Transient\ module\ states\ were\ reset 

2023\-10\-04\ 06:17:35,512\ 15762\ ERROR\ odoo15\ odoo\.modules\.registry:\ Failed\ to\ load\ registry 

2023\-10\-04\ 06:17:35,512\ 15762\ CRITICAL\ odoo15\ odoo\.service\.server:\ Failed\ to\ initialize\ database\ `odoo15`\. 

Traceback\ \(most\ recent\ call\ last\):

 \ File\ "/opt/odoo15/odoo/service/server\.py",\ line\ 1258,\ in\ preload_registries

 \  \ registry\ =\ Registry\.new\(dbname,\ update_module=update_module\)

 \ File\ "/opt/odoo15/odoo/modules/registry\.py",\ line\ 87,\ in\ new

 \  \ odoo\.modules\.load_modules\(registry,\ force_demo,\ status,\ update_module\)

 \ File\ "/opt/odoo15/odoo/modules/loading\.py",\ line\ 470,\ in\ load_modules

 \  \ processed_modules\ \+=\ load_marked_modules\(cr,\ graph,

 \ File\ "/opt/odoo15/odoo/modules/loading\.py",\ line\ 363,\ in\ load_marked_modules

 \  \ loaded,\ processed\ =\ load_module_graph\(

 \ File\ "/opt/odoo15/odoo/modules/loading\.py",\ line\ 174,\ in\ load_module_graph

 \  \ migrations\.migrate_module\(package,\ 'pre'\)

 \ File\ "/opt/odoo15/odoo/addons/openupgrade_framework/odoo_patch/odoo/modules/migration\.py",\ line\ 18,\ in\ migrate_module

 \  \ MigrationManager\.migrate_module\._original_method\(self,\ pkg,\ stage\)

 \ File\ "/opt/odoo15/odoo/modules/migration\.py",\ line\ 180,\ in\ migrate_module

 \  \ migrate\(self\.cr,\ installed_version\)

 \ File\ "/usr/local/lib/python3\.8/dist\-packages/openupgradelib/openupgrade\.py",\ line\ 2054,\ in\ wrapped_function

 \  \ func\(

 \ File\ "/opt/odoo15/custom\-addons/OpenUpgrade\-15\.0/openupgrade_scripts/scripts/web/15\.0\.1\.0/pre\-migration\.py",\ line\ 14,\ in\ migrate

 \  \ openupgrade\.convert_field_to_html\(

 \ File\ "/usr/local/lib/python3\.8/dist\-packages/openupgradelib/openupgrade\.py",\ line\ 2204,\ in\ convert_field_to_html

 \  \ cr\.execute\(

 \ File\ "",\ line\ 2,\ in\ execute

 \ File\ "/opt/odoo15/odoo/sql_db\.py",\ line\ 89,\ in\ check

 \  \ return\ f\(self,\ \*args,\ \*\*kwargs\)

 \ File\ "/opt/odoo15/odoo/sql_db\.py",\ line\ 310,\ in\ execute

 \  \ res\ =\ self\._obj\.execute\(query,\ params\)

psycopg2.errors.UndefinedColumn: column "report_footer" does not exist

LINE 1: SELECT id, report_footer FROM base_document_layout WHERE rep...


Is any one know, how to do or what is wrong kindly reply

NOTE: I have only changed the pre_migration.py...

Thanks in Advance

아바타
취소
베스트 답변

Hi,

To resolve the issue, you need to run the following SQL query on your database:

ALTER TABLE base_document_layout ADD COLUMN report_footer TEXT;

After running this query, re-run the specific OpenUpgrade migration, and the issue should be resolved.


Hope it helps

아바타
취소
관련 게시물 답글 화면 활동
0
7월 23
1843
0
5월 23
2073
1
8월 19
4383
1
3월 15
5430
1
5월 25
1811