mirror of
https://github.com/brain-tec/account_ebics.git
synced 2024-12-24 10:21:45 +00:00
[8.0]support multiple EBICS connections
This commit is contained in:
parent
8deb1b4bd4
commit
e8a538bf22
@ -1,10 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2009-2018 Noviat.
|
||||
# Copyright 2009-2020 Noviat.
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
{
|
||||
'name': 'Upload Payment Order via EBICS',
|
||||
'version': '8.0.1.1.0',
|
||||
'version': '8.0.1.2.0',
|
||||
'license': 'AGPL-3',
|
||||
'author': 'Noviat',
|
||||
'category': 'Accounting & Finance',
|
||||
|
@ -1,8 +1,9 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2009-2017 Noviat.
|
||||
# Copyright 2009-2020 Noviat.
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from openerp import api, models, _
|
||||
from openerp import _, api, models
|
||||
from openerp.exceptions import Warning as UserError
|
||||
|
||||
|
||||
class BankingExportSepaWizard(models.TransientModel):
|
||||
@ -14,6 +15,17 @@ class BankingExportSepaWizard(models.TransientModel):
|
||||
ctx = self._context.copy()
|
||||
payment_order = self.payment_order_ids[0]
|
||||
origin = _("Payment Order") + ': ' + payment_order.reference
|
||||
ebics_config = self.env['ebics.config'].search([
|
||||
('bank_id', '=', payment_order.mode.bank_id.id),
|
||||
('state', '=', 'active'),
|
||||
])
|
||||
if not ebics_config:
|
||||
raise UserError(_(
|
||||
"No active EBICS configuration available "
|
||||
"for the selected bank."
|
||||
))
|
||||
if len(ebics_config) == 1:
|
||||
ctx["default_ebics_config_id"] = ebics_config.id
|
||||
ctx.update({
|
||||
'default_upload_data': self.file,
|
||||
'default_upload_fname': self.filename,
|
||||
@ -21,6 +33,7 @@ class BankingExportSepaWizard(models.TransientModel):
|
||||
'payment_order_id': payment_order.id,
|
||||
})
|
||||
ebics_xfer = self.env['ebics.xfer'].with_context(ctx).create({})
|
||||
ebics_xfer._onchange_ebics_config_id()
|
||||
ebics_xfer._onchange_upload_data()
|
||||
ebics_xfer._onchange_format_id()
|
||||
view = self.env.ref('account_ebics.ebics_xfer_view_form_upload')
|
||||
|
Loading…
Reference in New Issue
Block a user