[FIX] product: access right. Resolve: Use Superuser in name_get method to fetch partners/sellers
bzr revid: chm@openerp.com-20140109124423-vq7u14q089xiqtt9
This commit is contained in:
parent
492af3afbf
commit
24480a2440
|
@ -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
|
||||
|
|
|
Loading…
Reference in New Issue