Review: Needs Information
Hi,

I understand that it makes sense to allow a user to increment sequences in 
other companies if he is currently allowed to "see" these other companies.
Indeed, the typical case is when the user is in the parent company, and wants 
to use a sequence from a child company.
However, the rule to know what companies a user is currently allowed to see is 
not hardcoded, it is not "current or children", it is defined by the ir.rules 
on the Company object.

Therefore, don't you think a better way to determine the list of allowed 
companies is to do a normal res_company.search([]) as the current user?
i.e. simplify the code with just:
  visible_company_ids = self.pool.get('res.company').search(cr, uid, [], 
context=context)

and pass "tuple(visible_company_ids)" to the SQL query.

What do you think?

Thanks!
-- 
https://code.launchpad.net/~openerp-dev/openobject-server/6.0-opw-10420-ira/+merge/66546
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-server/6.0-opw-10420-ira.

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to