stock.picking.out group by in multi companies
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Addons (MOVED TO GITHUB) |
Fix Released
|
Low
|
OpenERP Publisher's Warranty Team |
Bug Description
In multi company context, when using the group by 'state' in Delivery Orders I encountered the following error:
(Document type: Picking List, Operation: read)
Traceback (most recent call last):
File ".../server/
result = ExportService.
File ".../server/
res = fn(db, uid, *params)
File ".../server/
return self.execute(db, uid, obj, method, *args, **kw or {})
File ".../server/
return f(self, dbname, *args, **kwargs)
File ".../server/
res = self.execute_cr(cr, uid, obj, method, *args, **kw)
File ".../server/
return getattr(object, method)(cr, uid, *args, **kw)
File ".../server/
data = self.read(cr, uid, data_ids, [groupby], context=context)
File ".../addons/
return self.pool.
File ".../server/
result = self._read_flat(cr, user, select, fields, context, load)
File ".../server/
self.
File ".../server/
(self.
except_osv: (u'Access Denied', u'The requested operation cannot be completed due to security restrictions. Please contact your system administrator.
After digging a bit, I found that orm method read_group calls
orm.py: 2640
In there, we get the get domain on stock.picking.out which will be empty by default. So query will not have any ir_rule applied.
Then, in read_group again, there is the big query that will get the counts. However it will also takes min(id).
The min id will be passed in read() to which will again be applied the ir_rules. But this time it won't be None, it will read stock.picking rule and not the unexistant stock.picking.out rule.
Thus it will fail if min id is a stock picking out from the other company than the current user's company.
As a temporary patch I duplicated stock.stock_
I'll provide a patch to solve it on the read_group method in stock module
Related branches
- Martin Trigaux (OpenERP) (community): Approve
-
Diff: 23 lines (+6/-0)1 file modifiedstock/stock.py (+6/-0)
- OpenERP Community Backports: Pending requested
-
Diff: 23 lines (+6/-0)1 file modifiedstock/stock.py (+6/-0)
description: | updated |
Changed in openobject-addons: | |
assignee: | nobody → OpenERP Publisher's Warranty Team (openerp-opw) |
tags: | added: maintenance |
no longer affects: | ocb-addons/7.0 |
no longer affects: | ocb-addons |
Hello,
Thanks for the report and the patch, it was merged in 7.0
revno: 10010 [merge]
revision-id: <email address hidden>