콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
2 답글
2069 화면
I'm trying to create a contact from his last name, first name and phone number using the ODOO ORM with the "create()" method.
the method used is:

"""
#data for contact record
#values={"":"","":""}
contact_id = self.env['res.partner'].sudo().create(values)
"""

but I am looking for the model structure and the fields of the res.partner to create the data dictionary before calling the method


아바타
취소
베스트 답변


Hi, if you are looking for model structure filtered by model name I think you have 3 good ways:


1) enable 'debug mode', go to menù Settings/Technical/Database Structure/Models.  In the top right side of the screen you can find a Search View where you can filter by Technical name (filter by module name) or filter by model (model name).

One way to discover 'model name' from UI is to look at url and check for 'model=' in the url string. You will see the 'dotted' name of the model. Use it in the 'Search View' in order to filter by model name and find the model structure with list of all stored fields. 


2) enable 'debug mode', simply go to UI form, tree view or the view where you see the field you need to fill, and keep the mouse on it. In debug mode you will se a label appearing al tell you the technical name for the field


3) Use IDE and search for model name (or class) directly in the source code. Due to python and ORM inheritance mechanism this could be a little tricky sometimes, but is often the best way to go if you are well aware of what you are searching for

아바타
취소
작성자 베스트 답변

thank you for the help

아바타
취소