Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
9311 มุมมอง

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

Related Posts ตอบกลับ มุมมอง กิจกรรม
1
มี.ค. 15
10431
0
มี.ค. 15
6955
1
ส.ค. 21
9443
How to auto refresh view? แก้ไขแล้ว
12
ธ.ค. 23
44106
6
ก.ย. 17
8208