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

So my problem is that i sometimes get the error "field does not exist in model" when i delete a field in both the python file and the view. I checked that there is no remaining reference to this field and the error i get says somewhere inside the view where i deleted the field. It seems that somehow the old view gets used while the new python file is used to start my odoo server.


I usually solve this error by creating a new database where everything runs fine but i want to solve it without creating a new database. I already tried to execute the reset_arch() function on the view, tried to unlink it with unlink(), delete the view and the field in the database but nothing worked.


Is there anything that could solve this?

아바타
취소
베스트 답변

Hi,
If the database is accessible, you can navigate to the views folder and see if the field existing in any of the views of the corresponding model.

While searching in views, ensure to search inside View Architecture, if you find any views having the field, delete the usage of the field from the view.

If the above doesn't solve the case, consider upgrading module from command line.


Thanks

아바타
취소
베스트 답변

Hello Fr4sha,


When deleting a field , you may notice that some data still remains, which can lead to errors.


To resolve this error, you can run the following command in the terminal:



  psql your_database_name



After that, enter the following command:


  ALTER TABLE table_name DROP COLUMN IF EXISTS column_name;


In this command, please replace table_name with the name of your model (remember to replace any periods with underscores) and column_name with the name of the field you want to delete.


Thanks & Regards,

Email:  odoo@aktivsoftware.com           

Skype: kalpeshmaheshwari

아바타
취소
베스트 답변

Make sure you removed the field from all templates, and functions or methods where you referenced it. 
A simple search could help you identify all the locations you've used your field. 

As a rule of thumb, make sure you are correctly updating the files you changed, when running the server. use "-u all" (update all)  just to be sure


아바타
취소
관련 게시물 답글 화면 활동
4
12월 24
30823
1
3월 15
5346
0
3월 15
3603
1
7월 25
3298
1
12월 24
1560