Comment 4 for bug 764745

Revision history for this message
Serge (sboivin) wrote :

The rules is not the problem, the problem is, when openerp go read the company, openerp use the ID of the user , at this moment user can only see company 1, so the read return only the company 1, so refuse to change company to company 2

The read need to use the administrator right to bypass rules and go see if the user really have the right to select this company.

self.read(cr, uid, uid, ['company_ids'], context=context)['company_ids'])

This will always return the current company select and is children, so in Leigh sample, company 1 and 2 are not parent, so if user use company 1, he cant change to company 2.

self.read(cr, 1, uid, ['company_ids'], context=context)['company_ids'])

This use the administrator right to go read the user (UID) allowed companies.

And please remove Duplicate, because other talk about rule, here we talk about the bad use of uid to go read.

In my side i patched version 6.0.2 with that.