[FIX] the line's bank account is the other party's

bank account, not ours
This commit is contained in:
Holger Brunn
2016-02-03 18:10:38 +01:00
committed by CarlosRoca13
parent 673d8b0de6
commit 7efa591b72

View File

@@ -40,15 +40,10 @@ class AccountBankStatementLine(models.Model):
select order_id from order_sums where amount = %s''',
(Decimal(float_repr(abs(this.amount), digits)),))
order_ids = [i for i, in self.env.cr.fetchall()]
# verify that this ids are accessible to the user and from the
# right bank account if applicable
# verify that this ids are accessible to the user
domain = [
('id', 'in', order_ids),
]
if this.bank_account_id.acc_number:
domain.append(
('mode.bank_id.acc_number', '=',
this.bank_account_id.acc_number))
return self.env['payment.order'].search(domain)
@api.model