[IMP] website_quote : add action to update quotation button
This commit is contained in:
@@ -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&model=%s&id=%s' % (quotation._name, quotation.id)">Update Quote</a>
|
||||
<a class="btn btn-info hidden-print" t-att-href="'/web#return_label=Website&model=%s&id=%s&action=%s&view_type=form' % (quotation._name, quotation.id, action)">Update Quote</a>
|
||||
</div>
|
||||
</h1>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user