[ADD]: audittrail: product backlog -621 :Apply log detail for action in audittrail
bzr revid: ksa@tinyerp.co.in-20100531135133-jhbej4htfiqfj5fe
This commit is contained in:
+217
-71
@@ -25,6 +25,7 @@ from tools.translate import _
|
||||
import ir
|
||||
import pooler
|
||||
import time
|
||||
import tools
|
||||
|
||||
class audittrail_rule(osv.osv):
|
||||
"""
|
||||
@@ -33,25 +34,28 @@ class audittrail_rule(osv.osv):
|
||||
_name = 'audittrail.rule'
|
||||
_description = "Audittrail Rule"
|
||||
_columns = {
|
||||
"name": fields.char("Rule Name", size=32, required=True),
|
||||
"object_id": fields.many2one('ir.model', 'Object', required=True),
|
||||
"user_id": fields.many2many('res.users', 'audittail_rules_users',
|
||||
'user_id', 'rule_id', 'Users', help="if User is not added then it will applicable for all users"),
|
||||
"log_read": fields.boolean("Log reads"),
|
||||
"log_write": fields.boolean("Log writes"),
|
||||
"log_unlink": fields.boolean("Log deletes"),
|
||||
"log_create": fields.boolean("Log creates"),
|
||||
"state": fields.selection((("draft", "Draft"),
|
||||
("subscribed", "Subscribed")),
|
||||
"State", required=True),
|
||||
"action_id": fields.many2one('ir.actions.act_window', "Action ID"),
|
||||
"name": fields.char("Rule Name", size=32, required=True),
|
||||
"object_id": fields.many2one('ir.model', 'Object', required=True),
|
||||
"user_id": fields.many2many('res.users', 'audittail_rules_users',
|
||||
'user_id', 'rule_id', 'Users', help="if User is not added then it will applicable for all users"),
|
||||
"log_read": fields.boolean("Log Reads"),
|
||||
"log_write": fields.boolean("Log Writes"),
|
||||
"log_unlink": fields.boolean("Log Deletes"),
|
||||
"log_create": fields.boolean("Log Creates"),
|
||||
"log_action": fields.boolean("Log Action"),
|
||||
"log_workflow": fields.boolean("Log Workflow"),
|
||||
"state": fields.selection((("draft", "Draft"),
|
||||
("subscribed", "Subscribed")),
|
||||
"State", required=True),
|
||||
"action_id": fields.many2one('ir.actions.act_window', "Action ID"),
|
||||
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'state': lambda *a: 'draft',
|
||||
'log_create': lambda *a: 1,
|
||||
'log_unlink': lambda *a: 1,
|
||||
'log_write': lambda *a: 1,
|
||||
'state': lambda *a: 'draft',
|
||||
'log_create': lambda *a: 1,
|
||||
'log_unlink': lambda *a: 1,
|
||||
'log_write': lambda *a: 1,
|
||||
}
|
||||
|
||||
_sql_constraints = [
|
||||
@@ -65,7 +69,7 @@ class audittrail_rule(osv.osv):
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param ids: List of Auddittrail Rule’s IDs.
|
||||
@return: True
|
||||
@return: True
|
||||
"""
|
||||
obj_action = self.pool.get('ir.actions.act_window')
|
||||
obj_model = self.pool.get('ir.model.data')
|
||||
@@ -74,13 +78,13 @@ class audittrail_rule(osv.osv):
|
||||
obj = self.pool.get(thisrule.object_id.model)
|
||||
if not obj:
|
||||
raise osv.except_osv(
|
||||
_('WARNING: audittrail is not part of the pool'),
|
||||
_('WARNING: audittrail is not part of the pool'),
|
||||
_('Change audittrail depends -- Setting rule as DRAFT'))
|
||||
self.write(cr, uid, [thisrule.id], {"state": "draft"})
|
||||
val = {
|
||||
"name": 'View Log',
|
||||
"res_model": 'audittrail.log',
|
||||
"src_model": thisrule.object_id.model,
|
||||
"name": 'View Log',
|
||||
"res_model": 'audittrail.log',
|
||||
"src_model": thisrule.object_id.model,
|
||||
"domain": "[('object_id','=', " + str(thisrule.object_id.id) + "), ('res_id', '=', active_id)]"
|
||||
|
||||
}
|
||||
@@ -98,7 +102,7 @@ class audittrail_rule(osv.osv):
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param ids: List of Auddittrail Rule’s IDs.
|
||||
@return: True
|
||||
@return: True
|
||||
"""
|
||||
obj_action = self.pool.get('ir.actions.act_window')
|
||||
val_obj = self.pool.get('ir.values')
|
||||
@@ -128,16 +132,19 @@ class audittrail_log(osv.osv):
|
||||
_description = "Audittrail Log"
|
||||
|
||||
_columns = {
|
||||
"name": fields.char("Name", size=32),
|
||||
"object_id": fields.many2one('ir.model', 'Object'),
|
||||
"user_id": fields.many2one('res.users', 'User'),
|
||||
"method": fields.selection((('read', 'Read'),
|
||||
('write', 'Write'),
|
||||
('unlink', 'Delete'),
|
||||
('create', 'Create')), "Method"),
|
||||
"timestamp": fields.datetime("Date"),
|
||||
"res_id": fields.integer('Resource Id'),
|
||||
"line_ids": fields.one2many('audittrail.log.line', 'log_id', 'Log lines'),
|
||||
"name": fields.char("Name", size=32),
|
||||
"object_id": fields.many2one('ir.model', 'Object'),
|
||||
"user_id": fields.many2one('res.users', 'User'),
|
||||
"method": fields.selection((('read', 'Read'),
|
||||
('write', 'Write'),
|
||||
('unlink', 'Delete'),
|
||||
('create', 'Create'),
|
||||
('action','Action'),
|
||||
('workflow','Workflow')), "Method"),
|
||||
"timestamp": fields.datetime("Date"),
|
||||
"res_id": fields.integer('Resource Id'),
|
||||
"method_name": fields.char("Method Name", size=32),
|
||||
"line_ids": fields.one2many('audittrail.log.line', 'log_id', 'Log lines'),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
@@ -155,14 +162,14 @@ class audittrail_log_line(osv.osv):
|
||||
_name = 'audittrail.log.line'
|
||||
_description = "Log Line"
|
||||
_columns = {
|
||||
'field_id': fields.many2one('ir.model.fields', 'Fields', required=True),
|
||||
'log_id': fields.many2one('audittrail.log', 'Log'),
|
||||
'log': fields.integer("Log ID"),
|
||||
'old_value': fields.text("Old Value"),
|
||||
'new_value': fields.text("New Value"),
|
||||
'old_value_text': fields.text('Old value Text'),
|
||||
'new_value_text': fields.text('New value Text'),
|
||||
'field_description': fields.char('Field Description', size=64),
|
||||
'field_id': fields.many2one('ir.model.fields', 'Fields', required=True),
|
||||
'log_id': fields.many2one('audittrail.log', 'Log'),
|
||||
'log': fields.integer("Log ID"),
|
||||
'old_value': fields.text("Old Value"),
|
||||
'new_value': fields.text("New Value"),
|
||||
'old_value_text': fields.text('Old value Text'),
|
||||
'new_value_text': fields.text('New value Text'),
|
||||
'field_description': fields.char('Field Description', size=64),
|
||||
}
|
||||
|
||||
audittrail_log_line()
|
||||
@@ -170,7 +177,7 @@ audittrail_log_line()
|
||||
|
||||
class audittrail_objects_proxy(osv_pool):
|
||||
""" Uses Object proxy for auditing changes on object of subscribed Rules"""
|
||||
|
||||
|
||||
def get_value_text(self, cr, uid, field_name, values, object, context=None):
|
||||
"""
|
||||
Gets textual values for the fields
|
||||
@@ -178,9 +185,9 @@ class audittrail_objects_proxy(osv_pool):
|
||||
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param field_name: List of fields for text values
|
||||
@param values: Values for field to be converted into textual values
|
||||
@return: values: List of textual values for given fields
|
||||
@param field_name: List of fields for text values
|
||||
@param values: Values for field to be converted into textual values
|
||||
@return: values: List of textual values for given fields
|
||||
"""
|
||||
if not context:
|
||||
context = {}
|
||||
@@ -226,7 +233,6 @@ class audittrail_objects_proxy(osv_pool):
|
||||
@param object: Object who's values are being changed
|
||||
@param lines: List of values for line is to be created
|
||||
"""
|
||||
|
||||
pool = pooler.get_pool(cr.dbname)
|
||||
obj = pool.get(object.model)
|
||||
#start Loop
|
||||
@@ -242,7 +248,7 @@ class audittrail_objects_proxy(osv_pool):
|
||||
new_value = 'new_value' in line and line['new_value'] or ''
|
||||
old_value_text = 'old_value_text' in line and line['old_value_text'] or ''
|
||||
new_value_text = 'new_value_text' in line and line['new_value_text'] or ''
|
||||
|
||||
|
||||
if old_value_text == new_value_text:
|
||||
continue
|
||||
if fields[0]['ttype'] == 'many2one':
|
||||
@@ -251,12 +257,12 @@ class audittrail_objects_proxy(osv_pool):
|
||||
if type(new_value) == tuple:
|
||||
new_value = new_value[0]
|
||||
vals = {
|
||||
"log_id": id,
|
||||
"field_id": f_id[0],
|
||||
"old_value": old_value,
|
||||
"new_value": new_value,
|
||||
"old_value_text": old_value_text,
|
||||
"new_value_text": new_value_text,
|
||||
"log_id": id,
|
||||
"field_id": f_id[0],
|
||||
"old_value": old_value,
|
||||
"new_value": new_value,
|
||||
"old_value_text": old_value_text,
|
||||
"new_value_text": new_value_text,
|
||||
"field_description": fields[0]['field_description']
|
||||
}
|
||||
line_id = pool.get('audittrail.log.line').create(cr, uid, vals)
|
||||
@@ -264,22 +270,25 @@ class audittrail_objects_proxy(osv_pool):
|
||||
#End Loop
|
||||
return True
|
||||
|
||||
|
||||
def log_fct(self, db, uid, object, method, fct_src, *args):
|
||||
"""
|
||||
Logging function: This function is performs logging oprations according to method
|
||||
@param db: the current database
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param object: Object who's values are being changed
|
||||
@param method: method to log: create, read, write, unlink
|
||||
@param method: method to log: create, read, write, unlink
|
||||
@param fct_src: execute method of Object proxy
|
||||
|
||||
@return: Returns result as per method of Object proxy
|
||||
|
||||
@return: Returns result as per method of Object proxy
|
||||
"""
|
||||
logged_uids = []
|
||||
res2 = args
|
||||
pool = pooler.get_pool(db)
|
||||
cr = pooler.get_db(db).cursor()
|
||||
obj_ids = pool.get('ir.model').search(cr, uid, [('model', '=', object)])
|
||||
model_object = pool.get('ir.model').browse(cr, uid, obj_ids)[0]
|
||||
|
||||
if method in ('create'):
|
||||
res_id = fct_src(db, uid, object, method, *args)
|
||||
cr.commit()
|
||||
@@ -290,9 +299,9 @@ class audittrail_objects_proxy(osv_pool):
|
||||
resource_name = pool.get(model_object.model).name_get(cr, uid, [res_id])
|
||||
resource_name = resource_name and resource_name[0][1] or ''
|
||||
vals = {
|
||||
"method": method,
|
||||
"object_id": model_object.id,
|
||||
"user_id": uid, "res_id": res_id,
|
||||
"method": method,
|
||||
"object_id": model_object.id,
|
||||
"user_id": uid, "res_id": res_id,
|
||||
"name": resource_name
|
||||
}
|
||||
id = pool.get('audittrail.log').create(cr, uid, vals)
|
||||
@@ -300,8 +309,8 @@ class audittrail_objects_proxy(osv_pool):
|
||||
for field in new_value:
|
||||
if new_value[field]:
|
||||
line = {
|
||||
'name': field,
|
||||
'new_value': new_value[field],
|
||||
'name': field,
|
||||
'new_value': new_value[field],
|
||||
'new_value_text': self.get_value_text(cr, uid, field, new_value[field], model_object)
|
||||
}
|
||||
lines.append(line)
|
||||
@@ -329,10 +338,10 @@ class audittrail_objects_proxy(osv_pool):
|
||||
for field in args[1].keys():
|
||||
if args[1].keys():
|
||||
line = {
|
||||
'name': field,
|
||||
'new_value': field in new_values and new_values[field] or '',
|
||||
'old_value': field in old_values and old_values[field] or '',
|
||||
'new_value_text': self.get_value_text(cr, uid, field, new_values[field], model_object),
|
||||
'name': field,
|
||||
'new_value': field in new_values and new_values[field] or '',
|
||||
'old_value': field in old_values and old_values[field] or '',
|
||||
'new_value_text': self.get_value_text(cr, uid, field, new_values[field], model_object),
|
||||
'old_value_text': old_values_text[field]
|
||||
}
|
||||
lines.append(line)
|
||||
@@ -360,8 +369,8 @@ class audittrail_objects_proxy(osv_pool):
|
||||
for field in old_values[res_id]:
|
||||
if old_values[res_id][field]:
|
||||
line = {
|
||||
'name': field,
|
||||
'old_value': old_values[res_id][field],
|
||||
'name': field,
|
||||
'old_value': old_values[res_id][field],
|
||||
'old_value_text': self.get_value_text(cr, uid, field, old_values[res_id][field], model_object)
|
||||
}
|
||||
lines.append(line)
|
||||
@@ -385,8 +394,8 @@ class audittrail_objects_proxy(osv_pool):
|
||||
for field in old_values[res_id]:
|
||||
if old_values[res_id][field]:
|
||||
line = {
|
||||
'name': field,
|
||||
'old_value': old_values[res_id][field],
|
||||
'name': field,
|
||||
'old_value': old_values[res_id][field],
|
||||
'old_value_text': self.get_value_text(cr, uid, field, old_values[res_id][field], model_object)
|
||||
}
|
||||
lines.append(line)
|
||||
@@ -397,16 +406,61 @@ class audittrail_objects_proxy(osv_pool):
|
||||
return res
|
||||
cr.close()
|
||||
|
||||
def log_action(self, db, uid, object, method, fct_src, *args):
|
||||
"""
|
||||
Logging function: This function is performs logging oprations according to method
|
||||
@param db: the current database
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param object: Object who's values are being changed
|
||||
@param method: method to log: create, read, write, unlink
|
||||
@param fct_src: execute method of Object proxy
|
||||
|
||||
@return: Returns result as per method of Object proxy
|
||||
"""
|
||||
|
||||
logged_uids = []
|
||||
pool = pooler.get_pool(db)
|
||||
cr = pooler.get_db(db).cursor()
|
||||
obj_ids = pool.get('ir.model').search(cr, uid, [('model', '=', object)])
|
||||
model_object = pool.get('ir.model').browse(cr, uid, obj_ids)[0]
|
||||
|
||||
res_ids = args[0]
|
||||
old_values = {}
|
||||
for res_id in res_ids:
|
||||
old_values[res_id] = pool.get(model_object.model).read(cr, uid, res_id, [])
|
||||
|
||||
for res_id in res_ids:
|
||||
if not logged_uids or uid in logged_uids:
|
||||
resource_name = pool.get(model_object.model).name_get(cr, uid, [res_id])
|
||||
resource_name = resource_name and resource_name[0][1] or ''
|
||||
id = pool.get('audittrail.log').create(cr, uid, {"method": 'action', "object_id": model_object.id, "user_id": uid, "res_id": res_id, "name": resource_name, "method_name": method})
|
||||
lines = []
|
||||
for field in old_values[res_id]:
|
||||
if old_values[res_id][field]:
|
||||
line = {
|
||||
'name': field,
|
||||
'old_value': old_values[res_id][field],
|
||||
'old_value_text': self.get_value_text(cr, uid, field, old_values[res_id][field], model_object)
|
||||
}
|
||||
lines.append(line)
|
||||
cr.commit()
|
||||
self.create_log_line(cr, uid, id, model_object, lines)
|
||||
res = fct_src(db, uid, object, method, *args)
|
||||
cr.close()
|
||||
return res
|
||||
cr.close()
|
||||
|
||||
def execute(self, db, uid, object, method, *args, **kw):
|
||||
"""
|
||||
Overrides Object Proxy execute method
|
||||
@param db: the current database
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param object: Object who's values are being changed
|
||||
@param method: method to log: create, read, write, unlink
|
||||
|
||||
@return: Returns result as per method of Object proxy
|
||||
@param method: method to log: create, read, write, unlink
|
||||
|
||||
@return: Returns result as per method of Object proxy
|
||||
"""
|
||||
|
||||
pool = pooler.get_pool(db)
|
||||
cr = pooler.get_db(db).cursor()
|
||||
cr.autocommit(True)
|
||||
@@ -433,13 +487,105 @@ class audittrail_objects_proxy(osv_pool):
|
||||
logged_uids.append(user.id)
|
||||
if not logged_uids or uid in logged_uids:
|
||||
if field in ('read', 'write', 'create', 'unlink'):
|
||||
|
||||
if getattr(thisrule, 'log_' + field):
|
||||
return self.log_fct(db, uid, object, method, fct_src, *args)
|
||||
|
||||
elif field not in ('default_get','read','fields_view_get','fields_get','search','search_count','name_search','name_get','get','request_get', 'get_sc', 'unlink') and (field != 'write' and field != 'create'):
|
||||
if thisrule.log_action:
|
||||
return self.log_action(db, uid, object, method, fct_src, *args)
|
||||
return fct_src(db, uid, object, method, *args)
|
||||
res = my_fct(db, uid, object, method, *args)
|
||||
cr.close()
|
||||
return res
|
||||
|
||||
|
||||
def workflow_log(self, db, uid, object, method,*args, **argv):
|
||||
"""
|
||||
Logging function: This function is performs logging oprations according to method
|
||||
@param db: the current database
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param object: Object who's values are being changed
|
||||
@param method: method to log: create, read, write, unlink
|
||||
@param fct_src: execute method of Object proxy
|
||||
|
||||
@return: Returns result as per method of Object proxy
|
||||
"""
|
||||
|
||||
logged_uids = []
|
||||
pool = pooler.get_pool(db)
|
||||
cr = pooler.get_db(db).cursor()
|
||||
obj_ids = pool.get('ir.model').search(cr, uid, [('model', '=', object)])
|
||||
model_object = pool.get('ir.model').browse(cr, uid, obj_ids)[0]
|
||||
|
||||
workflow_obj = pool.get('workflow')
|
||||
wkf_ids = workflow_obj.search(cr, uid, [('osv', '=', object)])
|
||||
wkf_name= workflow_obj.browse(cr, uid, wkf_ids)[0].name
|
||||
|
||||
res_id = args[0]
|
||||
old_values_text = {}
|
||||
old_values = pool.get(model_object.model).read(cr, uid, res_id)
|
||||
for field in old_values.keys():
|
||||
old_values_text[field] = self.get_value_text(cr, uid, field, old_values[field], model_object)
|
||||
|
||||
res = super(audittrail_objects_proxy, self).exec_workflow(db, uid, object, method, *args, **argv)
|
||||
cr.commit()
|
||||
new_values = pool.get(model_object.model).read(cr, uid, res_id)
|
||||
|
||||
resource_name = pool.get(model_object.model).name_get(cr, uid, [args[0]])
|
||||
resource_name = resource_name and resource_name[0][1] or ''
|
||||
l_id = pool.get('audittrail.log').create(cr, uid, {"method": 'workflow', "object_id": model_object.id, "user_id": uid, "res_id": args[0], "name": resource_name +"/"+ wkf_name })
|
||||
lines = []
|
||||
diff = {}
|
||||
log_line_pool = pool.get('audittrail.log.line')
|
||||
|
||||
for field in old_values.keys():
|
||||
if old_values[field] == new_values[field]:
|
||||
continue
|
||||
else:
|
||||
diff.update({field: (old_values[field], new_values[field])})
|
||||
f_id = pool.get('ir.model.fields').search(cr, uid, [('name', '=', field), ('model_id', '=', model_object.id)])
|
||||
log_line_pool.create(cr, uid, {'field_id': f_id[0], 'log_id': l_id, \
|
||||
'old_value': str(old_values[field]),\
|
||||
'new_value': str(new_values[field]),\
|
||||
'old_value_text':str(old_values_text[field]),
|
||||
'new_value_text':self.get_value_text(cr, uid, field, new_values[field], model_object),
|
||||
})
|
||||
cr.commit()
|
||||
cr.close()
|
||||
return res
|
||||
|
||||
|
||||
def exec_workflow(self, db, uid, object, method, *args, **argv):
|
||||
pool = pooler.get_pool(db)
|
||||
cr = pooler.get_db(db).cursor()
|
||||
cr.autocommit(True)
|
||||
logged_uids = []
|
||||
fct_src = super(audittrail_objects_proxy, self).execute
|
||||
field = method
|
||||
rule = False
|
||||
obj_ids = pool.get('ir.model').search(cr, uid, [('model', '=', object)])
|
||||
for obj_name in pool.obj_list():
|
||||
if obj_name == 'audittrail.rule':
|
||||
rule = True
|
||||
if not rule:
|
||||
return super(audittrail_objects_proxy, self).exec_workflow(db, uid, object, method, *args, **argv)
|
||||
if not obj_ids:
|
||||
return super(audittrail_objects_proxy, self).exec_workflow(db, uid, object, method, *args, **argv)
|
||||
rule_ids = pool.get('audittrail.rule').search(cr, uid, [('object_id', '=', obj_ids[0]), ('state', '=', 'subscribed')])
|
||||
if not rule_ids:
|
||||
res = super(audittrail_objects_proxy, self).exec_workflow(db, uid, object, method, *args, **argv)
|
||||
|
||||
for thisrule in pool.get('audittrail.rule').browse(cr, uid, rule_ids):
|
||||
for user in thisrule.user_id:
|
||||
logged_uids.append(user.id)
|
||||
if not logged_uids or uid in logged_uids:
|
||||
if thisrule.log_workflow:
|
||||
return self.workflow_log(db, uid, object, method, *args,**argv)
|
||||
return super(audittrail_objects_proxy, self).exec_workflow(db, uid, object, method, *args, **argv)
|
||||
|
||||
cr.close()
|
||||
|
||||
audittrail_objects_proxy()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -12,10 +12,12 @@
|
||||
<form string="AuditTrail Rule">
|
||||
<field name="name" select="1" required="1"/>
|
||||
<field name="object_id" select="1"/>
|
||||
<field name="log_read" />
|
||||
<field name="log_write" />
|
||||
<field name="log_unlink" />
|
||||
<field name="log_create" />
|
||||
<field name="log_read"/>
|
||||
<field name="log_write"/>
|
||||
<field name="log_unlink"/>
|
||||
<field name="log_create"/>
|
||||
<field name="log_action"/>
|
||||
<field name="log_workflow"/>
|
||||
<separator string="Users (if User is not added then it will applicable for all users)" colspan="4" />
|
||||
<field name="user_id" select="1" colspan="4" nolabel="1" />
|
||||
<field name="action_id" colspan="4" readonly="1" groups="base.group_extended"/>
|
||||
@@ -38,49 +40,48 @@
|
||||
<tree string="AuditTrail Rules">
|
||||
<field name="name" />
|
||||
<field name="object_id"/>
|
||||
<field name="user_id"/>
|
||||
<field name="user_id" />
|
||||
<field name="log_read" />
|
||||
<field name="log_write" />
|
||||
<field name="log_unlink" />
|
||||
<field name="log_create" />
|
||||
<field name="log_action"/>
|
||||
<field name="log_workflow"/>
|
||||
<field name="state" />
|
||||
<button string="Subscribe" name="subscribe"
|
||||
type="object" states="draft" icon="gtk-go-forward"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Audittrail rule Search View -->
|
||||
|
||||
<record id="view_audittrail_rule_filter" model="ir.ui.view">
|
||||
<field name="name">Audittrail-rule Search</field>
|
||||
<field name="model">audittrail.rule</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search rule">
|
||||
<group>
|
||||
<filter icon="terp-project"
|
||||
string="Draft"
|
||||
domain="[('state','=','draft')]"/>
|
||||
<filter icon="terp-project"
|
||||
name="subscribed"
|
||||
string="Subscribed"
|
||||
domain="[('state','=','subscribed')]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name"/>
|
||||
<field name="object_id" widget="selection"/>
|
||||
<field name="user_id" widget="selection"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By..." colspan="14">
|
||||
<filter string="State" icon="terp-crm" domain="[]" context="{'group_by':'state'}"/>
|
||||
<filter string="Object" icon="terp-crm" domain="[]" context="{'group_by':'object_id'}"/>
|
||||
</group>
|
||||
<newline/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Audittrail rule Search View -->
|
||||
<record id="view_audittrail_rule_filter" model="ir.ui.view">
|
||||
<field name="name">Audittrail-rule Search</field>
|
||||
<field name="model">audittrail.rule</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search rule">
|
||||
<group>
|
||||
<filter icon="terp-project"
|
||||
string="Draft"
|
||||
domain="[('state','=','draft')]"/>
|
||||
<filter icon="terp-project"
|
||||
name="subscribed"
|
||||
string="Subscribed"
|
||||
domain="[('state','=','subscribed')]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name"/>
|
||||
<field name="object_id" widget="selection"/>
|
||||
<field name="user_id" widget="selection"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By..." colspan="14">
|
||||
<filter string="State" icon="terp-crm" domain="[]" context="{'group_by':'state'}"/>
|
||||
<filter string="Object" icon="terp-crm" domain="[]" context="{'group_by':'object_id'}"/>
|
||||
</group>
|
||||
<newline/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Action for audittrail rule -->
|
||||
|
||||
<record model="ir.actions.act_window" id="action_audittrail_rule_tree">
|
||||
@@ -89,7 +90,7 @@
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="search_view_id" ref="view_audittrail_rule_filter"/>
|
||||
<!--<field name="view_id" ref="view_audittrail_rule_form" />-->
|
||||
</record>
|
||||
|
||||
<menuitem name="Audittrails" id="menu_action_audittrail"
|
||||
@@ -117,22 +118,24 @@
|
||||
<field name="arch" type="xml">
|
||||
<form string="AuditTrail Logs">
|
||||
<field name="timestamp" select="1" required="1" readonly="1"/>
|
||||
<field name="object_id" select="1" readonly="1"/>
|
||||
<field name="method" select="1" readonly="1"/>
|
||||
<field name="user_id" select="1" readonly="1"/>
|
||||
<field name="res_id" readonly="1"/>
|
||||
<field name="method" select="1" readonly="1"/>
|
||||
<field name="name" readonly="1" select="1"/>
|
||||
<field name="res_id" readonly="1"/>
|
||||
<field name="object_id" select="1" readonly="1"/>
|
||||
<field name="method_name" select="1" readonly="1"/>
|
||||
<field name="line_ids" colspan="4" mode="tree,form"
|
||||
widget="one2many_list" readonly="1" nolabel="1">
|
||||
widget="one2many_list" readonly="1">
|
||||
<form string="Log Lines">
|
||||
<group colspan="4" col="2">
|
||||
<field name="field_id"
|
||||
<group colspan="4" col="2">
|
||||
<field name="field_id"
|
||||
readonly="1" colspan="4"/>
|
||||
<newline />
|
||||
<field name="field_description"
|
||||
<field name="field_description"
|
||||
readonly="1" colspan="4"/>
|
||||
<newline />
|
||||
</group>
|
||||
|
||||
<separator string="Old Value : "
|
||||
colspan="2" />
|
||||
<separator string="New Value : "
|
||||
@@ -178,31 +181,31 @@
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="view_audittrail_log_filter" model="ir.ui.view">
|
||||
<field name="name">Audittrail-log Search</field>
|
||||
<field name="model">audittrail.log</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search log">
|
||||
<group>
|
||||
<field name="name">Audittrail-log Search</field>
|
||||
<field name="model">audittrail.log</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search log">
|
||||
<group>
|
||||
<field name="timestamp" />
|
||||
<field name="name" />
|
||||
<field name="object_id" widget="selection"/>
|
||||
<field name="method" />
|
||||
<field name="user_id" widget="selection"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By..." colspan="14">
|
||||
<filter string="Log Date" icon="terp-crm" domain="[]" context="{'group_by':'timestamp'}"/>
|
||||
<filter string="Log Method" icon="terp-crm" domain="[]" context="{'group_by':'method'}"/>
|
||||
<filter string="Object" icon="terp-crm" domain="[]" context="{'group_by':'object_id'}"/>
|
||||
<filter string="User" icon="terp-partner" name="user" domain="[]" context="{'group_by':'user_id'}"/>
|
||||
</group>
|
||||
<newline/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By..." colspan="14">
|
||||
<filter string="Log Date" icon="terp-crm" domain="[]" context="{'group_by':'timestamp'}"/>
|
||||
<filter string="Log Method" icon="terp-crm" domain="[]" context="{'group_by':'method'}"/>
|
||||
<filter string="Object" icon="terp-crm" domain="[]" context="{'group_by':'object_id'}"/>
|
||||
<filter string="User" icon="terp-partner" name="user" domain="[]" context="{'group_by':'user_id'}"/>
|
||||
</group>
|
||||
<newline/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Action for Audittrail Log -->
|
||||
|
||||
@@ -210,12 +213,13 @@
|
||||
<field name="name">Logs</field>
|
||||
<field name="res_model">audittrail.log</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="search_view_id" ref="view_audittrail_log_filter"/>
|
||||
</record>
|
||||
|
||||
<menuitem name="Logs" id="menu_action_audittrail_log_tree"
|
||||
action="action_audittrail_log_tree" parent="menu_action_audittrail" />
|
||||
|
||||
<!-- <wizard string="View log" menu="False" model="audittrail.log" name="audittrail.view.log" id="wizard_audittrail_log"/>-->
|
||||
<menuitem name="View Logs" id="menu_action_log_tree2"
|
||||
action="action_audittrail_view_log" parent="menu_action_audittrail" />
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -13,11 +13,7 @@ msgstr ""
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
<<<<<<< TREE
|
||||
"X-Launchpad-Export-Date: 2010-03-30 04:13+0000\n"
|
||||
=======
|
||||
"X-Launchpad-Export-Date: 2010-04-17 04:17+0000\n"
|
||||
>>>>>>> MERGE-SOURCE
|
||||
"X-Generator: Launchpad (build Unknown)\n"
|
||||
|
||||
#. module: audittrail
|
||||
|
||||
Reference in New Issue
Block a user