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

We have :

  • task.parent_ids(the project)
  • task.partner_id (the customer)
  • work.task_id

I want something like this in work.view.xml

<field name="task_id.partner_id" modifiers="{}"/>
<field name="task_id.parent_ids" modifiers="{}"/>

But he don't understand task_id.customer and task_id.parent_ids

How can i put this information in tree, calendar or form view ?

아바타
취소
베스트 답변

Use related fields, for eg:

'partner_id': fields.related('task_id','partner_id',type='many2one',relation='res.partner',string='Partner')
아바타
취소
작성자

there is no solution without writing in database ? the information is in database, can't I read it directly ?

Fields related are not stored in DB by default unless parameter store=True is not defined.

작성자

thanks a lot

작성자

another question: how can I set the partner_id field with the project.partner_id field by default ?

You need to use default_get method and update it's result with with value that you need. More reference on http://doc.openerp.com/v6.0/developer/2_5_Objects_Fields_Methods/methods.html

작성자

thanks but I don't understand how to use this method. thanks again

관련 게시물 답글 화면 활동
1
3월 15
10430
0
3월 15
6951
1
8월 21
9442
12
12월 23
44100
6
9월 17
8208