[FIX] portal_sale: browse data for payment acquirer form with superuser ID
The payment form needs to be rendered for non-employee users, and may require accessing extra financial data not available for those users.
This commit is contained in:
parent
18fe7abcc6
commit
f2788afe92
|
@ -20,6 +20,7 @@
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
from openerp.osv import osv, fields
|
from openerp.osv import osv, fields
|
||||||
|
from openerp import SUPERUSER_ID
|
||||||
|
|
||||||
|
|
||||||
class sale_order(osv.Model):
|
class sale_order(osv.Model):
|
||||||
|
@ -35,7 +36,7 @@ class sale_order(osv.Model):
|
||||||
def _portal_payment_block(self, cr, uid, ids, fieldname, arg, context=None):
|
def _portal_payment_block(self, cr, uid, ids, fieldname, arg, context=None):
|
||||||
result = dict.fromkeys(ids, False)
|
result = dict.fromkeys(ids, False)
|
||||||
payment_acquirer = self.pool.get('portal.payment.acquirer')
|
payment_acquirer = self.pool.get('portal.payment.acquirer')
|
||||||
for this in self.browse(cr, uid, ids, context=context):
|
for this in self.browse(cr, SUPERUSER_ID, ids, context=context):
|
||||||
if this.state not in ('draft', 'cancel') and not this.invoiced:
|
if this.state not in ('draft', 'cancel') and not this.invoiced:
|
||||||
result[this.id] = payment_acquirer.render_payment_block(cr, uid, this, this.name,
|
result[this.id] = payment_acquirer.render_payment_block(cr, uid, this, this.name,
|
||||||
this.pricelist_id.currency_id, this.amount_total, context=context)
|
this.pricelist_id.currency_id, this.amount_total, context=context)
|
||||||
|
|
Loading…
Reference in New Issue