コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
9286 ビュー

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
10415
0
3月 15
6904
1
8月 21
9431
12
12月 23
44053
6
9月 17
8172