Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
1670 มุมมอง


/web/content/11442


Admin can download using this path /web/content/11442

but the portal user is unable to download it shows message such as not found 


Portal users


Admin Users


อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi Neeraj


The path web/content/11442 is handled by this method

@http.route(['/web/content',
'/web/content/<string:xmlid>',
'/web/content/<string:xmlid>/<string:filename>',
'/web/content/<int:id>',
'/web/content/<int:id>/<string:filename>',
'/web/content/<string:model>/<int:id>/<string:field>',
'/web/content/<string:model>/<int:id>/<string:field>/<string:filename>'], type='http', auth="public")
# pylint: disable=redefined-builtin,invalid-name
def content_common(self, xmlid=None, model='ir.attachment', id=None, field='raw',
filename=None, filename_field='name', mimetype=None, unique=False,
download=False, access_token=None, nocache=False):
with replace_exceptions(UserError, by=request.not_found()):
record = request.env['ir.binary']._find_record(xmlid, model, id and int(id), access_token)
stream = request.env['ir.binary']._get_stream_from(record, field, filename, filename_field, mimetype)
if request.httprequest.args.get('access_token'):
stream.public = True

send_file_kwargs = {'as_attachment': str2bool(download)}
if unique:
send_file_kwargs['immutable'] = True
send_file_kwargs['max_age'] = http.STATIC_CACHE_LONG
if nocache:
send_file_kwargs['max_age'] = None

return stream.get_response(**send_file_kwargs)

So if not found, either the content does not exist or in your case it could be that the content is not intended to me accessible by public user


check the permission of the content you would liek to make accessibel to the public


Regards

Daniel

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Found any solution?

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
Document Layout แก้ไขแล้ว
1
พ.ค. 25
6801
2
ม.ค. 25
4444
0
พ.ย. 23
1197
0
พ.ย. 23
2627
4
ก.ค. 23
6623