Skip to content

Commit

Permalink
[IMP] account_reconcile_oca: Use receivable/payable account on statem…
Browse files Browse the repository at this point in the history
…ents with partner as suspense account
  • Loading branch information
etobella committed Jul 31, 2024
1 parent 08fa883 commit f1bb9cb
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions account_reconcile_oca/models/account_bank_statement_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,13 +227,17 @@ def _recompute_suspense_line(
}
)
else:
account = self.journal_id.suspense_account_id
if self.partner_id and total_amount > 0:
can_reconcile = True
account = self.partner_id.property_account_receivable_id
elif self.partner_id and total_amount < 0:
can_reconcile = True
account = self.partner_id.property_account_payable_id

Check warning on line 236 in account_reconcile_oca/models/account_bank_statement_line.py

View check run for this annotation

Codecov / codecov/patch

account_reconcile_oca/models/account_bank_statement_line.py#L235-L236

Added lines #L235 - L236 were not covered by tests
suspense_line = {
"reference": "reconcile_auxiliary;%s" % reconcile_auxiliary_id,
"id": False,
"account_id": [
self.journal_id.suspense_account_id.id,
self.journal_id.suspense_account_id.display_name,
],
"account_id": [account.id, account.display_name],
"partner_id": self.partner_id
and [self.partner_id.id, self.partner_id.display_name]
or (self.partner_name and (False, self.partner_name))
Expand Down

0 comments on commit f1bb9cb

Please sign in to comment.