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

Apply partner payment mode on refunds #6

Open
wants to merge 1 commit into
base: 10-improve-refunds
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
4 changes: 2 additions & 2 deletions account_payment_partner/models/account_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class AccountInvoice(models.Model):
def _onchange_partner_id(self):
res = super(AccountInvoice, self)._onchange_partner_id()
if self.partner_id:
if self.type == 'in_invoice':
if self.type in ('in_invoice', 'out_refund'):
pay_mode = self.partner_id.supplier_payment_mode_id
self.payment_mode_id = pay_mode
if (
Expand All @@ -32,7 +32,7 @@ def _onchange_partner_id(self):
self.commercial_partner_id.bank_ids):
self.partner_bank_id =\
self.commercial_partner_id.bank_ids[0]
elif self.type == 'out_invoice':
elif self.type in ('out_invoice', 'in_refund'):
# No bank account assignation is done here as this is only
# needed for printing purposes and it can conflict with
# SEPA direct debit payments. Current report prints it.
Expand Down