[FIX] website_sale: do not force send the quotation in case of payment error

This could allow a malicious flow that made the quotation available
via the website_quote module; allowing you to sign and confirm the
order without actually paying it.
This commit is contained in:
Damien Bouvy
2016-01-26 13:18:45 +01:00
parent 1c4d888e80
commit 84573fe50b
+1 -1
View File
@@ -24,7 +24,7 @@ class PaymentTransaction(orm.Model):
tx = getattr(self, tx_find_method_name)(cr, uid, data, context=context)
if tx and tx.state == 'done' and tx.acquirer_id.auto_confirm == 'at_pay_confirm' and tx.sale_order_id and tx.sale_order_id.state in ['draft', 'sent']:
self.pool['sale.order'].action_confirm(cr, SUPERUSER_ID, [tx.sale_order_id.id], context=dict(context, send_email=True))
elif tx and tx.state not in ['cancel'] and tx.sale_order_id and tx.sale_order_id.state in ['draft']:
elif tx and tx.state not in ['cancel', 'error'] and tx.sale_order_id and tx.sale_order_id.state in ['draft']:
self.pool['sale.order'].force_quotation_send(cr, SUPERUSER_ID, [tx.sale_order_id.id], context=context)
return res