[trunk]Write from osv_memory to normal object fails with record access error

Bug #865877 reported by John B
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
Fix Released
Undecided
Unassigned

Bug Description

When trying to write from a wizard to a normal object as non-super user, receive the following error:

AccessError, Write access is restricted to your own records for transient models (except for the super-user)

It looks like somewhere is_transient is being set on the object (e.g. purchase.order), and check_access_rule() in orm tries to make sure whoever created the purchase.order record is writing to it, rather than handling it with the normal access checks.

is_transient should only be set on the osv_memory object.

Relatively simple to recreate using the latest trunk - just create a wizard that writes to any normal object. Let me know if a test module is required.

Revision history for this message
John B (johnb-ca) wrote :

Just to add - an easy test case:

 1. Create Manufacturing Order as admin or other user (User1)
 2. Login as User2 who has sufficient permissions for manufacturing (User) to write to Manufacturing Orders.
 3. Run 'Change Qty' wizard and attempt to save - error comes up

What I noticed, however, is that any change on the MO gives that error even though it isn't a transient model.

Revision history for this message
Vo Minh Thu (thu) wrote :

Hi,

I had not yet the time to try your scenario, but a bug was fixed about osv_memory/TransientModel at revision 3718. Can you try again please and report any difference? Thanks a lot.

Revision history for this message
John B (johnb-ca) wrote :

Yup, that fixed it. Thanks!

Changed in openobject-server:
status: New → Fix Committed
Revision history for this message
Vo Minh Thu (thu) wrote :

Great. Thanks for the bug report.

Changed in openobject-server:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.