Odoo Help

Welcome!

This community 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.

0

Audit Trial is not recording entries done through ORM (Python Code)

By
komala kiran kumar. Parepalli
on 2/9/16, 11:44 PM 523 views

Hi Guys,

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.

0

Axel Mendoza

--Axel Mendoza--
10318
| 7 7 8
Camaguey, Cuba
--Axel Mendoza--

DevOps - Full stack - Software Architect - Developer - Technology Integrator

I could help you to develop anything and solve complex problems based on technologies, integrations and tricky stuffs mostly in Python with OpenERP/Odoo, Zato, Django and many others frameworks programming languages and technologies.

I offers consulting services to anyone with an unanswered questions or needs for customizations. Think about it, maybe it's better to have an expert to solve your issues and projects than having a full time employee trying to understand what to do an how

Reach me at aekroft@gmail.com

Axel Mendoza
On 2/10/16, 1:10 AM

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:

# 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 :(

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/
I used and I highly recommend it.


Your Answer

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 community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 2/9/16, 11:44 PM
Seen: 523 times
Last updated: 2/10/16, 1:10 AM