← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 764745] Re: user can't change company

 

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.

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/764745

Title:
  user can't change company

Status in OpenERP Server:
  Confirmed

Bug description:
  OpenERP v6.0.2

  As administrator, I put my user Miss Piggie into 5 different companies
  and set her company as Company1.

  When Miss Piggie logs in, she can open up her preferences and can select her company as Company2, but
  it never gets saved.

  Also note that when Miss Piggie goes into Administration / Users and looks at her account through there,
  she only sees Company1 in the list of Companies.  Administrator sees all 5 of the companies assigned to her.


References