10000 [FIX] account: fallback to correct move link in bank matching by alialfie · Pull Request #207968 · odoo/odoo · GitHub
[go: up one dir, main page]

Skip to content

[FIX] account: fallback to correct move link in bank matching #207968

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions addons/account/models/account_move_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,12 @@ class AccountMoveLine(models.Model):
comodel_name='account.move.line',
compute='_compute_reconciled_lines_ids', inverse='_inverse_reconciled_lines_ids',
)
# Technical field that filters the reconciled_lines_ids to remove the exchange diff line.
reconciled_lines_excluding_exchange_diff_ids = fields.Many2many(
comodel_name='account.move.line',
compute='_compute_reconciled_lines_excluding_exchange_diff_ids',
)

matching_number = fields.Char(
string="Matching #",
copy=False,
Expand Down Expand Up @@ -1081,6 +1087,16 @@ def _compute_reconciled_lines_ids(self):
for line in self:
line.reconciled_lines_ids = line.matched_debit_ids.debit_move_id + line.matched_credit_ids.credit_move_id

@api.depends('matched_debit_ids', 'matched_credit_ids')
def _compute_reconciled_lines_excluding_exchange_diff_ids(self):
for line in self:
all_lines = line.matched_debit_ids.debit_move_id + line.matched_credit_ids.credit_move_id
excluded_ids = (
line.matched_debit_ids.exchange_move_id.line_ids +
line.matched_credit_ids.exchange_move_id.line_ids
)
line.reconciled_lines_excluding_exchange_diff_ids = all_lines - excluded_ids

def _search_payment_date(self, operator, value):
if operator == 'in':
# recursive call with operator '='
Expand Down
0