Commit f34338a1 authored by Xiaowu Zhang's avatar Xiaowu Zhang

erp5_printer: possible to return to different view

parent b5dd91d6
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
]; ];
gadget.state.jio_key = options.jio_key; gadget.state.jio_key = options.jio_key;
gadget.state.printer_url = options.printer_url; gadget.state.printer_url = options.printer_url;
gadget.state.redirect_form_id = options.redirect_form_id;
return new RSVP.Queue() return new RSVP.Queue()
.push(function (hateoas_url) { .push(function (hateoas_url) {
return RSVP.all([ return RSVP.all([
...@@ -93,7 +94,7 @@ ...@@ -93,7 +94,7 @@
gadget = this; gadget = this;
return gadget.submitContent( return gadget.submitContent(
gadget.state.jio_key, gadget.state.jio_key,
gadget.state.hateoas_url + gadget.state.jio_key + "/" + method, gadget.state.hateoas_url + gadget.state.jio_key + "/" + method + "?redirect_form_id=" + gadget.state.redirect_form_id,
{}) {})
.push(function (result) { .push(function (result) {
return gadget.redirect({ return gadget.redirect({
......
...@@ -252,7 +252,7 @@ ...@@ -252,7 +252,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>984.44075.1419.10496</string> </value> <value> <string>990.32371.21747.32204</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -270,7 +270,7 @@ ...@@ -270,7 +270,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1593420843.63</float> <float>1614947584.55</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
portal_url here/portal_url; portal_url here/portal_url;
reservation python: request.get('reservation_only'); reservation python: request.get('reservation_only');
form_id python: request.get('form_id'); form_id python: request.get('form_id');
redirect_form_id python: request.get('redirect_form_id', '');
set_precision python: request.set('precision', here.getQuantityPrecisionFromResource(here.getPriceCurrency())); set_precision python: request.set('precision', here.getQuantityPrecisionFromResource(here.getPriceCurrency()));
quantity_renderer nocall:here/Base_viewTradeFieldLibrary_printer_custom/my_view_mode_quantity/render_pdf; 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; price_renderer nocall:here/Base_viewTradeFieldLibrary_printer_custom/my_view_mode_total_price/render_pdf;
...@@ -310,14 +311,14 @@ ...@@ -310,14 +311,14 @@
$('#print_button').click(); $('#print_button').click();
}) })
</script> </script>
<a tal:condition="python: not reservation" href="./SaleOrder_confirmAndReturn"> <a tal:condition="python: not reservation" tal:attributes="href python:'./SaleOrder_confirmAndReturn?redirect_form_id=%s' % redirect_form_id" >
<span i18n:translate='' i18n:domain='ui'>Confirm Order and Return </span> <span i18n:translate='' i18n:domain='ui'>Confirm Order and Return </span>
</a> </a>
<a tal:condition="reservation" href="./SaleOrderModule_viewReservedItemFastInputDialog"> <a tal:condition="reservation" href="./SaleOrderModule_viewReservedItemFastInputDialog">
<span i18n:translate='' i18n:domain='ui'>Return</span> <span i18n:translate='' i18n:domain='ui'>Return</span>
</a> </a>
<div style="float:right"> <div style="float:right">
<a tal:attributes="href python:'./SaleOrder_cancelAndReturn?reservation=%s' % reservation"> <a tal:attributes="href python:'./SaleOrder_cancelAndReturn?reservation=%s&redirect_form_id=%s' % (reservation, redirect_form_id)">
<span i18n:translate='' i18n:domain='ui'>Cancel Order and Return</span> <span i18n:translate='' i18n:domain='ui'>Cancel Order and Return</span>
</a> </a>
<br/> <br/>
......
...@@ -253,7 +253,7 @@ ...@@ -253,7 +253,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python:{"jio_key": context.getRelativeUrl(), "data_dict": context.Order_getODTDataDict(), "printer_url": context.SaleOrder_getPrinterUrl(), "auto_print": context.REQUEST.get("auto_print", 0)}</string> </value> <value> <string>python:{"jio_key": context.getRelativeUrl(), "data_dict": context.Order_getODTDataDict(), "printer_url": context.SaleOrder_getPrinterUrl(), "auto_print": context.REQUEST.get("auto_print", 0), "redirect_form_id": context.REQUEST.get("redirect_form_id", "")}</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
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