Browse Source

Migrate auditlog module from 8.0 to 9.0

- Update documentation to point to the new auditlog menu locations. These were changed because the 8.0 version was referencing menus that do not exist in 9.0
- Change version from 8.0.X.Y.Z to 9.0.1.0.0
- Make the module installable again
- Remove an unused parameter from pre-migration.py for versioning
- Fix typos and remove commented out blocks of code that were irrelevant
pull/1040/head
Holden Rehg 9 years ago
committed by Enric Tobella
parent
commit
2b66c46794
No known key found for this signature in database GPG Key ID: 1A2546A1B7BA2451
  1. 9
      auditlog/README.rst
  2. 4
      auditlog/__manifest__.py
  3. 2
      auditlog/migrations/8.0.1.0/pre-migration.py
  4. 2
      auditlog/models/rule.py
  5. 11
      auditlog/views/auditlog_view.xml

9
auditlog/README.rst

@ -12,13 +12,13 @@ models such as ``create``, ``read``, ``write`` and ``delete``.
Usage
=====
Go to `Reporting / Audit / Rules` to subscribe rules. A rule defines which
operations to log for a given data model:
Go to `Settings / Technical / Audit / Rules` to subscribe rules. A rule defines
which operations to log for a given data model.
.. image:: /auditlog/static/description/rule.png
Then, check logs in the `Reporting / Audit / Logs` menu. You can group them by
user sessions, date, data model or HTTP requests:
Then, check logs in the `Settings / Technical / Audit / Logs` menu. You can
group them by user sessions, date, data model or HTTP requests:
.. image:: /auditlog/static/description/logs.png
@ -60,6 +60,7 @@ Contributors
* Sebastien Alix <sebastien.alix@osiell.com>
* Holger Brunn <hbrunn@therp.nl>
* Holden Rehg <holdenrehg@gmail.com>
Images
------

4
auditlog/__manifest__.py

@ -4,7 +4,7 @@
{
'name': "Audit Log",
'version': "8.0.1.3.0",
'version': "9.0.1.0.0",
'author': "ABF OSIELL,Odoo Community Association (OCA)",
'license': "AGPL-3",
'website': "http://www.osiell.com",
@ -20,6 +20,6 @@
'views/http_request_view.xml',
],
'application': True,
'installable': False,
'installable': True,
'pre_init_hook': 'pre_init_hook',
}

2
auditlog/migrations/8.0.1.0/pre-migration.py

@ -4,6 +4,6 @@
from openerp.addons.auditlog import migrate_from_audittrail
def migrate(cr, version):
def migrate(cr):
"""if we migrate from an older version, it's a migration from audittrail"""
migrate_from_audittrail(cr)

2
auditlog/models/rule.py

@ -352,7 +352,7 @@ class AuditlogRule(models.Model):
def create_logs(self, uid, res_model, res_ids, method,
old_values=None, new_values=None,
additional_log_values=None):
"""Create logs. `old_values` and `new_values` are dictionnaries, e.g:
"""Create logs. `old_values` and `new_values` are dictionaries, e.g:
{RES_ID: {'FIELD': VALUE, ...}}
"""
if old_values is None:

11
auditlog/views/auditlog_view.xml

@ -3,7 +3,7 @@
<data>
<menuitem id="menu_audit" name="Audit"
parent="base.menu_reporting" sequence="50"
parent="base.menu_custom" sequence="50"
groups="base.group_system"/>
@ -34,15 +34,8 @@
<field name="log_write"/>
<field name="log_unlink"/>
<field name="log_create"/>
<!--<field name="log_action"/>-->
<!--<field name="log_workflow"/>-->
</group>
</group>
<!--
<group string="Users">
<field name="user_ids" nolabel="1"/>
</group>
-->
</sheet>
</form>
</field>
@ -60,8 +53,6 @@
<field name="log_write"/>
<field name="log_unlink"/>
<field name="log_create"/>
<!--<field name="log_action"/>-->
<!--<field name="log_workflow"/>-->
<field name="state"/>
</tree>
</field>

Loading…
Cancel
Save