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

I am try create a new Module. I define in the first class some columns(type=char) in these are some field names and I want to display these enteries as fields in another class.

But I don't really understand some parts of the following function.

def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False,submenu=False):
    result = super(categories, self).fields_view_get(cr, uid, view_id, view_type, context, toolbar,submenu)

What does the next line do? Can I specify here the classes from where the function will read the fields?

school_obj = self.pool.get('sim.categories')
result['arch']
return result

How can I tell the function to get the fields from a specific class and how can I display the result in a form for debugging and testing?

Can you give me a Module name in which a dynamic field view was already realized? I think in post_return from v6 is something that I want. Is this code compatible to v7 or give it a better solution?

아바타
취소
베스트 답변

You can not display the fields of one class in the view of another class unless and untill you have made inheritance.

So please check you make inheritance of categories (Parent class) if yes then you can directly use XML record to add new fields on the views.

Regards, Mustufa Rangwala

아바타
취소
작성자

Thank you for the reply. I want to create fields dynamic based on entries in the DB. Can you give me an example how I display a result(return) of an function anyway in a form. Maybe in a text field?

작성자

I use the print function to display the result of this function in console. But the result was empty. Can this function build fields out of DB entries in a specific column?

관련 게시물 답글 화면 활동
2
3월 15
4203
2
12월 23
18900
1
2월 22
26232
3
3월 15
7490
1
2월 24
12094