Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
3509 Vizualizări

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.



Imagine profil
Abandonează
Cel mai bun răspuns

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

Imagine profil
Abandonează
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}"

/>

Related Posts Răspunsuri Vizualizări Activitate
2
iul. 24
2280
1
iun. 24
4820
1
oct. 23
10443
1
oct. 23
98
1
aug. 23
2193