summaryrefslogtreecommitdiff
path: root/addons/web/static/src/xml/base.xml
diff options
context:
space:
mode:
authorjpr-odoo <jpr@openerp.com>2017-11-01 15:15:04 +0530
committerYannick Tivisse <yti@odoo.com>2018-02-09 06:59:56 +0100
commitb7aa439826df6b3e442b3f60bb593ff28efc8679 (patch)
tree953d340f839717c5de254ca90cb3d3cde9b44d0d /addons/web/static/src/xml/base.xml
parentdfdc06fe4332b3de97a3b1f8f554ce6adc3b948d (diff)
[ADD] web: Add a new widget to attach documents on a record
Purpose ======= Add the possibility to easily attach a document on a record. That could be used for to attach receipts on expense for example. Specification ============= Add a new widget (AttachDocument) to allow attach document from mobile/web directly on record form After attaching document it will call action given on widget, that action will be a method name on given model
Diffstat (limited to 'addons/web/static/src/xml/base.xml')
-rw-r--r--addons/web/static/src/xml/base.xml16
1 files changed, 16 insertions, 0 deletions
diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml
index 196346d4d9c..ce432fea823 100644
--- a/addons/web/static/src/xml/base.xml
+++ b/addons/web/static/src/xml/base.xml
@@ -1351,4 +1351,20 @@
</div>
</t>
+<t t-name="AttachDocument">
+ <button class="btn btn-sm btn-default o_attachment_button">
+ <span class="o_attach_document"><t t-esc="widget.node.attrs.string"/></span>
+ <span class="hide">
+ <t t-call="HiddenInputFile">
+ <t t-set="fileupload_id" t-value="widget.fileuploadID"/>
+ <t t-set="fileupload_action" t-translation="off">/web/binary/upload_attachment</t>
+ <t t-set="multi_upload" t-value="true"/>
+ <input type="hidden" name="model" t-att-value="widget.res_model"/>
+ <input type="hidden" name="id" t-att-value="widget.res_id"/>
+ <input type="hidden" name="session_id" t-att-value="widget.getSession().session_id"/>
+ </t>
+ </span>
+ </button>
+</t>
+
</templates>