[FIX] payment: token domain
The token domain should be extended to the commercial partner and its siblings. opw-705441
This commit is contained in:
@@ -17,7 +17,8 @@ class AccountPayment(models.Model):
|
||||
def _onchange_partner_id(self):
|
||||
res = {}
|
||||
if self.partner_id:
|
||||
res['domain'] = {'payment_token_id': [('partner_id', '=', self.partner_id.id), ('acquirer_id.auto_confirm', '!=', 'authorize')]}
|
||||
partners = self.partner_id | self.partner_id.commercial_partner_id | self.partner_id.commercial_partner_id.child_ids
|
||||
res['domain'] = {'payment_token_id': [('partner_id', 'in', partners.ids), ('acquirer_id.auto_confirm', '!=', 'authorize')]}
|
||||
|
||||
return res
|
||||
|
||||
@@ -57,4 +58,4 @@ class AccountPayment(models.Model):
|
||||
if not s2s_result or tx.state != 'done':
|
||||
raise ValidationError(_("Payment transaction failed (%s)") % tx.state_message)
|
||||
|
||||
self.payment_transaction_id = tx
|
||||
self.payment_transaction_id = tx
|
||||
|
||||
Reference in New Issue
Block a user