Skip to Content
Menu
This question has been flagged
1 Reply
3206 Views

In Contacts module, when we check data from tree view , Print and Action dropdown menus appeared.We can merge contacts by selecting Action> Merge Selected Contacts.

In my custom module, when we check data from tree view,Action dropdown menus appeared but there is no Merge Selected Contacts.

How can I add this Merge Selected Contacts in my custom .py file and  .xml file.?

Thank you.



Avatar
Discard
Best Answer

Hello Sudarly,

You need to add a act_window in xml.

Example code,

<act_window

id="action_partner_merge"

res_model="base.partner.merge.automatic.wizard"

src_model="res.partner"

target="new"

multi="True"

key2="client_action_multi"

view_mode="form"

name="Merge Selected Contacts"/>

Here,

1. res_model will be your wizard model which you want to popup
2. src_model - It will be the model of the tree view where you want to display this dropdown

3. Add client_action_multi if you want to have multiple selections.

Hope this helps,

Thank You

Avatar
Discard
Author

Thank you so much Burhan Vakharia.It works now.I want to know that for merge function for custom tree view, I have to write my own merge function?I used same res_model but the merge form view for my custom tree view is different from origin merge form view.

Author

If active_model is res.partner, I can get form view that I want.If active_model is another, I cannot get form view that I want.Can I pass active_model like this,

<act_window

id="action_merge_tasks"

name="Merge Tasks"

multi="True"

key2="client_action_multi"

res_model="base.partner.merge.automatic.wizard"

src_model="similar.task"

view_mode="form"

target="new"

view_type="form"

context = "{'active_model':res.partner}"

/>

Related Posts Replies Views Activity
2
Jul 24
942
1
Jun 24
3563
1
Oct 23
8590
1
Oct 23
97
1
Aug 23
2192