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
No known key found for this signature in database
GPG Key ID: 1A2546A1B7BA2451
5 changed files with
10 additions and
18 deletions
auditlog/README.rst
auditlog/__manifest__.py
auditlog/migrations/8.0.1.0/pre-migration.py
auditlog/models/rule.py
auditlog/views/auditlog_view.xml
@ -12,13 +12,13 @@ models such as ``create``, ``read``, ``write`` and ``delete``.
Usage
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
.. 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
.. image :: /auditlog/static/description/logs.png
@ -60,6 +60,7 @@ Contributors
* Sebastien Alix <sebastien.alix@osiell.com>
* Sebastien Alix <sebastien.alix@osiell.com>
* Holger Brunn <hbrunn@therp.nl>
* Holger Brunn <hbrunn@therp.nl>
* Holden Rehg <holdenrehg@gmail.com>
Images
Images
------
------
@ -4,7 +4,7 @@
{
{
' name ' : " Audit Log " ,
' name ' : " Audit Log " ,
' version ' : " 8.0.1.3 .0" ,
' version ' : " 9.0.1.0 .0" ,
' author ' : " ABF OSIELL,Odoo Community Association (OCA) " ,
' author ' : " ABF OSIELL,Odoo Community Association (OCA) " ,
' license ' : " AGPL-3 " ,
' license ' : " AGPL-3 " ,
' website ' : " http://www.osiell.com " ,
' website ' : " http://www.osiell.com " ,
@ -20,6 +20,6 @@
' views/http_request_view.xml ' ,
' views/http_request_view.xml ' ,
] ,
] ,
' application ' : True ,
' application ' : True ,
' installable ' : Fals e,
' installable ' : Tru e,
' pre_init_hook ' : ' pre_init_hook ' ,
' pre_init_hook ' : ' pre_init_hook ' ,
}
}
@ -4,6 +4,6 @@
from openerp.addons.auditlog import migrate_from_audittrail
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 """
""" if we migrate from an older version, it ' s a migration from audittrail """
migrate_from_audittrail ( cr )
migrate_from_audittrail ( cr )
@ -352,7 +352,7 @@ class AuditlogRule(models.Model):
def create_logs ( self , uid , res_model , res_ids , method ,
def create_logs ( self , uid , res_model , res_ids , method ,
old_values = None , new_values = None ,
old_values = None , new_values = None ,
additional_log_values = None ) :
additional_log_values = None ) :
""" Create logs. `old_values` and `new_values` are dictionn aries, e.g:
""" Create logs. `old_values` and `new_values` are dictionaries, e.g:
{ RES_ID : { ' FIELD ' : VALUE , . . . } }
{ RES_ID : { ' FIELD ' : VALUE , . . . } }
"""
"""
if old_values is None :
if old_values is None :
@ -3,7 +3,7 @@
<data >
<data >
<menuitem id= "menu_audit" name= "Audit"
<menuitem id= "menu_audit" name= "Audit"
parent="base.menu_reporting " sequence="50"
parent="base.menu_custom " sequence="50"
groups="base.group_system"/>
groups="base.group_system"/>
@ -34,15 +34,8 @@
<field name= "log_write" />
<field name= "log_write" />
<field name= "log_unlink" />
<field name= "log_unlink" />
<field name= "log_create" />
<field name= "log_create" />
<!-- <field name="log_action"/> -->
<!-- <field name="log_workflow"/> -->
</group>
</group>
</group>
</group>
<!--
<group string= "Users" >
<field name= "user_ids" nolabel= "1" />
</group>
-->
</sheet>
</sheet>
</form>
</form>
</field>
</field>
@ -60,8 +53,6 @@
<field name= "log_write" />
<field name= "log_write" />
<field name= "log_unlink" />
<field name= "log_unlink" />
<field name= "log_create" />
<field name= "log_create" />
<!-- <field name="log_action"/> -->
<!-- <field name="log_workflow"/> -->
<field name= "state" />
<field name= "state" />
</tree>
</tree>
</field>
</field>