mirror of
https://gitlab.com/flectra-community/bank-payment.git
synced 2024-11-26 15:42:05 +00:00
1fb51dfbad
->account_payment_partner_default_bank
19 lines
711 B
Python
19 lines
711 B
Python
# Copyright 2014-16 Akretion - Alexis de Lattre <alexis.delattre@akretion.com>
|
|
# Copyright 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza
|
|
# Copyright 2021 Tecnativa - Víctor Martínez
|
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
|
|
|
from flectra import api, fields, models
|
|
|
|
|
|
class AccountMove(models.Model):
|
|
_inherit = "account.move"
|
|
|
|
@api.depends("partner_id", "payment_mode_id")
|
|
def _compute_partner_bank(self):
|
|
res = super(AccountMove, self)._compute_partner_bank()
|
|
for move in self:
|
|
if move.move_type == 'out_invoice' and not move.partner_bank_id:
|
|
move.partner_bank_id = move.company_id.partner_id.bank_ids[:1]
|
|
return res
|