This question has been flagged
2 Replies
2128 Views

Hi all,


I would like to know if it is possible to have a review about all action did by the employees.

Example of action: Email sent, Phone call with the client, new order, new quotation...

The purpose it is to know easily and fast what employees did during the day.


Thank you,


Selverine


Avatar
Discard

there is the big brother PRISME US programs ;)

Best Answer

Hi,

you can use notifications (add a notification when a new record for the object is created) at the bottom wall of an object , or associated to a field , what you have by example at the bottom of sale order form (log llist of created records, actions), button at the bottom right "Following" which list subtypes to check (all subtypes at menu settings/technical/email/subtypes), add user which can see notifications with button add user (all followers at menu settings/technical/email/followers), All notifications are stored in menu settings/technical/email/message, you can override search to add group by and filters you need.

But all objects have not notification available.


to have notification to add for an object :

inherit some necessary models with to your class:

_inherit = ['mail.thread', 'ir.needaction_mixin']


to display in form view, add at the end of xml definition of the form (between end of balise sheet and form) you can add a group if you do not want users see it:


</sheet>

<div class="oe_chatter">

<field name="message_follower_ids" widget="mail_followers" groups="base.group_user"/>

<field name="message_ids" widget="mail_thread"/>

</div>

</form>


to associate a subtype to a field, use _track, example:


_track = {

     'state': {

         'sale.mt_order_confirmed': lambda self, cr, uid, obj, ctx=None: obj.state in ['manual'],

         'sale.mt_order_sent': lambda self, cr, uid, obj, ctx=None: obj.state in ['sent']

         },

}

I believe it exists an attibute to add in a field definition in view, but can't remember it name ...


OR :

use module smile_log :

https://github.com/Smile-SA/odoo_addons

add menu settings/tecnichal/Logging

add in your python file :


import logging


override functions create, write, unlink for your class and add:

logger = SmileLogger(dbname, model_name, res_id, uid)

logger.info(your_message) # will create a log in db with a unique pid per logger


add group by and filters you need in search view


bye


Avatar
Discard
Author

Sorry to answer right now...I just saw it now...:-(. I will use notification. It looks the best idea ;-). I asked to be able to use PRIME US but they didn't want to give me the code...I don't know why :-)