Se rendre au contenu
Menu
Cette question a été signalée
1 Répondre
3511 Vues

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
Ignorer
Meilleure réponse

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
Ignorer
Auteur

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.

Auteur

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}"

/>

Publications associées Réponses Vues Activité
2
juil. 24
2311
1
juin 24
4838
1
oct. 23
10468
1
oct. 23
98
1
août 23
2193