diff options
| author | Nicolas Martinelli <nim@odoo.com> | 2017-01-23 13:12:17 +0100 |
|---|---|---|
| committer | Nicolas Martinelli <nim@odoo.com> | 2017-01-23 13:12:40 +0100 |
| commit | d4a4d440f51fc6f5168cf26b8d6d9d03b4bea4ef (patch) | |
| tree | 46a39c49af00e164828e3d9d0bef96516c0abb47 /addons | |
| parent | f96bbfd9569d52de0b48f95d28500459a5d103ed (diff) | |
[FIX] payment: token domain
The token domain should be extended to the commercial partner and its
siblings.
opw-705441
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/payment/models/account_payment.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/addons/payment/models/account_payment.py b/addons/payment/models/account_payment.py index 52b1e9954e1..8609b6b96c9 100644 --- a/addons/payment/models/account_payment.py +++ b/addons/payment/models/account_payment.py @@ -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
\ No newline at end of file + self.payment_transaction_id = tx |
