[FIX] account: Use only partner bank accounts of the payment company
closes odoo/odoo#65418 X-original-commit: 8ff165025e18a8d49a5666caac1747046ce87b6e Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com> Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
This commit is contained in:
@@ -319,7 +319,7 @@ class AccountPayment(models.Model):
|
||||
def _compute_partner_bank_id(self):
|
||||
''' The default partner_bank_id will be the first available on the partner. '''
|
||||
for pay in self:
|
||||
available_partner_bank_accounts = pay.partner_id.bank_ids
|
||||
available_partner_bank_accounts = pay.partner_id.bank_ids.filtered(lambda x: x.company_id in (False, pay.company_id))
|
||||
if available_partner_bank_accounts:
|
||||
pay.partner_bank_id = available_partner_bank_accounts[0]._origin
|
||||
else:
|
||||
|
||||
@@ -262,7 +262,7 @@ class AccountPaymentRegister(models.TransientModel):
|
||||
def _compute_partner_bank_id(self):
|
||||
''' The default partner_bank_id will be the first available on the partner. '''
|
||||
for wizard in self:
|
||||
available_partner_bank_accounts = wizard.partner_id.bank_ids.filtered_domain([('company_id', '=', wizard.company_id.id)])
|
||||
available_partner_bank_accounts = wizard.partner_id.bank_ids.filtered(lambda x: x.company_id in (False, wizard.company_id))
|
||||
if available_partner_bank_accounts:
|
||||
wizard.partner_bank_id = available_partner_bank_accounts[0]._origin
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user