summaryrefslogtreecommitdiff
path: root/addons/mrp/static/src/xml/mrp.xml
diff options
context:
space:
mode:
authorRavi Gadhia <rga@odoo.com>2016-09-14 19:00:16 +0530
committerJosse Colpaert <jco@odoo.com>2016-09-30 16:31:46 +0200
commit89c78e40cbcebca393cc162677bb82e05f0b92e8 (patch)
treef0a1b46f7bb4331780d9ddefdfcaa59377f87c0c /addons/mrp/static/src/xml/mrp.xml
parente2fb1cb6ce0afe490a66c5b491a00b55b866118d (diff)
[ADD] MRP: Add pdf viewer widget to view 'pdf' work instruction of workorder.
Diffstat (limited to 'addons/mrp/static/src/xml/mrp.xml')
-rw-r--r--addons/mrp/static/src/xml/mrp.xml23
1 files changed, 23 insertions, 0 deletions
diff --git a/addons/mrp/static/src/xml/mrp.xml b/addons/mrp/static/src/xml/mrp.xml
new file mode 100644
index 00000000000..7f86a6a20dd
--- /dev/null
+++ b/addons/mrp/static/src/xml/mrp.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<templates id="template" xml:space="preserve">
+ <t t-name="FieldPdfViewer">
+ <div class="o_form_field_pdfviewer">
+ <div t-if="!widget.get('effective_readonly')" class="o_form_pdf_controls mt8">
+ <span class="o_form_binary_progress">Uploading...</span>
+ <button type="button" class="btn btn-sm btn-primary o_select_file_button" title="Select">Upload your file</button>
+ <button class="btn btn-sm btn-default fa fa-pencil o_select_file_button" title="Select" type="button"></button>
+ <button class="btn btn-sm btn-default fa fa-trash-o o_clear_file_button" title="Clear" type="button"></button>
+ </div>
+ <iframe class="o_pdfview_iframe o_form_field_pdfviewer"/>
+ <t t-call="HiddenInputPDFFile">
+ <t t-set="fileupload_id" t-value="widget.fileupload_id"/>
+ <t t-set="fileupload_style" t-translation="off">overflow-x: hidden</t>
+ </t>
+ </div>
+ </t>
+ <t t-extend="HiddenInputFile" t-name="HiddenInputPDFFile">
+ <t t-jquery="input[type='file']:first" t-operation="replace">
+ <input type="file" class="o_form_input_file" name="ufile" accept="application/pdf" />
+ </t>
+ </t>
+</templates>