Commit f34338a1 authored by Xiaowu Zhang's avatar Xiaowu Zhang

erp5_printer: possible to return to different view

parent b5dd91d6
......@@ -38,6 +38,7 @@
];
gadget.state.jio_key = options.jio_key;
gadget.state.printer_url = options.printer_url;
gadget.state.redirect_form_id = options.redirect_form_id;
return new RSVP.Queue()
.push(function (hateoas_url) {
return RSVP.all([
......@@ -93,7 +94,7 @@
gadget = this;
return gadget.submitContent(
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) {
return gadget.redirect({
......
......@@ -252,7 +252,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>984.44075.1419.10496</string> </value>
<value> <string>990.32371.21747.32204</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -270,7 +270,7 @@
</tuple>
<state>
<tuple>
<float>1593420843.63</float>
<float>1614947584.55</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -4,6 +4,7 @@
portal_url here/portal_url;
reservation python: request.get('reservation_only');
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()));
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;
......@@ -310,14 +311,14 @@
$('#print_button').click();
})
</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>
</a>
<a tal:condition="reservation" href="./SaleOrderModule_viewReservedItemFastInputDialog">
<span i18n:translate='' i18n:domain='ui'>Return</span>
</a>
<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>
</a>
<br/>
......
......@@ -253,7 +253,7 @@
<dictionary>
<item>
<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>
</dictionary>
</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