[IMP] website_quote : add action to update quotation button

This commit is contained in:
jas
2014-07-30 11:54:31 +02:00
committed by Thibault Delavallée
parent edd0ad1a64
commit 6ed3056ccf
2 changed files with 4 additions and 2 deletions
+3 -1
View File
@@ -38,6 +38,7 @@ class sale_quote(http.Controller):
# only if he knows the private token
order = request.registry.get('sale.order').browse(request.cr, token and SUPERUSER_ID or request.uid, order_id)
now = time.strftime('%Y-%m-%d')
dummy, action = request.registry.get('ir.model.data').get_object_reference(request.cr, request.uid, 'sale', 'action_quotations')
if token:
if token != order.access_token:
return request.website.render('website.404')
@@ -54,7 +55,8 @@ class sale_quote(http.Controller):
'message': message and int(message) or False,
'option': bool(filter(lambda x: not x.line_id, order.options)),
'order_valid': (not order.validity_date) or (now <= order.validity_date),
'days_valid': max(days, 0)
'days_valid': max(days, 0),
'action': action
}
return request.website.render('website_quote.so_quotation', values)
@@ -242,7 +242,7 @@
<em t-esc="quotation.name"/>
<small t-field="quotation.state"/>
<div groups="base.group_website_publisher" t-ignore="true" class="pull-right css_editable_mode_hidden">
<a class="btn btn-info hidden-print" t-att-href="'/web#return_label=Website&amp;model=%s&amp;id=%s' % (quotation._name, quotation.id)">Update Quote</a>
<a class="btn btn-info hidden-print" t-att-href="'/web#return_label=Website&amp;model=%s&amp;id=%s&amp;action=%s&amp;view_type=form' % (quotation._name, quotation.id, action)">Update Quote</a>
</div>
</h1>