Commit 1eaca183 authored by Xiaowu Zhang's avatar Xiaowu Zhang

erp5_printer: be able to use sale fast input on ERP5JS

not a generic way
it should add a real epson gadget
parent d7166422
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_onlyjio_action</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_onlyjio_action</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>print_by_epson</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>Modify portal content</string>
</tuple>
</value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>8.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Print By Epson</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/SaleOrder_viewPrintByEpsonDialog</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<registered_skin_selection>
<skin_folder_selection>
<skin_folder>erp5_printer</skin_folder>
<skin_selection>View</skin_selection>
<skin_selection>Hal,HalRestricted,RJS,View</skin_selection>
</skin_folder_selection>
</registered_skin_selection>
\ No newline at end of file
<!doctype html>
<html tal:define="data_dict here/Order_getODTDataDict;
<html tal:define="dummy_variable python:context.REQUEST.response.setHeader('Access-Control-Allow-Origin', '*');
data_dict here/Order_getODTDataDict;
portal_url here/portal_url;
reservation python: request.get('reservation_only');
form_id python: request.get('form_id');
......@@ -8,7 +9,7 @@
price_renderer nocall:here/Base_viewTradeFieldLibrary_printer_custom/my_view_mode_total_price/render_pdf;
default_language python:test(request.get('international_form'), 'en', here.Localizer.get_selected_language());
printer_url python:context.SaleOrder_getPrinterUrl();
order_number python:data_dict['reference'];">
order_number python:data_dict['reference']; ">
<head>
<meta charset="utf-8">
<title>Receipt</title>
......@@ -28,7 +29,7 @@
</span>
</h2>
<div tal:define="logo_path python: '%s?display=default_image?pre_converted_only=True&quality=75.0&display=thumbnail&format=png' % data_dict['source_section_image_path'];">
<div tal:define="logo_path python: '%s?quality=75.0&display=small&format=png' % data_dict['source_section_image_absolute_url'];">
<canvas id="canvas" width="512" style="display:none;" height="480"></canvas>
<img id="company_logo" alt="" tal:attributes="src logo_path;" width="250" height="45">
</div>
......@@ -268,7 +269,7 @@
<br />
<br />
<div id="loyalty_information_header" style="width:350px;text-align:center;"
tal:condition="order_number">
tal:condition="python: False # order_number">
<span> Programme de fidélité </span> <br />
<span> www.weinparis.com/loyalty </span>
</div>
......@@ -283,7 +284,7 @@
</div>
<br />
<div id="loyalty_information_bottom" style="width:350px;text-align:center;"
tal:condition="order_number">
tal:condition="python: False # order_number">
<span>en vous inscrivant, bénéficiez de 12% de</span>
<br />
<span>réduction sur votre prochain achat</span>
......@@ -298,7 +299,7 @@
<br>
</article>
<footer>Generated with ERP5 <br /> Open Source ERP suite (www.erp5.com)</footer>
<button tal:condition="python: not request.get('preview_only', 0)"
<button i18n:translate="" i18n:domain="ui" tal:condition="python: not request.get('preview_only', 0)"
id="print_button"
tal:attributes="onclick python:'printInvoiceOnEpson(\'%s\')' % printer_url"
onclick='printInvoiceOnEpson()'>Print by Epson</button>
......@@ -310,18 +311,24 @@
})
</script>
<a tal:condition="python: not reservation" href="./SaleOrder_confirmAndReturn">
<span i18n:translate='' i18n:domain=''> Confirm Order and Return </span>
<span i18n:translate='' i18n:domain='ui'>Confirm Order and Return </span>
</a>
<a tal:condition="reservation" href="./SaleOrderModule_viewReservedItemFastInputDialog">
<span i18n:translate='' i18n:domain=''> Return </span>
</a>
<a style="float:right" tal:attributes="href python:'./SaleOrder_cancelAndReturn?reservation=%s' % reservation">
<span i18n:translate='' i18n:domain=''> Cancel Order and Return</span>
<span i18n:translate='' i18n:domain='ui'>Return</span>
</a>
<div style="float:right">
<a tal:attributes="href python:'./SaleOrder_cancelAndReturn?reservation=%s' % reservation">
<span i18n:translate='' i18n:domain='ui'>Cancel Order and Return</span>
</a>
<br/>
<a href="./" target="_blank" tal:condition="nothing">
<span i18n:translate='' i18n:domain='ui'>Edit Order</span>
</a>
</div>
</tal:block>
<tal:block tal:condition="python: form_id and not request.get('auto_print', 0)">
<a tal:attributes="href string:./${form_id}">
<span i18n:translate='' i18n:domain=''> Return </span>
<a tal:attributes="href string:./${form_id}">
<span i18n:translate='' i18n:domain='ui'>Return</span>
</a>
</tal:block>
<tal:block tal:condition="python: request.get('js_error_log', 1)">
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Cacheable__manager_id</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SaleOrder_viewEpsonPrintoutAsGadget</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode></unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<!doctype html>
<html tal:define="dummy_variable python:context.REQUEST.response.setHeader('Access-Control-Allow-Origin', '*');
data_dict here/Order_getODTDataDict;
reservation python: request.get('reservation_only');
form_id python: request.get('form_id');
set_precision python: request.set('precision', here.getQuantityPrecisionFromResource(here.getPriceCurrency()));
quantity_renderer nocall:here/Base_viewTradeFieldLibrary_printer_custom/my_view_mode_quantity/render_pdf;
price_renderer nocall:here/Base_viewTradeFieldLibrary_printer_custom/my_view_mode_total_price/render_pdf;
default_language python:test(request.get('international_form'), 'en', here.Localizer.get_selected_language());
printer_url python:context.SaleOrder_getPrinterUrl();
order_number python:data_dict['reference']; ">
<head>
<meta charset="utf-8">
<title>Receipt</title>
<script type="text/javascript" src="jquery.js" ></script>
<script type="text/javascript" src="epos-print-4.1.0.js"></script>
<script type="text/javascript" src= "erp5_epson_canvas_printout.js"></script>
<script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script>
<script src="jiodev.js" type="text/javascript"></script>
<script type="text/javascript" src="erp5_epson_gadget.js" ></script>
<link rel="license" href="http://www.opensource.org/licenses/mit-license/">
</head>
<body style="background:white">
<header>
<h2 id="invoice_title" tal:define='orig_string python: reservation and "Reservation" or "Receipt";
orig_message python:unicode(here.Base_translateString(orig_string, lang=default_language),"utf-8");
translated_message python:unicode(here.Base_translateString(orig_string),"utf-8")'>
<span><span tal:content='orig_message'/></span>
<span tal:condition='python:translated_message != orig_message'>
<span tal:content='translated_message'/>
</span>
</h2>
<div tal:define="logo_path python: '%s?quality=75.0&display=small&format=png' % data_dict['source_section_image_absolute_url'];">
<canvas id="canvas" width="512" style="display:none;" height="480"></canvas>
<img id="company_logo" alt="" tal:attributes="src logo_path;" width="250" height="45">
</div>
<div id="company-info">
<div style="font-weight:bold" tal:content="python: data_dict['source_title']"></div>
<div tal:content="python: data_dict['source_section_registeredcapital']"></div>
<div tal:content="python: data_dict['source_address']"></div>
<div tal:content="python: data_dict['source_telfax']"></div>
<div tal:content="python: data_dict['source_email']"></div>
<div tal:content="python: data_dict['source_section_corporateregcode']"></div>
<div tal:content="python: data_dict['source_vatid']"></div>
<div>
</header>
<br>
<article>
<div id="detail">
<br>
<div id="invoice_information">
<div id="invoice_information_title">
<tal:block tal:define='orig_string string: Order Information;
orig_message python: unicode(here.Base_translateString(orig_string, lang=default_language),"utf-8");
translated_message python: unicode(here.Base_translateString(orig_string),"utf-8")'>
<span style="font-weight:bold"><span tal:replace='orig_message'/></span>
<span style="font-weight:bold" tal:condition='python:translated_message != orig_message'>
<span tal:replace='translated_message'/>
</span>
</tal:block>
</div>
<div id="invoice_information_detail">
<div>
<tal:block tal:define='orig_string string: Order Number;
orig_message python: unicode(here.Base_translateString(orig_string, lang=default_language),"utf-8");
translated_message python: unicode(here.Base_translateString(orig_string),"utf-8")'>
<span><span tal:replace='orig_message'/>:</span>
<span tal:condition='python:translated_message != orig_message'><span tal:replace='translated_message'/>:</span>
</tal:block>
<span tal:content='python:data_dict["reference"]'>8223</span>
</div>
<div>
<tal:block tal:define='orig_string string: Document Date;
orig_message python: unicode(here.Base_translateString(orig_string, lang=default_language),"utf-8");
translated_message python: unicode(here.Base_translateString(orig_string),"utf-8")'>
<span><span tal:replace='orig_message'/>:</span>
<span tal:condition='python:translated_message != orig_message'><span tal:replace='translated_message'/>:</span>
</tal:block>
<span tal:content="data_dict/start_date">2012/07/18</span>
</div>
<div>
<tal:block tal:define='orig_string string: Currency;
orig_message python: unicode(here.Base_translateString(orig_string, lang=default_language),"utf-8");
translated_message python: unicode(here.Base_translateString(orig_string),"utf-8")'>
<span><span tal:replace='orig_message'/>:</span>
<span tal:condition='python:translated_message != orig_message'><span tal:replace='translated_message'/>:</span>
</tal:block>
<span tal:content='python:data_dict["currency"]'>EUR</span>
</div>
<div>
<tal:block tal:condition='python:data_dict["payment_condition"]'
tal:define='orig_string string:Payment;
orig_message python:unicode(here.Base_translateString(orig_string, lang=default_language),"utf-8");
translated_message python:unicode(here.Base_translateString(orig_string),"utf-8")'>
<span><span tal:replace='orig_message'/>:</span>
<span tal:condition='python:translated_message != orig_message'> <span tal:replace='translated_message'/>:</span>
</tal:block>
<span tal:content='python:data_dict["payment_condition"]'>60 days</span>
</div>
<div>
<tal:block tal:condition='python:data_dict["delivery_mode"]'
tal:define='orig_string string:Delivery Mode;
orig_message python:unicode(here.Base_translateString(orig_string, lang=default_language),"utf-8");
translated_message python:unicode(here.Base_translateString(orig_string),"utf-8")'>
<span><span tal:replace='orig_message'/>:</span>
<span tal:condition='python:translated_message != orig_message'><span tal:replace='translated_message'/>:</span>
</tal:block>
<span tal:content='python:data_dict["delivery_mode"]'>del mode</span>
</div>
<div>
<tal:block tal:condition="nothing"
tal:define='orig_string string:Incoterm;
orig_message python:unicode(here.Base_translateString(orig_string, lang=default_language),"utf-8");
translated_message python:unicode(here.Base_translateString(orig_string),"utf-8")'>
<span><span tal:replace='orig_message'/>:</span>
<span tal:condition='python:translated_message != orig_message'><span tal:replace='translated_message'/>:</span>
</tal:block>
<span tal:content='python:data_dict["incoterm"]'>incoterm</span>
</div>
</div>
</div>
</div>
<br>
<div id="product_detail_title">
<span tal:define='orig_string string: Products details;
orig_message python: unicode(here.Base_translateString(orig_string, lang=default_language),"utf-8");
translated_message python: unicode(here.Base_translateString(orig_string),"utf-8")'>
<span style="font-weight:bold"><span tal:replace='orig_message'/></span>
<span style="font-weight:bold" tal:condition='python:translated_message != orig_message'><span tal:replace='translated_message'/></span>
</span>
</div>
<table id="invoice_line">
<thead>
<tr>
<th tal:define='orig_string string:PROD; orig_message python:unicode(here.Base_translateString(orig_string, lang=default_language),"utf-8"); translated_message python:unicode(here.Base_translateString(orig_string),"utf-8")'>
<span><span tal:replace='orig_message'/></span>
<span tal:condition='python:translated_message != orig_message'><span tal:replace='translated_message'/></span>
</th>
<th tal:define='orig_string string:QTY; orig_message python:unicode(here.Base_translateString(orig_string, lang=default_language),"utf-8"); translated_message python:unicode(here.Base_translateString(orig_string),"utf-8")'>
<span><span tal:replace='orig_message'/></span>
<span tal:condition='python:translated_message != orig_message'><span tal:replace='translated_message'/></span>
</th>
<th tal:condition="nothing" tal:define='orig_string string:U/P; orig_message python:unicode(here.Base_translateString(orig_string, lang=default_language),"utf-8"); translated_message python:unicode(here.Base_translateString(orig_string),"utf-8")'>
<span><span tal:replace='orig_message'/></span>
<span tal:condition='python:translated_message != orig_message'><span tal:replace='translated_message'/></span>
</th>
<th tal:condition="nothing" tal:define='orig_string string:TAX; orig_message python:unicode(here.Base_translateString(orig_string, lang=default_language),"utf-8"); translated_message python:unicode(here.Base_translateString(orig_string),"utf-8")'>
<span><span tal:replace='orig_message'/></span>
<span tal:condition='python:translated_message != orig_message'><span tal:replace='translated_message'/></span>
</th>
<th tal:define='orig_string string:PRICE; orig_message python:unicode(here.Base_translateString(orig_string, lang=default_language),"utf-8"); translated_message python:unicode(here.Base_translateString(orig_string),"utf-8")'>
<span><span tal:replace='orig_message'/></span>
<span tal:condition='python:translated_message != orig_message'><span tal:replace='translated_message'/></span>
</th>
</tr>
</thead>
<tbody>
<tal:block tal:repeat='line_dict python:data_dict["line_not_tax"]'>
<tr>
<td>
<span tal:content="line_dict/resource_title" />
</td>
<td><span tal:content="python: line_dict['total_quantity']"></span></td>
<td tal:condition="nothing"><span tal:content="python: line_dict['base_price']"></span></td>
<td tal:condition="nothing"><span tal:content="python: line_dict['tax_number']"></span></td>
<td><span tal:content="python: line_dict['total_price']"></span></td>
</tr>
</tal:block>
</tbody>
</table>
<br>
<table id="total_without_tax" tal:replace="nothing">
<tr>
<th tal:define='orig_string string:Total Excluding Tax; orig_message python:unicode(here.Base_translateString(orig_string, lang=default_language),"utf-8"); translated_message python:unicode(here.Base_translateString(orig_string),"utf-8")'>
<span><span tal:replace='orig_message'/>:</span>
<span tal:condition='python:translated_message != orig_message'><span tal:replace='translated_message'/>:</span>
</th>
<td><span tal:content="python: data_dict['total_price_exclude_tax']"></span></td>
</tr>
</table>
<div id="tax_detail_title" tal:replace="nothing">
<span tal:define='orig_string string: Tax details;
orig_message python: unicode(here.Base_translateString(orig_string, lang=default_language),"utf-8");
translated_message python: unicode(here.Base_translateString(orig_string),"utf-8")'>
<span style="font-weight:bold"><span tal:replace='orig_message'/></span>
<span style="font-weight:bold" tal:condition='python:translated_message != orig_message'><span tal:replace='translated_message'/></span>
</span>
</div>
<table id="tax" tal:replace="nothing">
<thead>
<tr>
<th tal:define='orig_string string:TAX; orig_message python:unicode(here.Base_translateString(orig_string, lang=default_language),"utf-8"); translated_message python:unicode(here.Base_translateString(orig_string),"utf-8")'>
<span><span tal:replace='orig_message'/></span>
<span tal:condition='python:translated_message != orig_message'><span tal:replace='translated_message'/></span>
</th>
<th tal:define='orig_string string:AMT; orig_message python:unicode(here.Base_translateString(orig_string, lang=default_language),"utf-8"); translated_message python:unicode(here.Base_translateString(orig_string),"utf-8")'>
<span><span tal:replace='orig_message'/></span>
<span tal:condition='python:translated_message != orig_message'><span tal:replace='translated_message'/></span>
</th>
<th tal:define='orig_string string:RATE; orig_message python:unicode(here.Base_translateString(orig_string, lang=default_language),"utf-8"); translated_message python:unicode(here.Base_translateString(orig_string),"utf-8")'>
<span><span tal:replace='orig_message'/></span>
<span tal:condition='python:translated_message != orig_message'><span tal:replace='translated_message'/></span>
</th>
<th tal:define='orig_string string:PRICE; orig_message python:unicode(here.Base_translateString(orig_string, lang=default_language),"utf-8"); translated_message python:unicode(here.Base_translateString(orig_string),"utf-8")'>
<span><span tal:replace='orig_message'/></span>
<span tal:condition='python:translated_message != orig_message'><span tal:replace='translated_message'/></span>
</th>
</tr>
</thead>
<tbody>
<tal:block tal:repeat='line_tax_dict python:data_dict["line_tax"]'>
<tr>
<td tal:condition="python: line_tax_dict['number_tax_line'] != ''">
<span tal:content="python: line_tax_dict['number_tax_line']">:</span>
</td>
<td tal:condition="python: line_tax_dict['total_quantity'] != ''">
<span tal:content="python: line_tax_dict['total_quantity']">qty</span>
</td>
<td tal:condition="python: line_tax_dict['base_price'] != ''">
<span tal:content="python: quantity_renderer(line_tax_dict['base_price']*100*1.00)+'%'">:</span>
</td>
<td tal:condition="python: line_tax_dict['total_price'] != ''">
<span tal:content="python: line_tax_dict['total_price']">:</span>
</td>
</tr>
</tal:block>
</tbody>
</table>
<table id="total_price">
<tr>
<th tal:define='orig_string string:Total Including Tax; orig_message python:unicode(here.Base_translateString(orig_string, lang=default_language),"utf-8"); translated_message python:unicode(here.Base_translateString(orig_string),"utf-8")'>
<span><span tal:replace='orig_message'/> :</span>
<span tal:condition='python:translated_message != orig_message'><span tal:replace='translated_message'/>:</span>
</th>
<td tal:condition="python: data_dict['total_price'] != ''" tal:attributes='office:value data_dict/total_price'>
<span tal:content="python: data_dict['total_price']">:</span>
</td>
</tr>
</table>
<table id="total_discount" tal:condition="python:float(data_dict['total_discount']) != 0">
<tr>
<th tal:define='orig_string string: Discount ;
orig_message python:unicode(here.Base_translateString(orig_string, lang=default_language),"utf-8");
translated_message python:unicode(here.Base_translateString(orig_string),"utf-8")'>
<span><span tal:replace='orig_message'/> :</span>
<span tal:condition='python:translated_message != orig_message'><span tal:replace='translated_message'/>:</span>
</th>
<td tal:condition="python: data_dict['total_discount'] != ''">
<span tal:content="python: data_dict['total_discount']">:</span>
</td>
</tr>
</table>
<table id="total_price_with_discount" tal:condition="python:float(data_dict['total_discount']) != 0">
<tr>
<th tal:define='orig_string string:Total With Discount;
orig_message python:unicode(here.Base_translateString(orig_string, lang=default_language),"utf-8");
translated_message python:unicode(here.Base_translateString(orig_string),"utf-8")'>
<span><span tal:replace='orig_message'/> :</span>
<span tal:condition='python:translated_message != orig_message'><span tal:replace='translated_message'/>:</span>
</th>
<td tal:condition="python: data_dict['total_price_with_discount'] != ''">
<span tal:content="python: data_dict['total_price_with_discount']">:</span>
</td>
</tr>
</table>
<br />
<br />
<div id="loyalty_information_header" style="width:350px;text-align:center;"
tal:condition="python: False # order_number">
<span> Programme de fidélité </span> <br />
<span> www.weinparis.com/loyalty </span>
</div>
<br />
<div id="loyalty_information_image" style="width:350px;text-align:center;"
tal:condition="order_number">
<canvas id="ordernumbercanvas" width="512" style="display:none;" height="480"></canvas>
<img id="order_barcode" width="250" height="45"
tal:attributes="src string: Base_generateBarcodeImage?barcode_type=code128&data=${order_number}">
<br />
<span id="order_number" tal:content="order_number"> Reference </span>
</div>
<br />
<div id="loyalty_information_bottom" style="width:350px;text-align:center;"
tal:condition="python: False # order_number">
<span>en vous inscrivant, bénéficiez de 12% de</span>
<br />
<span>réduction sur votre prochain achat</span>
<br />
<span> après 300 EUR d'achat. </span>
<br />
<span>Conservez bien ce ticket et les </span>
<br />
<span>tickets de vos vêtements </span>
</div>
<br>
<br>
</article>
<footer>Generated with ERP5 <br /> Open Source ERP suite (www.erp5.com)</footer>
<button i18n:translate="" i18n:domain="ui" tal:condition="python: not request.get('preview_only', 0)"
id="print_button"
tal:attributes="onclick python:'printInvoiceOnEpson(\'%s\')' % printer_url"
onclick='printInvoiceOnEpson()'>Print by Epson</button>
<tal:block tal:condition="python: request.get('auto_print', 0)">
<script type="text/javascript">
$(window).load(function() {
$('#print_button').click();
})
</script>
<form>
<button class="confirm_return" type="submit" tal:condition="python: not reservation" value="SaleOrder_confirmAndReturn">
<span i18n:translate='' i18n:domain='ui'>Confirm Order and Return </span>
</button>
<a tal:condition="reservation" href="./SaleOrderModule_viewReservedItemFastInputDialog">
<span i18n:translate='' i18n:domain='ui'>Return</span>
</a>
<div style="float:right">
<button class="cancel_return" type="submit" tal:attributes="value python:'SaleOrder_cancelAndReturn?reservation=%s' % reservation">
<span i18n:translate='' i18n:domain='ui'>Cancel Order and Return</span>
</button>
<br/>
<a href="./" target="_blank" tal:condition="nothing">
<span i18n:translate='' i18n:domain='ui'>Edit Order</span>
</a>
</div>
</form>
</tal:block>
<tal:block tal:condition="python: form_id and not request.get('auto_print', 0)">
<a tal:attributes="href string:./${form_id}">
<span i18n:translate='' i18n:domain='ui'>Return</span>
</a>
</tal:block>
<tal:block tal:condition="python: request.get('js_error_log', 1)">
<hr>
<div id="js_error_log"> </div>
</tal:block>
</body>
</html>
\ No newline at end of file
return context.restrictedTraverse(relative_url).SaleOrder_viewEpsonPrintoutAsGadget()
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>relative_url,**kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SaleOrder_viewEpsonPrintoutWrapper</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5 Form" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>action_title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>edit_order</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>enctype</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<list>
<string>left</string>
<string>right</string>
<string>center</string>
<string>bottom</string>
<string>hidden</string>
</list>
</value>
</item>
<item>
<key> <string>groups</string> </key>
<value>
<dictionary>
<item>
<key> <string>bottom</string> </key>
<value>
<list>
<string>preview</string>
</list>
</value>
</item>
<item>
<key> <string>center</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>hidden</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>left</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>right</string> </key>
<value>
<list/>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SaleOrder_viewPrintByEpsonDialog</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>SaleOrder_viewEpsonPrintoutWrapper</string> </value>
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>form_view</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
<value> <int>4</int> </value>
</item>
<item>
<key> <string>stored_encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>unicode_mode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>update_action</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>update_action_title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="GadgetField" module="Products.ERP5Form.GadgetField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>preview</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
<item>
<key> <string>no_validator</string> </key>
<value> <string>Does not support this operation.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>data_url</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>gadget_url</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>js_sandbox</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>renderjs_extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>validator_field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>validator_form_id</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>data_url</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>gadget_url</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>js_sandbox</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>renderjs_extra</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>validator_field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>validator_form_id</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>data_url</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>gadget_url</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>js_sandbox</string> </key>
<value> <string>iframe</string> </value>
</item>
<item>
<key> <string>renderjs_extra</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>preview</string> </value>
</item>
<item>
<key> <string>validator_field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>validator_form_id</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string encoding="cdata"><![CDATA[
python: "SaleOrder_viewEpsonPrintoutWrapper?relative_url=%s&auto_print:int=%s&reservation_only:int=%s" % (context.getRelativeUrl(), request.get("auto_print", 0), request.get("reservation_only", 0))
]]></string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python:{"jio_key": context.getRelativeUrl()}</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
/*global window, rJS, document*/
/*jslint nomen: true, indent: 2, maxerr: 3 */
(function (window, rJS, document) {
"use strict";
var gadget_klass = rJS(window);
gadget_klass
.declareAcquiredMethod("submitContent", "submitContent")
.declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("redirect", "redirect")
.declareMethod("render", function (options) {
var gadget = this;
gadget.state.jio_key = options.jio_key;
return gadget.getSetting('hateoas_url')
.push(function (hateoas_url) {
gadget.state.hateoas_url = hateoas_url;
});
})
.onEvent('submit', function submit(options) {
var method = document.activeElement.value,
gadget = this;
return gadget.submitContent(
gadget.state.jio_key,
gadget.state.hateoas_url + gadget.state.jio_key + "/" + method,
{})
.push(function (result) {
return gadget.redirect({
command: 'display',
options: {
"jio_key": result.jio_key,
"view": result.view
}
});
})
.push(undefined, function(error) {
if (! error instanceof RSVP.CancellationError) {
throw error
}
});
});
}(window, rJS, document));
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>erp5_epson_gadget.js</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/javascript</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
Sale Order | order_epson_print
\ No newline at end of file
Sale Order | order_epson_print
Sale Order | print_by_epson
\ No newline at end of file
erp5_printer | Hal
erp5_printer | HalRestricted
erp5_printer | RJS
erp5_printer | View
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment