From 1d5db336381c4eff81813fea64194ab559520dc3 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Wed, 30 Mar 2016 11:04:51 +0200 Subject: [PATCH] [FIX] website_sale: perform onchange as sudo This revision is related to 9752aedb4ec3977a634299d7683c03fda7e005a6 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 --- addons/website_sale/controllers/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website_sale/controllers/main.py b/addons/website_sale/controllers/main.py index e6ec0ddc785..729b99fcbec 100644 --- a/addons/website_sale/controllers/main.py +++ b/addons/website_sale/controllers/main.py @@ -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,