[REM] Removed res.log feature in ORM. However, the res.log table stays, because it is still used notably in publisher_warranty, that must be checked to see how it should be updated with OpenChatter.

bzr revid: tde@openerp.com-20120402114746-unxkhxutivx2hp7f
This commit is contained in:
Thibault Delavallée 2012-04-02 13:47:46 +02:00
parent 4ba7d34a4a
commit 5959157cc5
4 changed files with 5 additions and 17 deletions

View File

@ -717,8 +717,8 @@ class ir_model_data(osv.osv):
model_obj = self.pool.get(model)
if not context:
context = {}
# records created during module install should result in res.log entries that are already read!
context = dict(context, res_log_read=True)
# TODO: records created during module install should not display the messages of OpenChatter
context = dict(context)
if xml_id and ('.' in xml_id):
assert len(xml_id.split('.'))==2, _("'%s' contains too many dots. XML ids should not contain dots ! These are used to refer to other modules data, as in module.reference_id") % (xml_id)
module, xml_id = xml_id.split('.')

View File

@ -187,6 +187,7 @@ class publisher_warranty_contract(osv.osv):
limit_date = (datetime.datetime.now() - _PREVIOUS_LOG_CHECK).strftime(misc.DEFAULT_SERVER_DATETIME_FORMAT)
# TODO: must be updated with OpenChatter ?
for message in result["messages"]:
ids = self.pool.get("res.log").search(cr, uid, [("res_model", "=", "publisher_warranty.contract"),
("create_date", ">=", limit_date),

View File

@ -212,10 +212,7 @@ def load_module_graph(cr, graph, status=None, perform_checks=True, skip_modules=
delattr(package, kind)
cr.commit()
# mark new res_log records as read
cr.execute("update res_log set read=True where create_date >= %s", (dt_before_load,))
cr.commit()
return loaded_modules, processed_modules

View File

@ -710,17 +710,7 @@ class BaseModel(object):
CONCURRENCY_CHECK_FIELD = '__last_update'
def log(self, cr, uid, id, message, secondary=False, context=None):
if context and context.get('disable_log'):
return True
return self.pool.get('res.log').create(cr, uid,
{
'name': message,
'res_model': self._name,
'secondary': secondary,
'res_id': id,
},
context=context
)
return _logger.warning("log() is deprecated. Please use OpenChatter notification system instead of the res.log mechanism.")
@staticmethod
def get_needaction_info(cr, uid, model_name, user_id, limit=None, order=None, domain=False, context=None):