Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
3512 Widoki

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.



Awatar
Odrzuć
Najlepsza odpowiedź

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

Awatar
Odrzuć
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}"

/>

Powiązane posty Odpowiedzi Widoki Czynność
2
lip 24
2324
1
cze 24
4844
1
paź 23
10470
1
paź 23
98
1
sie 23
2193