Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
3510 Vistas

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
Descartar
Mejor respuesta

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
Descartar
Autor

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.

Autor

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

/>

Publicaciones relacionadas Respuestas Vistas Actividad
2
jul 24
2303
1
jun 24
4835
1
oct 23
10459
1
oct 23
98
1
ago 23
2193