mirror of
https://github.com/brain-tec/account_ebics.git
synced 2024-11-23 20:52:04 +00:00
[13.0]batch payment ebics.xfer wiz improvements
This commit is contained in:
parent
e5a8668c20
commit
3b1fba367f
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
"name": "Upload Batch Payment via EBICS",
|
"name": "Upload Batch Payment via EBICS",
|
||||||
"version": "13.0.1.0.0",
|
"version": "13.0.1.1.0",
|
||||||
"license": "LGPL-3",
|
"license": "LGPL-3",
|
||||||
"author": "Noviat",
|
"author": "Noviat",
|
||||||
"category": "Accounting & Finance",
|
"category": "Accounting & Finance",
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
# Copyright 2009-2020 Noviat.
|
# Copyright 2009-2020 Noviat.
|
||||||
# License LGPL-3 or later (http://www.gnu.org/licenses/lpgl).
|
# License LGPL-3 or later (http://www.gnu.org/licenses/lpgl).
|
||||||
|
|
||||||
from odoo import _, api, models
|
from odoo import _, models
|
||||||
|
from odoo.exceptions import UserError
|
||||||
|
|
||||||
|
|
||||||
class AccountBatchPayment(models.Model):
|
class AccountBatchPayment(models.Model):
|
||||||
@ -12,6 +13,17 @@ class AccountBatchPayment(models.Model):
|
|||||||
ctx = self.env.context.copy()
|
ctx = self.env.context.copy()
|
||||||
|
|
||||||
origin = _("Batch Payment") + ": " + self.name
|
origin = _("Batch Payment") + ": " + self.name
|
||||||
|
ebics_config = self.env['ebics.config'].search([
|
||||||
|
('journal_ids', '=', self.journal_id.id),
|
||||||
|
('state', '=', 'confirm'),
|
||||||
|
])
|
||||||
|
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(
|
ctx.update(
|
||||||
{
|
{
|
||||||
"default_upload_data": self.export_file,
|
"default_upload_data": self.export_file,
|
||||||
@ -19,7 +31,9 @@ class AccountBatchPayment(models.Model):
|
|||||||
"origin": origin,
|
"origin": origin,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
ebics_xfer = self.env["ebics.xfer"].with_context(ctx).create({})
|
ebics_xfer = self.env["ebics.xfer"].with_context(ctx).create({})
|
||||||
|
ebics_xfer._onchange_ebics_config_id()
|
||||||
ebics_xfer._onchange_upload_data()
|
ebics_xfer._onchange_upload_data()
|
||||||
ebics_xfer._onchange_format_id()
|
ebics_xfer._onchange_format_id()
|
||||||
view = self.env.ref("account_ebics.ebics_xfer_view_form_upload")
|
view = self.env.ref("account_ebics.ebics_xfer_view_form_upload")
|
||||||
|
Loading…
Reference in New Issue
Block a user