[FIX] website_sale: perform onchange as sudo

This revision is related to 9752aedb4e

It looks like in some cases, the user cannot read the
partner associated to his own cart.

This is the case when shopping without being signed in.

opw-673187
This commit is contained in:
Denis Ledoux 2016-03-30 11:04:51 +02:00
parent 461162f3ec
commit 1d5db33638
1 changed files with 1 additions and 1 deletions

View File

@ -733,7 +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(dict(transaction_obj.on_change_partner_id(cr, uid, None, order.partner_id.id, context=context).get('values', {}), amount=order.amount_total))
tx.write(dict(transaction_obj.on_change_partner_id(cr, SUPERUSER_ID, 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,