Skip to content
Snippets Groups Projects
Commit 24480a24 authored by Christophe Matthieu's avatar Christophe Matthieu
Browse files

[FIX] product: access right. Resolve: Use Superuser in name_get method to fetch partners/sellers

bzr revid: chm@openerp.com-20140109124423-vq7u14q089xiqtt9
parent 492af3af
No related branches found
No related tags found
No related merge requests found
......@@ -23,6 +23,7 @@ import math
import re
from _common import rounding
from openerp import SUPERUSER_ID
from openerp import tools
from openerp.osv import osv, fields
......@@ -735,8 +736,13 @@ class product_product(osv.osv):
partner_id = context.get('partner_id', False)
# all user don't have access to seller and partner
# check access and use superuser
self.check_access_rights(cr, user, "read")
self.check_access_rule(cr, user, ids, "read", context=context)
result = []
for product in self.browse(cr, user, ids, context=context):
for product in self.browse(cr, SUPERUSER_ID, ids, context=context):
sellers = filter(lambda x: x.name.id == partner_id, product.seller_ids)
if sellers:
for s in sellers:
......
......@@ -9,7 +9,7 @@ OpenERP E-Commerce
""",
'author': 'OpenERP SA',
'depends': ['website', 'sale', 'product', 'payment_acquirer'],
'depends': ['website', 'sale', 'payment_acquirer'],
'data': [
'data/website_sale_data.xml',
'views/website_sale.xml',
......
......@@ -11,4 +11,4 @@ access_product_attribute,product.attribute.public,website_sale.model_product_att
access_product_attribute_value,product.attribute.value.public,website_sale.model_product_attribute_value,,1,0,0,0
access_product_attribute_product,product.attribute.product.public,website_sale.model_product_attribute_product,,1,0,0,0
access_website_product_style,website.product.style.public,website_sale.model_website_product_style,,1,0,0,0
access_product_supplierinfo,product.supplierinfo.public,product.model_product_supplierinfo,,1,0,0,0
access_product_supplierinfo,product.supplierinfo.public,product.model_product_supplierinfo,base.group_public,1,0,0,0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment