跳至內容
選單
此問題已被標幟
1 回覆
5631 瀏覽次數

Hi,

I am trying to load mail.message wizard using following code in python file:

return {

  'name': 'Compose Message',

        'type': 'ir.actions.act_window',

        'view_type': 'form',

        'view_mode': 'form',

        'res_model': 'mail.compose.message',

        'domain': [('parent_id', '=',12)],

        'views': [(compose_form_id, 'form')],

        'view_id': compose_form_id,

        'target': 'new',

        'context': ctx,

}

Wizard is opening proper. I need domain filter on partner_ids field and above domain is not working for that. I tried following scenarios:

 'domain': [('parent_id', '=', 12)]

 'domain': [['parent_id', '=', 12]]

 'domain': [('parent_id', '=', 12), ]

But nothing is working out. Can anyone please help me to find the issue. Do I need to specify field name as well where to put that domain. If yes, then how?

頭像
捨棄
最佳答案

Hi
Please try passing parent_id via context.

return {
'name': 'Compose Message',
'type': 'ir.actions.act_window',
'view_type': 'form',
'view_mode': 'form',
'res_model': 'mail.compose.message',
'views': [(compose_form_id, 'form')],
'view_id': compose_form_id,
'target': 'new',
'context': {
'default_parent_id': 12,
},
}

Regards

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
2
3月 16
10171
2
5月 24
3795
2
4月 23
29566
0
7月 19
2891
0
7月 15
4481