Skip to content
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

[16.0][FIX] account_payment_return: Add 'is_exchange' value to dict returned in prepare_values_returned_widget method #767

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from
Open
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
7 changes: 7 additions & 0 deletions account_payment_return/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ def prepare_values_returned_widget(self, line_id, amount, is_return=False):
payment_method_name = line_id.payment_method_line_id.name
except AttributeError:
payment_method_name = False
reconciled_partials = line_id.move_id._get_all_reconciled_invoice_partials()
is_exchange = any(
partial["is_exchange"]
for partial in reconciled_partials
if partial["aml_id"] == line_id.id
)
return {
"name": line_id.name,
"journal_name": line_id.journal_id.name,
Expand All @@ -51,6 +57,7 @@ def prepare_values_returned_widget(self, line_id, amount, is_return=False):
"payment_method_name": payment_method_name,
"ref": "{} ({})".format(line_id.move_id.name, line_id.ref),
"returned": is_return,
"is_exchange": is_exchange,
}

def _compute_payments_widget_reconciled_info(self):
Expand Down
Loading