[FIX] Propagated name change from ir_needaction_users to ir_needaction_users_rel.

bzr revid: tde@openerp.com-20120418091259-cnhae6rsc8dqlmkw
This commit is contained in:
Thibault Delavallée 2012-04-18 11:12:59 +02:00
parent c1a4f1f8db
commit aca2b48746
1 changed files with 7 additions and 7 deletions

View File

@ -87,7 +87,7 @@ class ir_needaction_mixin(osv.osv):
validation by a manager, this mechanism allows to set a list of
users asked to perform an action.
This class wraps a class (ir.needaction_users) that behaves
This class wraps a class (ir.ir_needaction_users_rel) that behaves
like a many2many field. However, no field is added to the model
inheriting from this mixin class. This class handles the low-level
considerations of updating relationships. Every change made on the
@ -126,7 +126,7 @@ class ir_needaction_mixin(osv.osv):
return dict.fromkeys(ids, [])
def create(self, cr, uid, values, context=None):
rel_obj = self.pool.get('ir.needaction_users')
rel_obj = self.pool.get('ir.ir_needaction_users_rel')
# perform create
obj_id = super(ir_needaction_mixin, self).create(cr, uid, values, context=context)
# link user_ids
@ -135,7 +135,7 @@ class ir_needaction_mixin(osv.osv):
return obj_id
def write(self, cr, uid, ids, values, context=None):
rel_obj = self.pool.get('ir.needaction_users')
rel_obj = self.pool.get('ir.ir_needaction_users_rel')
# perform write
write_res = super(ir_needaction_mixin, self).write(cr, uid, ids, values, context=context)
# get and update user_ids
@ -146,7 +146,7 @@ class ir_needaction_mixin(osv.osv):
def unlink(self, cr, uid, ids, context=None):
# unlink user_ids
rel_obj = self.pool.get('ir.needaction_users')
rel_obj = self.pool.get('ir.ir_needaction_users_rel')
rel_obj.unlink_users(cr, uid, ids, self._name, context=context)
# perform unlink
return super(ir_needaction_mixin, self).unlink(cr, uid, ids, context=context)
@ -159,14 +159,14 @@ class ir_needaction_mixin(osv.osv):
"""Given the current model and a user_id
return the record ids that require the user to perform an
action"""
rel_obj = self.pool.get('ir.needaction_users')
rel_obj = self.pool.get('ir.ir_needaction_users_rel')
rel_ids = rel_obj.search(cr, uid, [('res_model', '=', self._name), ('user_id', '=', user_id)], limit=limit, context=context)
return map(itemgetter('res_id'), rel_obj.read(cr, uid, rel_ids, ['res_id'], context=context))
def needaction_get_action_count(self, cr, uid, user_id, limit=80, context=None):
"""Given the current model and a user_id
get the number of actions it has to perform"""
rel_obj = self.pool.get('ir.needaction_users')
rel_obj = self.pool.get('ir.ir_needaction_users_rel')
return rel_obj.search(cr, uid, [('res_model', '=', self._name), ('user_id', '=', user_id)], limit=limit, count=True, context=context)
def needaction_get_record_references(self, cr, uid, user_id, offset=None, limit=None, order=None, context=None):
@ -174,7 +174,7 @@ class ir_needaction_mixin(osv.osv):
perform an action. Records are given as references, a list of
tuples (model_name, record_id).
This method is trans-model."""
rel_obj = self.pool.get('ir.needaction_users')
rel_obj = self.pool.get('ir.ir_needaction_users_rel')
rel_ids = rel_obj.search(cr, uid, [('user_id', '=', user_id)], offset=offset, limit=limit, order=order, context=context)
return map(itemgetter('res_model', 'res_id'), rel_obj.read(cr, uid, rel_ids, ['res_model', 'res_id'], context=context))