Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
1912 Lượt xem

Is there a way for Odoo 14 Enterprise edition to track activities changes after creation on the chatter of the same related document?.

Want to achieve something like this:

Example of an opportunity stage change:

( - Stage: New -> Contact) [changed the stage of an opportunity in the kanban] 

But for this case it would be:

{User that made the changes} (Hope is like the user doing the changes would be automatically added as the user for a note in the chatter, I believe that that is the native flow)

- Assigned to: {previous_user} -> {new_user}
- Due date: {date_before} -> {new_date}
- etc..

Hope it is understandable.

Thanks in advance,
Rodrigo

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

The Cybrosys answer explains how you can do this with development.

If that's not possible, there is another approach with a computed field.  It's slightly easier if you have Studio, but that's not essential.  

This tracks the delivery address on a sales order

  1. Create a new text field
  2. Set dependencies to be the fields to be tracked
  3. Add Python code to write a log to the new text field


for record in self:
     if record['partner_shipping_id']:
         record['x_studio_history'] = record.name + ' / Delivery address: ' + record.partner_shipping_id.name

Fuller explanation here: https://odootricks.tips/tracking-existing-fields-using-odoo-studio/

It's not the most elegant solution, but it does work!

Ảnh đại diện
Huỷ bỏ
Tác giả

I have managed to do that in other records for their own module, I have tried this way but haven't been able to solve it since mail.activity is a separate model from others, sale.order in your example, and I believe the chatter in that case is connected to sale.order and not mail.activity following your example.

I'll check a workaround doing this maybe with an automated action, but still haven't find a solution for this.

Hi Rodrigo. I think I was misled by the other answer. You want to track the activities that are created for an opportunity. You are right that this can be done with an automated action, but will require some Python code to relate that back to the parent item (e.g. Opportunity). A related answer is here: https://www.odoo.com/forum/help-1/re-studio-automations-for-the-non-programmer-246730/#answer-246730 but need help on the Python code.

Câu trả lời hay nhất

Hi,

To track the changes you can add the attribute tracking=True 

in the field example:

state = fields.Selection(string='Status',  tracking=True, selection=[
            ('open', 'New'),
            ('posted', 'Processing'),
            ('confirm', 'Validated'),
        ])


Hope it helps

Ảnh đại diện
Huỷ bỏ
Tác giả

Mind expanding a lil bit in this?

Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 1 24
1079
0
thg 4 24
1189
1
thg 12 22
2825
How to Hide Chatter Đã xử lý
2
thg 10 20
7809
0
thg 12 19
2101