mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
[IMP] account_banking_mandate: Show acc number end in name_get
This commit is contained in:
committed by
Stefan Rijnhart
parent
b0701c983b
commit
59cdb8554e
@@ -1,6 +1,7 @@
|
||||
# Copyright 2014 Compassion CH - Cyril Sester <csester@compassion.ch>
|
||||
# Copyright 2014 Tecnativa - Pedro M. Baeza
|
||||
# Copyright 2015-16 Akretion - Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# Copyright 2020 Tecnativa - Carlos Dauden
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from odoo import models, fields, api, _
|
||||
@@ -14,7 +15,6 @@ class AccountBankingMandate(models.Model):
|
||||
"""
|
||||
_name = 'account.banking.mandate'
|
||||
_description = "A generic banking mandate"
|
||||
_rec_name = 'unique_mandate_reference'
|
||||
_inherit = ['mail.thread']
|
||||
_order = 'signature_date desc'
|
||||
|
||||
@@ -79,6 +79,16 @@ class AccountBankingMandate(models.Model):
|
||||
'unique(unique_mandate_reference, company_id)',
|
||||
'A Mandate with the same reference already exists for this company!')]
|
||||
|
||||
def name_get(self):
|
||||
result = []
|
||||
for mandate in self:
|
||||
name = mandate.unique_mandate_reference
|
||||
acc_number = mandate.partner_bank_id.acc_number
|
||||
if acc_number:
|
||||
name = '{} [...{}]'.format(name, acc_number[-4:])
|
||||
result.append((mandate.id, name))
|
||||
return result
|
||||
|
||||
@api.multi
|
||||
@api.depends('payment_line_ids')
|
||||
def _compute_payment_line_ids_count(self):
|
||||
|
||||
Reference in New Issue
Block a user