diff --git a/addons/sale/wizard/__init__.py b/addons/sale/wizard/__init__.py index 40ded784140..34ae33af786 100644 --- a/addons/sale/wizard/__init__.py +++ b/addons/sale/wizard/__init__.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. +from . import account_payment_register from . import mail_compose_message from . import payment_acquirer_onboarding_wizard from . import sale_make_invoice_advance diff --git a/addons/sale/wizard/account_payment_register.py b/addons/sale/wizard/account_payment_register.py new file mode 100644 index 00000000000..cc13e16bc8c --- /dev/null +++ b/addons/sale/wizard/account_payment_register.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- + +from odoo import models + + +class AccountPaymentRegister(models.TransientModel): + _inherit = 'account.payment.register' + + def _create_payment_vals_from_wizard(self): + vals = super()._create_payment_vals_from_wizard() + # Make sure the account move linked to generated payment + # belongs to the expected sales team + # team_id field on account.payment comes from the `_inherits` on account.move model + vals.update({'team_id': self.line_ids.move_id[0].team_id.id}) + return vals