[6.1] audit_trail module does not record one2many fields

Bug #903160 reported by Hiren Vora
38
This bug affects 6 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Committed
Low
Savoir-faire Linux' OpenERP

Bug Description

I have installed audit_trail module and made audit rule for purchase.order and purchase.order.line object for create,write and unlink method. Also I have subscribed both rules.

Now, i have made a purchase order with 2 lines of products in it.

Now again I have open that purchase order (obviously now that purchase order is in write mode) and made a change in one of purchase order line's requested "Quantity" and "UOM" fields.

After that I have seen the audit logs for both objects. I was not able to see the log of changed values of "Quantity" and "UOM" in purchase.order.line object.

Is this bug in openerp?

Thanks in Advance.

Related branches

Revision history for this message
Vishal Parmar(Open ERP) (vpa-openerp) wrote :

Hello Hiren Vora,

I have checked your issue with updated code of trunk but I didn't face any problem as you have.
Would you please see attached video and informed us where you faced the problem.

Thanks and waiting for your reply.

Revision history for this message
Vishal Parmar(Open ERP) (vpa-openerp) wrote :
Changed in openobject-addons:
status: New → Incomplete
Revision history for this message
Hiren Vora (hiren-p) wrote :

Hello Vishal,

The video file that you have attach is working perfectly. But the same thing is not happening at my side. Let me attach a video file just like you have attached.

Thanks for quick response.

Revision history for this message
Vishal Parmar(Open ERP) (vpa-openerp) wrote :

Hello,

This issue is working fine with Trunk version. But I have face the same problem with stable 6 so I am assigning this issue to OPW team.

Thank.

Changed in openobject-addons:
assignee: nobody → OpenERP Publisher's Warranty Team (openerp-opw)
importance: Undecided → Low
status: Incomplete → Confirmed
Revision history for this message
Hiren Vora (hiren-p) wrote :

Hello Vishal,

Can you tell me from which trunk branch I can get the working "audittrail" module? If possible then can you write down the launchpad branch code? so that I can directly download from there.

Thanks in advance.

Revision history for this message
Vishal Parmar(Open ERP) (vpa-openerp) wrote :

Hello Hiren Vora,

If you want to try with trunk version the you can download from following link:

https://code.launchpad.net/~openerp/openobject-addons/trunk

Thanks.

Revision history for this message
Ferdinand (office-chricar) wrote :

I was setting an audit create/write/delete on "sale order" and "sale order line"
and got this on save of a new SOL

 File "/home/srv/openerp/instances/trunk/openobject-server/openerp/service/netrpc_server.py", line 62, in run
    result = netsvc.dispatch_rpc(msg[0], msg[1], msg[2:])
  File "/home/srv/openerp/instances/trunk/openobject-server/openerp/netsvc.py", line 325, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/home/srv/openerp/instances/trunk/openobject-server/openerp/service/web_services.py", line 580, in dispatch
    res = fn(db, uid, *params)
  File "/home/srv/openerp/instances/trunk/openobject-server/openerp/osv/osv.py", line 120, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/home/srv/openerp/instances/trunk/openobject-server/openerp/osv/osv.py", line 172, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/srv/openerp/instances/trunk/openobject-addons/audittrail/audittrail.py", line 494, in execute_cr
    return self.log_fct(cr, uid, model, method, fct_src, *args)
  File "/srv/openerp/instances/trunk/openobject-addons/audittrail/audittrail.py", line 300, in log_fct
    self.process_data(cr, uid_orig, pool, res_ids, model, method, old_values, new_values, field_list)
  File "/srv/openerp/instances/trunk/openobject-addons/audittrail/audittrail.py", line 441, in process_data
    lines = self.prepare_audittrail_log_line(cr, uid, pool, model, res_id, method, old_values, new_values, field_list)
  File "/srv/openerp/instances/trunk/openobject-addons/audittrail/audittrail.py", line 408, in prepare_audittrail_log_line
    if key not in old_values or key not in new_values or old_values[key]['value'][field_name] != new_values[key]['value'][field_name]:
KeyError: 'id'

Revision history for this message
tnbui (tnbui-it) wrote :

Hello,

Do you have any updates on this bug?

Revision history for this message
saad thaifa (saad-thaifa) wrote :

Hello,
I have the same bug when I try to modify a meeting in calendar view :

2012-03-21 17:31:03,493 4332 ERROR ? openerp.osv.osv: Uncaught exception
Traceback (most recent call last):
  File "/home/saad/b2s_server/openerp/osv/osv.py", line 121, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/home/saad/b2s_server/openerp/osv/osv.py", line 176, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/home/saad/b2s_server/openerp/addons/audittrail/audittrail.py", line 516, in execute_cr
    return self.log_fct(cr, uid, model, method, fct_src, *args, **kw)
  File "/home/saad/b2s_server/openerp/addons/audittrail/audittrail.py", line 305, in log_fct
    self.process_data(cr, uid_orig, pool, res_ids, model, method, old_values, new_values, field_list)
  File "/home/saad/b2s_server/openerp/addons/audittrail/audittrail.py", line 463, in process_data
    lines = self.prepare_audittrail_log_line(cr, uid, pool, model, res_id, method, old_values, new_values, field_list)
  File "/home/saad/b2s_server/openerp/addons/audittrail/audittrail.py", line 430, in prepare_audittrail_log_line
    if key not in old_values or key not in new_values or old_values[key]['value'][field_name] != new_values[key]['value'][field_name]:
KeyError: 'duration'

Revision history for this message
Hiren Vora (hiren-p) wrote :

Hello,

Is there any updates on this bug?

Revision history for this message
Hiren Vora (hiren-p) wrote :

Hello Vishal

You have written as follows,

" Hello,

This issue is working fine with Trunk version. But I have face the same problem with stable 6 so I am assigning this issue to OPW team.

Thank.
"

Is there any update on this ????

summary: - audit_trail module does not records logs the 0ne2many fields
+ [6.1] audit_trail module does not record one2many fields
Changed in openobject-addons:
status: Confirmed → Fix Committed
assignee: OpenERP Publisher's Warranty Team (openerp-opw) → Savoir-faire Linux' OpenERP (savoirfairelinux-openerp)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.