94 lines
6.4 KiB
XML
94 lines
6.4 KiB
XML
<template>
|
|
<t t-name="EdiEmpty">
|
|
<div style="height:100%;"></div>
|
|
</t>
|
|
<t t-name="EdiImport">
|
|
<t t-call="WebClient"/>
|
|
</t>
|
|
<t t-name="EdiView">
|
|
<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%" id="oe_app" class="oe-application oe_forms oe_semantic_html_override">
|
|
<tr>
|
|
<td colspan="2" valign="top" id="oe_header" class="header">
|
|
<div> <a href="/" class="company_logo_link">
|
|
<div class="company_logo"
|
|
t-att-style="'background-size: 180px 46px; background: url('+ (doc.company_address ? '/edi/binary?db='+widget.db+'&token='+widget.token : '/web/static/src/img/logo.png')+')'"/></a> </div>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="2" valign="top" height="100%">
|
|
<table cellspacing="0" cellpadding="0" border="0" height="100%" width="100%">
|
|
<tr>
|
|
<td class="oe_edi_view">
|
|
<p class="oe_paragraph"><t t-raw="widget.content"/></p>
|
|
<button type="button" class="oe_edi_action_print">
|
|
View/Print <img src="/edi/static/src/img/pdf.png"/>
|
|
</button>
|
|
</td>
|
|
<td class="oe_edi_sidebar_container">
|
|
<p class="oe_edi_sidebar_title">
|
|
Import this document
|
|
</p>
|
|
<div class="oe_edi_option">
|
|
<input type="radio" id="oe_edi_import_openerp" name="oe_edi_import" class="oe_edi_import_choice"/>
|
|
<label for="oe_edi_import_openerp" id="oe_edi_import_openerp" class="oe_edi_import_choice_label">Import it into an existing OpenERP instance</label>
|
|
</div>
|
|
<p class="oe_edi_nested_block_import oe_edi_import_openerp_nested">
|
|
<label for="oe_edi_txt_server_url">OpenERP instance address:</label>
|
|
<br/>
|
|
<input type="text" id="oe_edi_txt_server_url" placeholder="http://example.my.openerp.com/"/><br/>
|
|
<button type="button" class="oe_edi_import_button" id="oe_edi_import_existing">Import</button>
|
|
</p>
|
|
|
|
<div class="oe_edi_option">
|
|
<input type="radio" id="oe_edi_import_saas" name="oe_edi_import" class="oe_edi_import_choice"/>
|
|
<label for="oe_edi_import_saas" id="oe_edi_import_saas" class="oe_edi_import_choice_label">Import it into a new OpenERP Online instance</label>
|
|
</div>
|
|
<p class="oe_edi_nested_block_import oe_edi_import_saas_nested">
|
|
<button type="button" class="oe_edi_import_button" id="oe_edi_import_create">Create my new OpenERP instance</button>
|
|
</p>
|
|
|
|
<div class="oe_edi_option">
|
|
<input type="radio" id="oe_edi_import_download" name="oe_edi_import" class="oe_edi_import_choice"/>
|
|
<label for="oe_edi_import_download" id="oe_edi_import_download" class="oe_edi_import_choice_label">Import into another application</label>
|
|
</div>
|
|
<p class="oe_edi_nested_block_import oe_edi_small oe_edi_import_download_nested">
|
|
OpenERP's Electronic Data Interchange documents are based on a generic and language
|
|
independent <a href="http://json.org">JSON</a> serialization of the document's attribute.
|
|
It is usually very quick and straightforward to create a small plug-in for your preferred
|
|
application that will be capable of importing any OpenERP EDI document.
|
|
You can find out more details about how to do this and what the content of OpenERP EDI documents
|
|
is like in the <a href="http://doc.openerp.com/search.html?q=edi">OpenERP documentation</a>.
|
|
<br/>
|
|
To get started immediately, <a href="#" id="oe_edi_download_show_code">see is all it takes to use this EDI document in Python</a>.
|
|
</p>
|
|
<div class="python oe_edi_nested_block_import oe_edi_small" id="oe_edi_download_code" t-translation="off">
|
|
<ol><li class="li1"><div class="de1"><span class="kw1">import</span> <span class="kw3">urllib2</span><span class="sy0">,</span> simplejson</div></li>
|
|
<li class="li1"><div class="de1">edi_document <span class="sy0">=</span> <span class="kw3">urllib2</span>.<span class="me1">urlopen</span><span class="br0">(</span><span class="st0">'<t t-esc="widget.get_download_url()"/>'</span><span class="br0">)</span>.<span class="me1">read</span><span class="br0">(</span><span class="br0">)</span></div></li>
|
|
<li class="li2"><div class="de2">document_data <span class="sy0">=</span> simplejson.<span class="me1">loads</span><span class="br0">(</span>edi_document<span class="br0">)</span><span class="br0">[</span><span class="nu0">0</span><span class="br0">]</span></div></li>
|
|
<li class="li1"><div class="de1"><span class="kw1">print</span> <span class="st0">"Amount: "</span><span class="sy0">,</span> document_data<span class="br0">[</span><span class="st0">'amount_total'</span><span class="br0">]</span></div></li>
|
|
</ol></div>
|
|
<p class="oe_edi_nested_block_import oe_edi_small oe_edi_import_download_nested">
|
|
You can download the raw EDI document here:<br/>
|
|
<input type="text" readonly="readonly" t-att-value="widget.get_download_url()"/>
|
|
<button type="button" class="oe_edi_import_button" id="oe_edi_download">Download</button>
|
|
</p>
|
|
|
|
<div class="oe_edi_right_bottom">
|
|
<t t-raw="widget.sidebar"/>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="2">
|
|
<div id="oe_footer" class="oe_footer">
|
|
<p class="oe_footer_powered">Powered by <a href="http://www.openerp.com">OpenERP</a></p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</t>
|
|
</template>
|