Commit 1f6dd5e8 by 夏超

[fix] 玖姿功能

parent 8d522b8e
......@@ -3,7 +3,7 @@ import hashlib
import os
import re
from odoo import models, fields, api, _
from odoo import models, fields, http, api, _
from odoo.modules.module import get_resource_path, get_module_path
from odoo.tools.mimetypes import guess_mimetype
from odoo.tools import consteq, pycompat
......@@ -15,7 +15,8 @@ class InheritIrHttp(models.AbstractModel):
@classmethod
def _binary_ir_attachment_redirect_content(cls, record, default_mimetype='application/octet-stream'):
# mainly used for theme images attachemnts
if record.type == 'url' and record.url and "http://121.37.69.162:9000" in record.url:
base = http.request.env['ir.config_parameter'].sudo().get_param('web.base.url', '')
if record.type == 'url' and record.url and base.startswith("https") and "http://121.37.69.162:9000" in record.url:
filename = filehash = None
mimetype = getattr(record, 'mimetype', False)
url = record.url.replace("http://121.37.69.162:9000", "https://minio.xbg.rokeris.com")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment