From e701169ac6887b4c76967b03c92eb3faafab501a Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Wed, 9 Oct 2013 18:29:20 +0200 Subject: [FIX] note: copy default stages as SUPERUSER_ID to avoid access error. Only do it for employees lp bug: https://launchpad.net/bugs/1156215 fixed bzr revid: chs@openerp.com-20131009162920-lg56wwmtg8qm1kuf --- addons/note/tests/test_note.py | 43 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 addons/note/tests/test_note.py (limited to 'addons/note/tests/test_note.py') diff --git a/addons/note/tests/test_note.py b/addons/note/tests/test_note.py new file mode 100644 index 00000000000..4300009981e --- /dev/null +++ b/addons/note/tests/test_note.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Business Applications +# Copyright (c) 2013-TODAY OpenERP S.A. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +from openerp.tests import common + +class TestNote(common.TransactionCase): + + def test_bug_lp_1156215(self): + """ensure any users can create new users""" + cr, uid = self.cr, self.uid + IMD = self.registry('ir.model.data') + Users = self.registry('res.users') + + _, demo_user = IMD.get_object_reference(cr, uid, 'base', 'user_demo') + _, group_id = IMD.get_object_reference(cr, uid, 'base', 'group_erp_manager') + + Users.write(cr, uid, [demo_user], { + 'groups_id': [(4, group_id)], + }) + + # must not fail + Users.create(cr, demo_user, { + 'name': 'test bug lp:1156215', + 'login': 'lp_1156215', + }) -- cgit v1.2.3