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

I'm working on an import engine from my old ERP to Odoo. I see that (as for every model) there's a name field for project.project (I see this by viewing the Project edit page in developer mode, and placing my cursor over the Project Name field). Here's what shows:

Field: name
Object: project.project
Type: char
Modifiers: {"required": true}

However when I open the project.project table in pgAdmin there's no name column. 

I also linked to the same database tables through Access and encountered the same issue.

Can anyone help me out with this, why don't I see the name field?

아바타
취소
베스트 답변

Hi Michael,

in v8 project,project is inheriting  from account.analytic.account all its fields. You can see it by "_inherits = {'account.analytic.account': "analytic_account_id" }" . The inheritance mechanism that is used there is called delegation inheritance. You can read about that in https://www.odoo.com/documentation/8.0/reference/orm.html under point: "Inheritance and extension".


So when you see the box that shows "Field: name, Object: project.project" then in reality that field is from account.analytic.account. You can look up the name in pgadmin by first checking the id of field analytic_account_id in project.project. By this id you can look up the account,analytic.account record.
In the end, the name field is defined in: addons/analytic/analytic.py  at line 175 with: "'name': fields.char('Account/Contract Name', required=True, track_visibility='onchange').

You may ask yourself, why in project view, you see "Project Name" and not Account/Contract Name. This is because in the view definition of project.project, the string is separately set by:
<field name="name" string="Project Name"/>

아바타
취소
작성자

Excellent Gregor, Thank you so much! I see exactly what you're describing now. Glad you knew this, it doesn't seem that obvious. Much appreciated - Thanks again!

관련 게시물 답글 화면 활동
1
7월 16
4739
0
6월 25
211
0
3월 23
1828
List view 해결 완료
1
2월 25
1106
1
2월 24
1445