[FIX] account_reconcile_oca: Only filter by partner on receivable and payable lines

pull/732/head
Enric Tobella 2024-10-17 08:16:47 +02:00 committed by Pedro M. Baeza
parent 9976ae179a
commit cdf9c3e77e
1 changed files with 4 additions and 1 deletions

View File

@ -21,7 +21,10 @@ class AccountMoveLine(models.Model):
"account_reconcile_oca.account_account_reconcile_act_window" "account_reconcile_oca.account_account_reconcile_act_window"
) )
action["domain"] = [("account_id", "=", self.mapped("account_id").id)] action["domain"] = [("account_id", "=", self.mapped("account_id").id)]
if len(partner) == 1: if len(partner) == 1 and self.account_id.account_type in [
"asset_receivable",
"liability_payable",
]:
action["domain"] += [("partner_id", "=", partner.id)] action["domain"] += [("partner_id", "=", partner.id)]
action["context"] = self.env.context.copy() action["context"] = self.env.context.copy()
action["context"]["default_account_move_lines"] = self.filtered( action["context"]["default_account_move_lines"] = self.filtered(