oca-ocb-sale/odoo-bringout-oca-ocb-sale/sale/wizard/account_payment_register.py
2025-08-29 15:20:49 +02:00

15 lines
571 B
Python

# -*- coding: utf-8 -*-
from odoo import models
class AccountPaymentRegister(models.TransientModel):
_inherit = 'account.payment.register'
def _create_payment_vals_from_wizard(self, batch_result):
vals = super()._create_payment_vals_from_wizard(batch_result)
# 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