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

I'm trying to override the list view for Products.  I would like to drop the "Status" column, which appears to be displaying the "state" field from product.template.  I had no problem removing the "Product Type" column, but for "Status", Odoo says:

Error: NameError: name 'state' is not defined

http://localhost:8069/web/static/lib/py.js/lib/py.js:370

The field is listed in the original view, and the column displays just fine.  Looking in the database table, I see that there are no values in the state column (all are null) for all records.  Why can't I remove the column, then?

아바타
취소

It's being called for and if it is not defined (or has been removed) you will get that error. Rather than beat your brains our trying to delete it, just hide is with the invisible attribute in the view Like Ivan suggested below.

베스트 답변

Sometimes the field is needed for other stuff like domain, setting dynamic attributes, etc.  What you can do is to keep the field and make it invisible (put invisible="1" in the field tag).

아바타
취소
작성자

That's what I ended up doing. Was just wondering why Odoo would complain after removing it. Makes sense, if it's being looked at by some other piece of code.

베스트 답변

Hello Jeff,

Suggestion of Ivan is appriaciable. But now first you need to get back that state by updating product module from settings.

Then you can apply the solution given by Ivan.

Regards.

아바타
취소
관련 게시물 답글 화면 활동
1
3월 15
3974
5
6월 20
6935
0
8월 16
3206
1
4월 16
5094
1
6월 15
4537