1
# -*- coding: utf-8 -*-
2
##############################################################################
4
# Copyright (C) 2009 EduSense BV (<http://www.edusense.nl>).
5
# (C) 2011 - 2013 Therp BV (<http://therp.nl>).
7
# All other contributions are (C) by their respective contributors
11
# This program is free software: you can redistribute it and/or modify
12
# it under the terms of the GNU Affero General Public License as
13
# published by the Free Software Foundation, either version 3 of the
14
# License, or (at your option) any later version.
16
# This program is distributed in the hope that it will be useful,
17
# but WITHOUT ANY WARRANTY; without even the implied warranty of
18
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
# GNU Affero General Public License for more details.
21
# You should have received a copy of the GNU Affero General Public License
22
# along with this program. If not, see <http://www.gnu.org/licenses/>.
24
##############################################################################
26
from openerp.osv import orm, fields
29
class payment_mode(orm.Model):
30
''' Restoring the payment type from version 5,
31
used to select the export wizard (if any) '''
32
_inherit = "payment.mode"
34
def suitable_bank_types(self, cr, uid, payment_mode_id=None, context=None):
35
""" Reinstates functional code for suitable bank type filtering.
36
Current code in account_payment is disfunctional.
39
payment_mode = self.browse(
40
cr, uid, payment_mode_id, context)
41
if (payment_mode and payment_mode.type and
42
payment_mode.type.suitable_bank_types):
43
res = [t.code for t in payment_mode.type.suitable_bank_types]