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

[FIX] account: Remove partner on changing partner_type or payment_type #32069

Closed
wants to merge 1 commit into from
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
1 change: 1 addition & 0 deletions addons/account/models/account_payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,7 @@ def _compute_reconciled_invoice_ids(self):
@api.onchange('partner_type')
def _onchange_partner_type(self):
self.ensure_one()
self.partner_id = False
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not self.env["res.partner"] as an empty record?

# Set partner_id domain
if self.partner_type:
return {'domain': {'partner_id': [(self.partner_type, '=', True)]}}
Expand Down