From 4212e0ae017502a4cd5b874f9326805309058936 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 | 2 +- account_ebics/models/ebics_config.py | 11 +++++++++-- account_ebics/views/ebics_config.xml | 3 ++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/account_ebics/__manifest__.py b/account_ebics/__manifest__.py index 69cba05..23c5b2b 100644 --- a/account_ebics/__manifest__.py +++ b/account_ebics/__manifest__.py @@ -3,7 +3,7 @@ { 'name': 'EBICS banking protocol', - 'version': '12.0.1.0.2', + 'version': '12.0.1.0.3', '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 0c912e2..ca49192 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). """ @@ -56,10 +56,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 fd51728..57b11e4 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')]}"/> +