+
diff --git a/openerp/addons/base/res/res_users.py b/openerp/addons/base/res/res_users.py
index 4b8fb330a78..6ed6e7cc74c 100644
--- a/openerp/addons/base/res/res_users.py
+++ b/openerp/addons/base/res/res_users.py
@@ -40,7 +40,6 @@ from service import security
import tools
from tools.translate import _
-
_logger = logging.getLogger(__name__)
class groups(osv.osv):
@@ -205,7 +204,7 @@ class users(osv.osv):
img_stream = StringIO.StringIO()
img.save(img_stream, "PNG")
return img_stream.getvalue().encode('base64')
-
+
def _get_avatar(self, cr, uid, ids, name, args, context=None):
result = dict.fromkeys(ids, False)
for user in self.browse(cr, uid, ids, context=context):
@@ -376,7 +375,7 @@ class users(osv.osv):
}
# User can write to a few of her own fields (but not her groups for example)
- SELF_WRITEABLE_FIELDS = ['menu_tips','view', 'password', 'signature', 'action_id', 'company_id', 'user_email', 'name']
+ SELF_WRITEABLE_FIELDS = ['menu_tips','view', 'password', 'signature', 'action_id', 'company_id', 'user_email', 'name', 'avatar', 'avatar_big']
def write(self, cr, uid, ids, values, context=None):
if not hasattr(ids, '__iter__'):
diff --git a/openerp/addons/base/security/ir.model.access.csv b/openerp/addons/base/security/ir.model.access.csv
index 5140ac1b144..ac05b726341 100644
--- a/openerp/addons/base/security/ir.model.access.csv
+++ b/openerp/addons/base/security/ir.model.access.csv
@@ -117,8 +117,10 @@
"access_ir_filters","ir_filters_all","model_ir_filters",,1,1,1,1
"access_res_widget","res.widget","model_res_widget","group_erp_manager",1,1,1,1
"access_res_widget_user","res.widget.user","model_res_widget",,1,0,0,0
-"access_res_log_all","res.log","model_res_log",,1,1,1,1
"access_ir_config_parameter","ir_config_parameter","model_ir_config_parameter",,1,0,0,0
"access_ir_mail_server_all","ir_mail_server","model_ir_mail_server",,1,0,0,0
"access_ir_actions_todo_category","ir_actions_todo_category","model_ir_actions_todo_category","group_system",1,1,1,1
"access_ir_actions_client","ir_actions_client all","model_ir_actions_client",,1,0,0,0
+"access_ir_needaction_users","ir_needaction_users","model_ir_needaction_users",,1,1,1,1
+"access_ir_needaction_mixin","ir_needaction_mixin","model_ir_needaction_mixin",,1,1,1,1
+
diff --git a/openerp/modules/loading.py b/openerp/modules/loading.py
index efc73d44a58..8ed79a4d615 100644
--- a/openerp/modules/loading.py
+++ b/openerp/modules/loading.py
@@ -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
diff --git a/openerp/osv/orm.py b/openerp/osv/orm.py
index 0a9ee57b621..313c96a9fb4 100644
--- a/openerp/osv/orm.py
+++ b/openerp/osv/orm.py
@@ -709,18 +709,8 @@ 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.")
+
def view_init(self, cr, uid, fields_list, context=None):
"""Override this method to do specific things when a view on the object is opened."""
pass
@@ -1661,7 +1651,7 @@ class BaseModel(object):
children = False
views = {}
for f in node:
- if f.tag in ('form', 'tree', 'graph'):
+ if f.tag in ('form', 'tree', 'graph', 'kanban'):
node.remove(f)
ctx = context.copy()
ctx['base_model_name'] = self._name
@@ -4875,7 +4865,35 @@ class BaseModel(object):
# backwards compatibility
get_xml_id = get_external_id
_get_xml_ids = _get_external_ids
-
+
+ def get_needaction_info(self, cr, uid, user_id, limit=None, order=None, domain=False, context=None):
+ """Base method for needaction mechanism
+ - see ir.needaction for actual implementation
+ - if the model uses the need action mechanism
+ (hasattr(model_obj, 'needaction_get_record_ids')):
+ - get the record ids on which the user has actions to perform
+ - evaluate the menu domain
+ - compose a new domain: menu domain, limited to ids of
+ records requesting an action
+ - count the number of records maching that domain, that
+ is the number of actions the user has to perform
+ - this method returns default values
+ :param: model_name: the name of the model (ex: hr.holidays)
+ :param: user_id: the id of user
+ :return: [uses_needaction=True/False, needaction_uid_ctr=%d]
+ """
+ if hasattr(self, 'needaction_get_record_ids'):
+ ids = self.needaction_get_record_ids(cr, uid, user_id, limit=8192, context=context)
+ if not ids:
+ return [True, 0, []]
+ if domain:
+ new_domain = eval(domain, locals_dict={'uid': user_id}) + [('id', 'in', ids)]
+ else:
+ new_domain = [('id', 'in', ids)]
+ return [True, self.search(cr, uid, new_domain, limit=limit, order=order, count=True, context=context), ids]
+ else:
+ return [False, 0, []]
+
# Transience
def is_transient(self):
""" Return whether the model is transient.