mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
Improvements include: - full re-organisation of modules and big re-organisation of the code - simplification of the code related to the fact that support for direct debit is now in t he base module, not added by an optional module account_direct_debit (module was removed) - new design of the wizard to select move lines to pay - support for non-SEPA file transfer- - support for German direct debit SEPA files (fixes bug #129) - remove workflow of payment.order This port to v9 is not finished... there is still a lot of work: - finish the code of account_payment_order/wizard/account_payment_line_create.py - port account_banking_payment_transfer and integrate it inside account_payment_order - fix bugs - clean-up code, remove dead code - test in several complex scenarios
35 lines
1.2 KiB
Python
35 lines
1.2 KiB
Python
# -*- coding: utf-8 -*-
|
|
# © 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
|
|
|
from openerp import models, fields, api
|
|
|
|
|
|
class AccountPaymentMethod(models.Model):
|
|
_inherit = 'account.payment.method'
|
|
_rec_name = 'display_name'
|
|
|
|
code = fields.Char(
|
|
string='Code (Do Not Modify)',
|
|
help="This code is used in the code of the Odoo module that handle "
|
|
"this payment method. Therefore, if you change it, "
|
|
"the generation of the payment file may fail.")
|
|
active = fields.Boolean(string='Active', default=True)
|
|
# In the pain_base module, we will add a default_pain_version
|
|
display_name = fields.Char(
|
|
compute='compute_display_name',
|
|
store=True, string='Display Name')
|
|
|
|
@api.multi
|
|
@api.depends('code', 'name', 'payment_type')
|
|
def compute_display_name(self):
|
|
for method in self:
|
|
method.display_name = u'[%s] %s (%s)' % (
|
|
method.code, method.name, method.payment_type)
|
|
|
|
_sql_constraints = [(
|
|
'code_payment_type_unique',
|
|
'unique(code, payment_type)',
|
|
'A payment method of the same type already exists with this code'
|
|
)]
|