Browse Source

[IMP] Module 'auditlog' - Removed the 'timestamp' field from the 'auditlog.log' model (standard 'create_date' field is used instead)

pull/1040/head
sebalix 10 years ago
committed by Enric Tobella
parent
commit
42521d2abb
No known key found for this signature in database GPG Key ID: 1A2546A1B7BA2451
  1. 6
      auditlog/i18n/auditlog.pot
  2. 6
      auditlog/i18n/fr.po
  3. 4
      auditlog/models/log.py
  4. 8
      auditlog/views/auditlog_view.xml

6
auditlog/i18n/auditlog.pot

@ -54,12 +54,6 @@ msgstr ""
msgid "Created on" msgid "Created on"
msgstr "" msgstr ""
#. module: auditlog
#: view:auditlog.log:auditlog.view_auditlog_log_search
#: field:auditlog.log,timestamp:0
msgid "Date"
msgstr ""
#. module: auditlog #. module: auditlog
#: field:auditlog.log.line,field_description:0 #: field:auditlog.log.line,field_description:0
msgid "Description" msgid "Description"

6
auditlog/i18n/fr.po

@ -52,12 +52,6 @@ msgstr ""
#: field:auditlog.log.line,create_date:0 #: field:auditlog.log.line,create_date:0
#: field:auditlog.rule,create_date:0 #: field:auditlog.rule,create_date:0
msgid "Created on" msgid "Created on"
msgstr ""
#. module: auditlog
#: view:auditlog.log:auditlog.view_auditlog_log_search
#: field:auditlog.log,timestamp:0
msgid "Date"
msgstr "Date" msgstr "Date"
#. module: auditlog #. module: auditlog

4
auditlog/models/log.py

@ -27,7 +27,7 @@ from openerp import models, fields
class auditlog_log(models.Model): class auditlog_log(models.Model):
_name = 'auditlog.log' _name = 'auditlog.log'
_description = "Auditlog - Log" _description = "Auditlog - Log"
_order = "timestamp desc"
_order = "create_date desc"
name = fields.Char("Resource Name", size=64) name = fields.Char("Resource Name", size=64)
model_id = fields.Many2one( model_id = fields.Many2one(
@ -36,8 +36,6 @@ class auditlog_log(models.Model):
user_id = fields.Many2one( user_id = fields.Many2one(
'res.users', string=u"User") 'res.users', string=u"User")
method = fields.Char(u"Method", size=64) method = fields.Char(u"Method", size=64)
timestamp = fields.Datetime(
u"Date", default=lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'))
line_ids = fields.One2many( line_ids = fields.One2many(
'auditlog.log.line', 'log_id', string=u"Fields updated") 'auditlog.log.line', 'log_id', string=u"Fields updated")

8
auditlog/views/auditlog_view.xml

@ -107,7 +107,7 @@
<sheet> <sheet>
<group string="Log"> <group string="Log">
<group colspan="1"> <group colspan="1">
<field name="timestamp" required="1" readonly="1"/>
<field name="create_date" readonly="1"/>
<field name="user_id" readonly="1"/> <field name="user_id" readonly="1"/>
<field name="method" readonly="1"/> <field name="method" readonly="1"/>
</group> </group>
@ -150,7 +150,7 @@
<field name="model">auditlog.log</field> <field name="model">auditlog.log</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<tree string="Logs" create="false"> <tree string="Logs" create="false">
<field name="timestamp"/>
<field name="create_date"/>
<field name="name"/> <field name="name"/>
<field name="model_id"/> <field name="model_id"/>
<field name="res_id"/> <field name="res_id"/>
@ -179,9 +179,9 @@
<filter name="group_by_res_id" <filter name="group_by_res_id"
string="Resource ID" string="Resource ID"
domain="[]" context="{'group_by':'res_id'}"/> domain="[]" context="{'group_by':'res_id'}"/>
<filter name="group_by_timestamp"
<filter name="group_by_create_date"
string="Date" string="Date"
domain="[]" context="{'group_by':'timestamp'}"/>
domain="[]" context="{'group_by':'create_date'}"/>
</group> </group>
</search> </search>
</field> </field>

Loading…
Cancel
Save