← Back to team overview

openerp-india team mailing list archive

[Bug 1034565] [NEW] Access rights data files can't update group_id field to null

 

Public bug reported:

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.category", and click the Search button. You should see one record, and the Group field should be empty.
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.import_data(). If any of the imported fields are blank, they are not updated in the database. I'll create a merge proposal that checks for the group_id field and explicitly sets it to null if it's missing.

** Affects: openobject-server
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Server.
https://bugs.launchpad.net/bugs/1034565

Title:
  Access rights data files can't update group_id field to null

Status in OpenERP Server:
  New

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.category", and click the Search button. You should see one record, and the Group field should be empty.
  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.import_data(). If any of the imported fields are blank, they are not updated in the database. I'll create a merge proposal that checks for the group_id field and explicitly sets it to null if it's missing.

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-server/+bug/1034565/+subscriptions


Follow ups

References