mirror of
https://github.com/OCA/knowledge.git
synced 2025-07-13 15:34:49 -06:00

Define the add attachment and add URL buttons on the same line. Allow downloading of url type attachments by clicking on the icon or the name. Define the name of the url type attachments as links (allows to open it in a new tab). Hide the download button for url attachments. Force to set mimetype to "application/link" for url attachments. Displays a link icon for url attachments. TT30263
46 lines
1.6 KiB
XML
46 lines
1.6 KiB
XML
<?xml version="1.0" encoding="utf-8" ?>
|
|
<odoo>
|
|
<template
|
|
id="assets_backend"
|
|
name="document_url assets"
|
|
inherit_id="web.assets_backend"
|
|
>
|
|
<xpath expr="." position="inside">
|
|
<script type="text/javascript" src="/document_url/static/src/js/url.js" />
|
|
<link
|
|
href="/document_url/static/src/scss/document_url.scss"
|
|
rel="stylesheet"
|
|
/>
|
|
</xpath>
|
|
</template>
|
|
<record model="ir.actions.act_window" id='action_ir_attachment_add_url'>
|
|
<field name="name">Add URL</field>
|
|
<field name="res_model">ir.attachment.add_url</field>
|
|
<field name="type">ir.actions.act_window</field>
|
|
<field name="target">new</field>
|
|
<field name="view_mode">form</field>
|
|
</record>
|
|
<record model="ir.ui.view" id="view_ir_attachment_add_url_form">
|
|
<field name="name">ir.attachment.add_url.form</field>
|
|
<field name="model">ir.attachment.add_url</field>
|
|
<field name="arch" type="xml">
|
|
<form string="Add URL">
|
|
<group>
|
|
<field name="name" />
|
|
<field name="url" widget="url" />
|
|
</group>
|
|
<footer>
|
|
<button
|
|
name="action_add_url"
|
|
string="Add"
|
|
class="oe_highlight"
|
|
type="object"
|
|
/>
|
|
or
|
|
<button special="cancel" string="Cancel" class="oe_link" />
|
|
</footer>
|
|
</form>
|
|
</field>
|
|
</record>
|
|
</odoo>
|