[NEW] New module: attachment_attach_non_editable

In odoo, by default, you can't add attachments to a record if the form view
is set as not editable (``edit='false'`` in the form tag)

This module adds a new form view attribute, ``attach=``, which lets you
enable attachment uploads even in non-editable forms.
This commit is contained in:
Leonardo Donelli
2017-02-03 15:05:36 +01:00
parent 651a8db80c
commit 8b6f3273ff
6 changed files with 115 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
<t t-extend="Sidebar">
<t t-jquery=".o_sidebar_add_attachment">
this.attr('t-if', "section.name == 'files' and (widget.options.editable or widget.options.attachable)");
</t>
</t>
</templates>