Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
I have created a custom model, which I also successfully configured in audit trail for create, write & delete operations.
The problem here is when I perform any of such operations through openerp web interface then I can see those operations are being successfully recorded in audit logs. But when I try to do any of such operations through code such as cron/button/xmlrpc webservices or any other areas which will make use of ORM(self.pool.get()) then I see no entries are recorded against auditlogs.
Is there a reason why this is not happening or do I have any unfinished configuration ?
Please let me know if someone faced the same problem or any solutions that someone has got to make it work.
Thanks in Advance.
As you noticed the audittrail module is not working properly in openerp v7, also we have found some others errors and there is an special message for your case in the source code at the file /openerp/osv/osv.py specifically in the function tr that reads:
For your case you need to use something like aspects or weaver like is know in python. I used this library with good results for tasks similar of what you need and also the log auditing is one of the task for what it's designed. The library in question is aspectlib and you could install it from pypi. Here is the docs page http://python-aspectlib.readthedocs.org/
# We try to do the same as the _(), but without the frame
# inspection, since we aready are wrapping an osv function
# trans_obj = self.get('ir.translation') cannot work yet :(
I used and I highly recommend it.
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
About This Community
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 2/9/16, 11:44 PM|
|Seen: 662 times|
|Last updated: 1/10/17, 1:48 AM|