Skip to content

Commit

Permalink
[16.0][IMP] account_reconcile_oca: display partner_name
Browse files Browse the repository at this point in the history
  • Loading branch information
astirpe committed Sep 25, 2023
1 parent 7f15dae commit e4a37ff
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
14 changes: 14 additions & 0 deletions account_reconcile_oca/models/account_bank_statement_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -717,3 +717,17 @@ def action_to_check(self):
def action_checked(self):
self.ensure_one()
self.move_id.to_check = False

def _get_reconcile_line(
self, line, kind, is_counterpart=False, max_amount=False, from_unreconcile=False
):
vals = super()._get_reconcile_line(
line,
kind,
is_counterpart=is_counterpart,
max_amount=max_amount,
from_unreconcile=from_unreconcile
)
if vals["partner_id"] == False:
vals["partner_id"] = (False, self.partner_name)
return vals
4 changes: 1 addition & 3 deletions account_reconcile_oca/models/account_reconcile_abstract.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,7 @@ def _get_reconcile_line(
"reference": "account.move.line;%s" % line.id,
"id": line.id,
"account_id": line.account_id.name_get()[0],
"partner_id": line.partner_id
and line.partner_id.name_get()[0]
or (False, self.partner_name),
"partner_id": line.partner_id and line.partner_id.name_get()[0] or False,
"date": fields.Date.to_string(line.date),
"name": line.name,
"debit": amount if amount > 0 else 0.0,
Expand Down

0 comments on commit e4a37ff

Please sign in to comment.