Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIG] Migrate auditlog module from 8.0 to 9.0 #454

Closed
wants to merge 74 commits into from
Closed
Show file tree
Hide file tree
Changes from 71 commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
a7e708e
[MIG] Migrate auditlog module from 8.0 to 9.0
holdenrehg Jun 6, 2016
233bb87
[UPD] Updated the __openerp__.xml to include the license and images f…
holdenrehg Jun 13, 2016
e0284f1
OCA Transbot updated translations from Transifex
oca-transbot Jun 12, 2016
e6eb60d
[IMP] Module 'auditlog' - Add 'name' attributes on some filters and o…
sebalix Jan 22, 2015
bf62fba
[IMP] Module 'auditlog' - Removed the 'timestamp' field from the 'aud…
sebalix Jan 28, 2015
6bdee78
[IMP] Module 'auditlog' - README.rst updated (based on the OCA template)
sebalix Jan 28, 2015
ce173d3
[IMP] ignore rules for nonexisting objects
hbrunn Jan 28, 2015
70cdb3b
[ADD] init hook to migrate from audittrail
hbrunn Jan 28, 2015
e52bab7
[FIX] also migrate id sequences
hbrunn Jan 28, 2015
d06543d
[IMP] Module 'auditlog' - Contributors updated in README.rst + AUTHOR…
sebalix Jan 28, 2015
4536edf
[ADD] change xmlids of legacy rules to point to auditlog.rule
hbrunn Jan 28, 2015
4b2d3ae
[IMP] use new import of _, SUPERUSER_ID
hbrunn Jan 29, 2015
17daf92
[ADD] allow overriding modules to pass additional log values
hbrunn Jan 29, 2015
01b0d2c
[IMP] cache model and field ids
hbrunn Jan 29, 2015
560e0a9
[FIX] don't reset caches in register_hook
hbrunn Jan 29, 2015
12775dd
[ADD] pass old_values to create_log when deleting a record
hbrunn Jan 29, 2015
0337b54
[FIX] cope with no additional log values
hbrunn Jan 29, 2015
9432caa
[ADD] tests
hbrunn Jan 29, 2015
86d0eb7
[FIX] Module 'auditlog' - local variable 'ir_model' is assigned to bu…
sebalix Jan 30, 2015
a89c774
[IMP] use a model for test that is not influenced by the mail module
hbrunn Feb 1, 2015
dd0ce7a
[FIX] Module 'auditlog' - Remove 'active' field from __openerp__.py
sebalix Feb 2, 2015
090dbf0
[IMP] Module 'auditlog' - README.rst updated (inform that the audittr…
sebalix Feb 2, 2015
7394b32
[IMP] Module 'auditlog' - Model 'auditlog.log.line', 'field_name' and…
sebalix Feb 4, 2015
fc5ef54
[IMP] Module 'auditlog' - Added a second test using cached data gener…
sebalix Feb 4, 2015
634396d
[FIX] Module 'auditlog' - Data dictionaries of fields and models are …
sebalix Feb 4, 2015
b6d6e53
[IMP] Module 'auditlog' - Add a test regarding a resource deleted thr…
sebalix Feb 9, 2015
8edd956
[FIX] Module 'auditlog' - When updating a resource, filter IDs on 2ma…
sebalix Feb 9, 2015
f8de9f7
Add OCA as author of OCA addons
gurneyalex Mar 2, 2015
03ca23a
[IMP] Module 'auditlog' - Performing logs on 'read' operations + Some…
sebalix Apr 1, 2015
f5d2955
[FIX] Module 'auditlog' - Replace 'try/except statement by 'isinstanc…
sebalix Apr 2, 2015
d56973d
[FIX] Module 'auditlog' - Support 'read' calls with one ID or a list …
sebalix Apr 2, 2015
af45b9e
[FIX] Module 'auditlog' - Unit tests, do not create users with the 'n…
sebalix Apr 8, 2015
e6b9991
[ADD] German translation for auditlog
eqms Apr 19, 2015
0c92e6f
[FIX] Module 'auditlog' - No log for internal processing (e.g. 'read'…
sebalix Apr 19, 2015
9407428
[FIX] Module 'auditlog' - Fix lint check
sebalix Apr 19, 2015
d8d1972
[IMP] Module 'auditlog' - Unsubscribe rules before removing them + Un…
sebalix Apr 19, 2015
34f4fc5
[FIX] Module 'auditlog' - Log fields coming from polymorphic inherita…
sebalix Apr 19, 2015
48e7ad4
[IMP] Module 'auditlog' - Remove the unit test causing trouble with T…
sebalix Apr 21, 2015
e3fee5b
[ADD] auditlog: Added Spanish translation.
May 17, 2015
785a397
Add bug tracker link on README.rst
yvaucher May 22, 2015
1bc243e
[FIX] ie related fields don't have an
hbrunn Jun 11, 2015
a88f1d4
[ADD] comment
hbrunn Jul 8, 2015
634ad3b
OCA Transbot updated translations from Transifex
oca-transbot Oct 5, 2015
5bb3e60
[UPD] prefix versions with 8.0
sbidoul Oct 9, 2015
da79759
OCA Transbot updated translations from Transifex
oca-transbot Oct 26, 2015
b7f7ff8
[IMP] Module 'auditlog' - Log HTTP user sessions and requests
sebalix Oct 30, 2015
a8d483e
[IMP] Module 'auditlog' - Bump the version to 1.1.0
sebalix Oct 30, 2015
7ad7f2a
[FIX] Module 'auditlog' - Cleanup XML views (types removed)
sebalix Oct 30, 2015
0307e2c
[FIX] Module 'auditlog' - A log can be created with no current HTTP r…
sebalix Oct 30, 2015
994accf
[FIX] Module 'auditlog' - 'display_name' fields added for the user se…
sebalix Oct 31, 2015
ee581f4
[FIX] Module 'auditlog' - Fix pylint check
sebalix Oct 31, 2015
c87a77f
[FIX] turn off prefetching when reding values
hbrunn Nov 26, 2015
a50b37e
OCA Transbot updated translations from Transifex
oca-transbot Nov 30, 2015
c2d26e6
OCA Transbot updated translations from Transifex
oca-transbot Jan 10, 2016
051c8a4
OCA Transbot updated translations from Transifex
oca-transbot Jan 31, 2016
41f8f53
OCA Transbot updated translations from Transifex
oca-transbot Feb 7, 2016
f658107
[IMP] auditlog - Ability to choose the log type on the rule: Full log…
sebalix Feb 1, 2016
dff0551
[FIX] auditlog - Field 'type' renamed to 'log_type'
sebalix Feb 13, 2016
88c3e05
[IMP] auditlog - Bump version number
sebalix Feb 13, 2016
98de1f2
OCA Transbot updated translations from Transifex
oca-transbot Feb 14, 2016
1438434
[IMP] auditlog - Auto-vacuum logs, HTTP requests and HTTP user sessions
sebalix Feb 13, 2016
5c96df5
OCA Transbot updated translations from Transifex
oca-transbot Feb 21, 2016
1ae139e
OCA Transbot updated translations from Transifex
oca-transbot Mar 13, 2016
afcae78
OCA Transbot updated translations from Transifex
oca-transbot Mar 20, 2016
d6539fa
OCA Transbot updated translations from Transifex
oca-transbot Apr 17, 2016
b174a16
OCA Transbot updated translations from Transifex
oca-transbot May 8, 2016
caa9ce3
OCA Transbot updated translations from Transifex
oca-transbot May 15, 2016
d2ec9d2
[IMP] auditlog - Icon added + README updated (screenshots)
sebalix May 26, 2016
27b1d15
OCA Transbot updated translations from Transifex
oca-transbot May 29, 2016
f38edf4
OCA Transbot updated translations from Transifex
oca-transbot Jun 12, 2016
295a36d
[UPD] auditlog module - Merge commit from 8.0
holdenrehg Jun 14, 2016
9eff852
[UPD] auditlog module, Remove duplicate license key from openerp config
holdenrehg Jun 24, 2016
856c84c
[DEL] auditlog: Remove migration from audittrail functionality, this …
holdenrehg Jun 27, 2016
9ebaa60
[DEL] auditlog: Remove pre_init_hook reference from openerp, no pre_i…
holdenrehg Jun 27, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 29 additions & 10 deletions auditlog/README.rst
Original file line number Diff line number Diff line change
@@ -1,29 +1,42 @@
Track user operation on data models
===================================
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3

=================================
Audit Log - Track user operations
=================================

This module allows the administrator to log user operations performed on data
models such as ``create``, ``read``, ``write`` and ``delete``.

Usage
=====

Go to `Reporting / Audit / Rules` to subscribe rules. A rule defines which
Go to `Settings / Technical / Audit / Rules` to subscribe rules. A rule defines which
operations to log for a given data model.
Then, check logs in the `Reporting / Audit / Logs` menu.

During installation, it will migrate any existing data from the `audittrail`
module (rules and logs).
Then, check logs in the `Settings / Technical / Audit / Logs` menu. You can group them by
user sessions, date, data model or HTTP requests:

Get the details:

.. image:: /auditlog/static/description/log.png
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I set all these image URLs in my last PR, but it seems they do not work properly on apps.odoo.com (https://apps.odoo.com/apps/modules/8.0/auditlog/). We should change them to relative ones like static/description/IMAGE.png in order to have them displayed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Relative paths do not work when testing. I'll leave these as absolute for now.


For further information, please visit:
A scheduled action exists to delete logs older than 6 months (180 days)
automatically but is not enabled by default.
To activate it and/or change the delay, go to the
`Configuration / Technical / Automation / Scheduled Actions` menu and edit the
`Auto-vacuum audit logs` entry:

* https://www.odoo.com/forum/help-1
.. image:: /auditlog/static/description/autovacuum.png

During installation, a one-time script will migrate any existing data from the
`audittrail` module (rules and logs).

Known issues / Roadmap
======================

* log only operations triggered by some users (currently it logs all users)
* group logs by HTTP query (thanks to werzeug)?
* group HTTP query by user session?


Bug Tracker
Expand All @@ -43,6 +56,12 @@ Contributors

* Sebastien Alix <sebastien.alix@osiell.com>
* Holger Brunn <hbrunn@therp.nl>
* Holden Rehg <holdenrehg@gmail.com>

Images
------

* Icon: built with different icons from the `Oxygen theme <https://en.wikipedia.org/wiki/Oxygen_Project>`_ (LGPL)

Maintainer
----------
Expand Down
21 changes: 2 additions & 19 deletions auditlog/__init__.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 ABF OSIELL (<http://osiell.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
# © 2015 ABF OSIELL <http://osiell.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import models

Expand Down
31 changes: 10 additions & 21 deletions auditlog/__openerp__.py
Original file line number Diff line number Diff line change
@@ -1,38 +1,27 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 ABF OSIELL (<http://osiell.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
# © 2015 ABF OSIELL <http://osiell.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
'name': "Audit Log",
'version': "8.0.1.0.0",
'version': "9.0.1.0.0",
'author': "ABF OSIELL,Odoo Community Association (OCA)",
'license': "AGPL-3",
'website': "http://www.osiell.com",
'license': 'AGPL-3',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'category': "Tools",
'depends': [
'base',
],
'data': [
'security/ir.model.access.csv',
'data/ir_cron.xml',
'views/auditlog_view.xml',
'views/http_session_view.xml',
'views/http_request_view.xml',
],
'images': [],
'application': True,
'installable': False,
'installable': True,
'pre_init_hook': 'pre_init_hook',
}
18 changes: 18 additions & 0 deletions auditlog/data/ir_cron.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="1">

<record id="ir_cron_auditlog_autovacuum" model="ir.cron">
<field name='name'>Auto-vacuum audit logs</field>
<field name='interval_number'>1</field>
<field name='interval_type'>days</field>
<field name="numbercall">-1</field>
<field name="active" eval="False"/>
<field name="doall" eval="False"/>
<field name="model">auditlog.autovacuum</field>
<field name="function">autovacuum</field>
<field name="args">(180,)</field>
</record>

</data>
</openerp>
Loading