[FIX] note: revert rev 9055 as made impossible to change stage if no rights on other users' relations

bzr revid: mat@openerp.com-20131230104045-2h070kuouz4msz1x
This commit is contained in:
Martin Trigaux
2013-12-30 11:40:45 +01:00
parent 1508c5dd00
commit 8146a3ed43
+3 -4
View File
@@ -84,10 +84,9 @@ class note_note(osv.osv):
return ids and ids[0] or False
def _set_stage_per_user(self, cr, uid, id, name, value, args=None, context=None):
if not value:
return False
note = self.browse(cr, SUPERUSER_ID, id, context=context) # do it as SUPERUSER because when creating, followers are not necessariliry set (another function field)
stage_ids = [value] + [stage.id for stage in note.stage_ids if stage.user_id.id != uid]
note = self.browse(cr, uid, id, context=context)
if not value: return False
stage_ids = [value] + [stage.id for stage in note.stage_ids if stage.user_id.id != uid ]
return self.write(cr, uid, [id], {'stage_ids': [(6, 0, set(stage_ids))]}, context=context)
def _get_stage_per_user(self, cr, uid, ids, name, args, context=None):