summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorqdp-odoo <qdp@odoo.com>2018-03-08 15:16:19 +0100
committerqdp-odoo <qdp@odoo.com>2018-03-08 15:16:19 +0100
commit8b2c25f5753cbda5e0d37a6dcbd4dde37b7da4ae (patch)
tree4da335bbe077a874a8ae341edf1729f624feafc1
parentb5da9d65ae244730fafcde1f7cae2266461dd3ca (diff)
[FIX] account: payment lines of invoices selection
The payment lines shown in the payment widget on invoices, should only list reconciliation made towards the lines sharing the same account as the invoice/bill. Previously, if a tax or an invoice line was using another account set reconciliable, any payment made against this account would be shown in the payment widget, which is wrong. OPW: 1805968
-rw-r--r--addons/account/models/account_invoice.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/account/models/account_invoice.py b/addons/account/models/account_invoice.py
index 11b2cf6551a..a22913be9d1 100644
--- a/addons/account/models/account_invoice.py
+++ b/addons/account/models/account_invoice.py
@@ -188,7 +188,7 @@ class AccountInvoice(models.Model):
@api.depends('move_id.line_ids.amount_residual')
def _compute_payments(self):
payment_lines = []
- for line in self.move_id.line_ids:
+ for line in self.move_id.line_ids.filtered(lambda l: l.account_id.id == self.account_id.id):
payment_lines.extend(filter(None, [rp.credit_move_id.id for rp in line.matched_credit_ids]))
payment_lines.extend(filter(None, [rp.debit_move_id.id for rp in line.matched_debit_ids]))
self.payment_move_line_ids = self.env['account.move.line'].browse(list(set(payment_lines)))