Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
88 มุมมอง

Hi,

I'm working on Odoo 18.

Here's my issue: I need to display the activities from the child_ids of a contact in the Chatter component on the contact's view (res.partner).

To do this, I created a computed field all_activity_ids One2Many on res.partner, wich collects all the activities i want to display in the Chatter (including those from child_ids).

In short, i want to replace the default activity_ids field used by Chatter by my custom all_activity_ids, but only on the contact form view.

I thought about overriding activity_ids with the contents of my all_activity_ids, but that doesn't because activity filtrers should not include activities from the child contact.

I've tried different approaches using both JS and XML, but i haven't been able to achieve the expected result.

As a fallback, I also considered adding a second actvity list in the Chatter and disabling the default one for res.partner, but that didn't work either.

I don't know if I was cleared in the explication of my problem.

Does anyone have an idea of how I could achieve this properly ?

Thanks in advance !

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi,


In Odoo 18, the Chatter widget is designed to only display activities (activity_ids) that belong directly to the current record. This makes it difficult to include activities from child contacts (child_ids) when viewing a parent contact. Overriding the existing activity_ids field does not work properly, because it is a core computed field on mail.thread and Odoo relies on it for filters, reminders, and activity domains. If you override it to merge child activities, the built-in logic for things like “My Activities” or overdue activities will no longer function correctly.


To achieve the desired behavior, one option is to create a custom field such as all_activity_ids on res.partner, which combines the partner’s own activities with those of its children. The challenge is that the Chatter component always points to activity_ids by default, so replacing it requires a small JavaScript (OWL) extension to override the Chatter view specifically for partners. This method is the cleanest if you want full integration, but it involves frontend customization.


Another approach is to hide the standard activity list in Chatter for contacts and add a custom widget or section that displays all_activity_ids. This way, you still see the merged activities in the form view, without breaking the default behavior of Chatter. It requires less invasive changes but does mean contacts will have a slightly different layout compared to other models.


As a simpler fallback, you can add a smart button or a new tab on the contact form that shows all activities, combining those from the parent and child contacts. This avoids touching the Chatter at all, is much easier to implement, and still gives end users visibility of everything in one place. In short, if you need deep integration inside Chatter you will need to extend it with JavaScript, but if visibility is enough then a smart button or separate tab is safer and quicker to implement.



Hope it helps

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
พ.ค. 25
1251
Change text of Log Note Button แก้ไขแล้ว
1
ก.ค. 25
606
2
พ.ย. 24
4234
2
พ.ค. 19
5828
1
ก.ย. 24
1410