multi company - access violation of res_company

Bug #1087424 reported by Ferdinand
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
Expired
Undecided
Unassigned

Bug Description

this company rule
[('id','child_of',[user.company_id.id])]
returns only one record which is correct

I had to apply a workaround,

openerp/osv/orm.py

3436 for sub_ids in cr.split_for_in_conditions(ids):
3437 if rule_clause:
3438 cr.execute(query, [tuple(sub_ids)] + rule_params)
3439 # FIXME - FGF
3440 # the rules for company does not work for user in sub company having only access to this child, not to the mother
3441 # cr.rowcount returns 1 - which is correct
3442 # len(sub_ids) returns 2 - which is not correct
3443 if cr.rowcount != len(sub_ids) and self._table != 'res_company':
3444 raise except_orm(_('AccessError'),
3445 _('(A) Operation prohibited by access rules, or performed on an already deleted document (Operation: read, Document type: %s).')
3446 % (self._description,))

affects: openobject-addons → openobject-server
Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

Sorry for the delay, but the actual problem is not clear to me, so it is hard to say if the patch is correct or if the record rules need to be fixed. It would be great to have a higher level description of what you are trying to do, and the steps to follow to reproduce it. Thanks!

Changed in openobject-server:
status: New → Incomplete
Revision history for this message
Estuda Maharyo Basuki (s2d4theworld) wrote :

I have a similar problem. I have a rule for product_template where I try to limit a group of user to a specific node of product_category. Here's my rule:

Object: product.template
Rule definition (domain filter): [('categ_id.id','child_of',18)]

18 is the parent of the category id, the user have access to. This user may access only the children of product_category.id = 18.

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for OpenERP Server because there has been no activity for 60 days.]

Changed in openobject-server:
status: Incomplete → Expired
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.