[FIX] website_sale: update partner details when reusing payment transaction

When attempting to pay a cart in the ecommerce,
if the customer went on the payment acquirer site
(meaning, the `payment.transaction` is created
in the database), then come back to the checkout form
using the browser back button, and changed his customer
details (address, email, phone,...),
these changes in the details were not applied
in the `payment.transaction` record that was being
re-used.

e.g.
Checkout > Confirm > Choose Paypal, Pay Now
> History back to the checkout and apply changes
in the address > Confirm > Pay Now.
This commit is contained in:
Denis Ledoux 2016-03-23 14:59:22 +01:00
parent a0c473379a
commit 9752aedb4e
1 changed files with 1 additions and 3 deletions

View File

@ -733,9 +733,7 @@ class website_sale(http.Controller):
tx = False
tx_id = False
elif tx.state == 'draft': # button cliked but no more info -> rewrite on tx or create a new one ?
tx.write({
'amount': order.amount_total,
})
tx.write(dict(transaction_obj.on_change_partner_id(cr, uid, None, order.partner_id.id, context=context).get('values', {}), amount=order.amount_total))
if not tx:
tx_id = transaction_obj.create(cr, SUPERUSER_ID, {
'acquirer_id': acquirer_id,