Browse Source

publish muk_web_utils - 12.0

pull/115/head
MuK IT GmbH 6 years ago
parent
commit
58f7801b8a
  1. 2
      muk_web_utils/__manifest__.py
  2. 6
      muk_web_utils/controllers/attachment.py
  3. 14
      muk_web_utils/i18n/de.po

2
muk_web_utils/__manifest__.py

@ -20,7 +20,7 @@
{ {
"name": "MuK Web Utils", "name": "MuK Web Utils",
"summary": """Utility Features""", "summary": """Utility Features""",
"version": "12.0.2.9.4",
"version": "12.0.2.9.6",
"category": "Extra Tools", "category": "Extra Tools",
"license": "AGPL-3", "license": "AGPL-3",
"author": "MuK IT", "author": "MuK IT",

6
muk_web_utils/controllers/attachment.py

@ -40,11 +40,15 @@ class AttachmentController(http.Controller):
'type': 'binary', 'type': 'binary',
'public': False, 'public': False,
'temporary': tmp, 'temporary': tmp,
'mimetype': ufile.mimetype if ufile.mimetype and ufile.mimetype != 'application/octet-stream' else None,
}) })
attachment.generate_access_token() attachment.generate_access_token()
if ufile.mimetype and ufile.mimetype != 'application/octet-stream':
attachment.sudo().write({
'mimetype': ufile.mimetype,
})
base_url = request.env['ir.config_parameter'].sudo().get_param('web.base.url') base_url = request.env['ir.config_parameter'].sudo().get_param('web.base.url')
result = attachment.read(['name', 'datas_fname', 'mimetype', 'checksum', 'access_token'])[0] result = attachment.read(['name', 'datas_fname', 'mimetype', 'checksum', 'access_token'])[0]
result['url'] = '%s/web/content/%s?access_token=%s' % (base_url, attachment.id, attachment.access_token) result['url'] = '%s/web/content/%s?access_token=%s' % (base_url, attachment.id, attachment.access_token)
print(result)
return json.dumps(result) return json.dumps(result)

14
muk_web_utils/i18n/de.po

@ -7,13 +7,16 @@ msgstr ""
"Project-Id-Version: Odoo Server 12.0-20190128\n" "Project-Id-Version: Odoo Server 12.0-20190128\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-02-27 09:28+0000\n" "POT-Creation-Date: 2019-02-27 09:28+0000\n"
"PO-Revision-Date: 2019-02-27 09:28+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"PO-Revision-Date: 2019-05-12 17:18+0000\n"
"Last-Translator: Manuel Marklo <manuel.marklo@mukit.at>\n"
"Language-Team: German <http://https://weblate.mukit.at/projects/web-12/"
"muk_web_utils/de/>\n"
"Language: de\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n" "Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 3.4\n"
#. module: muk_web_utils #. module: muk_web_utils
#. openerp-web #. openerp-web
@ -163,7 +166,7 @@ msgstr "Konfiguration "
#: code:addons/muk_web_utils/static/src/xml/share.xml:97 #: code:addons/muk_web_utils/static/src/xml/share.xml:97
#, python-format #, python-format
msgid "Download" msgid "Download"
msgstr ""
msgstr "Herunterladen"
#. module: muk_web_utils #. module: muk_web_utils
#. openerp-web #. openerp-web
@ -323,4 +326,3 @@ msgstr ""
#, python-format #, python-format
msgid "shared a message with you!" msgid "shared a message with you!"
msgstr "" msgstr ""
Loading…
Cancel
Save