From 8dd8e05b26124656369b0c1f8ed464d6a765d577 Mon Sep 17 00:00:00 2001 From: Luc De Meyer Date: Thu, 29 Jun 2023 14:49:56 +0200 Subject: [PATCH] account_payment_order_transfer_journal - add 'general' filter on transfer journal --- .../models/account_journal.py | 3 ++- .../views/account_journal_views.xml | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/account_payment_order_transfer_journal/models/account_journal.py b/account_payment_order_transfer_journal/models/account_journal.py index 466f8c5b5..ae65d51eb 100644 --- a/account_payment_order_transfer_journal/models/account_journal.py +++ b/account_payment_order_transfer_journal/models/account_journal.py @@ -1,15 +1,16 @@ # Copyright 2022 ACSONE SA/NV +# Copyright 2023 Noviat # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). from odoo import fields, models class AccountJournal(models.Model): - _inherit = "account.journal" transfer_journal_id = fields.Many2one( comodel_name="account.journal", string="Transfer journal on payment/debit orders", + domain="[('type', '=', 'general')]", help="Journal to write payment entries when confirming payment/debit orders", ) diff --git a/account_payment_order_transfer_journal/views/account_journal_views.xml b/account_payment_order_transfer_journal/views/account_journal_views.xml index c7e5da023..f26d125b5 100644 --- a/account_payment_order_transfer_journal/views/account_journal_views.xml +++ b/account_payment_order_transfer_journal/views/account_journal_views.xml @@ -8,6 +8,11 @@ account.journal + + {'invisible': [('transfer_journal_id', '!=', False)]} +