Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
2741 Visualizzazioni

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

Avatar
Abbandona
Risposta migliore

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!

Avatar
Abbandona
Autore

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.

Risposta migliore

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

Avatar
Abbandona
Autore

Mind expanding a lil bit in this?

Post correlati Risposte Visualizzazioni Attività
0
gen 24
1768
0
apr 24
1794
1
dic 22
3461
2
ott 20
8567
0
dic 19
2636