[FIX] sale, website_quote: right display of confirmation mode

Create a quotation in sign confirmation mode.
Send it by email
Follow the link

Go the quote's user's portal
Go to the quotes menu, and enter the right SO

Before this commit, although the confrmation mode of a SO
was rightly computed, it was badly retrieved and displayed.
The button on the email was 'accept and pay'
On the portal, the form view of the SO displayed 'pay now'

After this commit, in both cases it displays 'accept and sign' or the like

OPW 806554

related to #22390
This commit is contained in:
Lucas Perais (lpe)
2018-02-08 10:32:00 +01:00
parent 9645a64d0e
commit d2f9994e92
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -57,7 +57,7 @@ class CustomerPortal(CustomerPortal):
if access_token:
values['no_breadcrumbs'] = True
values['access_token'] = access_token
values['portal_confirmation'] = request.env['ir.config_parameter'].sudo().get_param('sale.sale_portal_confirmation_options', default='none')
values['portal_confirmation'] = order.get_portal_confirmation_action()
if kwargs.get('error'):
values['error'] = kwargs['error']
+2 -2
View File
@@ -200,8 +200,8 @@ class SaleOrder(models.Model):
def get_portal_confirmation_action(self):
""" Template override default behavior of pay / sign chosen in sales settings """
if self.template_id:
return 'sign' if self.require_payment == 1 else 'pay'
if self.require_payment is not None or self.require_payment is not False:
return 'pay' if self.require_payment == 1 else 'sign'
return super(SaleOrder, self).get_portal_confirmation_action()
@api.multi