From a5326c49a214ca53025b0f4a972ca42cf4df26fa Mon Sep 17 00:00:00 2001 From: Luc De Meyer Date: Sun, 21 Jun 2020 13:01:06 +0200 Subject: [PATCH] ebics config bank account domain --- account_ebics/__manifest__.py | 3 ++- account_ebics/models/ebics_config.py | 11 +++++++++-- account_ebics/views/ebics_config.xml | 3 ++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/account_ebics/__manifest__.py b/account_ebics/__manifest__.py index 489a299..396d613 100644 --- a/account_ebics/__manifest__.py +++ b/account_ebics/__manifest__.py @@ -3,7 +3,8 @@ { 'name': 'EBICS banking protocol', - 'version': '13.0.1.0.1', + + 'version': '13.0.1.0.2', 'license': 'LGPL-3', 'author': 'Noviat', 'category': 'Accounting & Finance', diff --git a/account_ebics/models/ebics_config.py b/account_ebics/models/ebics_config.py index b7ea55b..db08b36 100644 --- a/account_ebics/models/ebics_config.py +++ b/account_ebics/models/ebics_config.py @@ -1,4 +1,4 @@ -# Copyright 2009-2019 Noviat. +# Copyright 2009-2020 Noviat. # License LGPL-3 or later (http://www.gnu.org/licenses/lpgl). import base64 @@ -49,10 +49,17 @@ class EbicsConfig(models.Model): _order = 'name' name = fields.Char(string='Name', required=True) + company_partner_id = fields.Many2one( + comodel_name='res.partner', + related='company_id.partner_id', + string='Account Holder', + readonly=True, store=False) bank_id = fields.Many2one( comodel_name='res.partner.bank', readonly=True, states={'draft': [('readonly', False)]}, - string='Bank Account', required=True) + string='Bank Account', + domain="[('partner_id','=', company_partner_id)]", + required=True) ebics_host = fields.Char( string='EBICS HostID', required=True, readonly=True, states={'draft': [('readonly', False)]}, diff --git a/account_ebics/views/ebics_config.xml b/account_ebics/views/ebics_config.xml index 48b8a56..a2e4c24 100644 --- a/account_ebics/views/ebics_config.xml +++ b/account_ebics/views/ebics_config.xml @@ -35,7 +35,7 @@ - + @@ -47,6 +47,7 @@ attrs="{'invisible': [('ebics_version', '=', 'H004')]}"/> +