Access rights data files can't update group_id field to null
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Server (MOVED TO GITHUB) |
Confirmed
|
Low
|
OpenERP's Framework R&D |
Bug Description
If you change a module's ir.model.access.csv file by removing the group_id from one of the records, it won't actually update the field to null on that record.
I found the problem while upgrading from 5.0 to 6.1, because the base module's security record for ir.module.category removed the group id. When I upgraded my database, regular users could no longer change their own password.
Steps to reproduce the problem:
1. Launch the server with version 6.1 (I have revision 4224 of the 6.1 server branch). Include the web project and the addons project.
2. Create a new database with sample data. Don't bother to add any extra modules.
3. Click the preferences button (gear icon in the top-right corner). Change the user interface from Simplified to Extended.
4. Log out and log in as the demo user. The password defaults to "demo".
5. Click the preferences button. The dialog box appears successfully.
6. Click the Cancel button, and log out. Log in as the admin user.
7. From the Settings menu, choose Security: Access Controls List.
8. In the Object field, type "ir.module.
9. Click on the Group field, and change it to Administration / Access Rights. Click on the Save button at the right-hand side.
10. Log out and log in as the demo user.
11. Click the preferences button. You get an access error for ir.module.category, as expected.
12. Click OK on the error message, and click Cancel in the Preferences dialog box.
13. Log out and log in as the admin user.
14. From the Settings menu, choose Modules: Update Modules List. Go through the wizard.
15. When you get to the list of modules, type "base" in the Name field, and click the Search button.
16. Open the base module, and click the Upgrade button. Go through the wizard.
17. Log out and log in as the demo user.
18. Click on the preferences button.
Expected behaviour: upgrading the base module should have reset the access rights and let the demo user successfully open the preferences dialog.
Actual behaviour: the demo user still gets the acess error.
Analysis:
The bug appears to be in BaseModel.
Related branches
- Amit Parik (community): Approve
- OpenERP Core Team: Pending requested
-
Diff: 12 lines (+2/-0)1 file modifiedopenerp/osv/orm.py (+2/-0)
Hello Don,
You are right, faced the same problem on trunk and tested your branch is working correct.
Thanks for the nice explanation on bug which helps lot.