Improve list view of res.partner.bank
Improve name_get of res.bank Add filter on product categ on pos_sale_report
This commit is contained in:
20
base_usability/bank.py
Normal file
20
base_usability/bank.py
Normal file
@@ -0,0 +1,20 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2019 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import models, api
|
||||
|
||||
|
||||
class ResBank(models.Model):
|
||||
_inherit = 'res.bank'
|
||||
|
||||
@api.multi
|
||||
@api.depends('name', 'bic')
|
||||
def name_get(self):
|
||||
result = []
|
||||
for bank in self:
|
||||
name = bank.name
|
||||
if bank.bic:
|
||||
name = u'[%s] %s' % (bank.bic, name)
|
||||
result.append((bank.id, name))
|
||||
return result
|
||||
Reference in New Issue
Block a user