From f219204eb64ab0d55c4d5d6286e07539aa6f80ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 28 Sep 2026 14:55:24 +0200 Subject: [PATCH] Restrict account disbursement to account with disbursement type It is needed to ensure that the account is valid when used on the invoice line. Closes #15128 --- modules/project_disbursement/account.py | 2 ++ modules/project_disbursement/project.py | 1 + 2 files changed, 3 insertions(+) diff --git a/modules/project_disbursement/account.py b/modules/project_disbursement/account.py index 11098b686f..43f2c6238c 100644 --- a/modules/project_disbursement/account.py +++ b/modules/project_disbursement/account.py @@ -15,6 +15,7 @@ class Configuration(metaclass=PoolMeta): default_account_disbursement = fields.MultiValue(fields.Many2One( 'account.account', "Default Account Disbursement", domain=[ + ('type.disbursement', '=', True), ('closed', '!=', True), ('company', '=', Eval('context', {}).get('company', -1)), ])) @@ -33,6 +34,7 @@ class ConfigurationDefaultAccount(metaclass=PoolMeta): default_account_disbursement = fields.Many2One( 'account.account', "Default Account Disbursement", domain=[ + ('type.disbursement', '=', True), ('closed', '!=', True), ('company', '=', Eval('company', -1)), ]) diff --git a/modules/project_disbursement/project.py b/modules/project_disbursement/project.py index d04898ee98..8db3a01f61 100644 --- a/modules/project_disbursement/project.py +++ b/modules/project_disbursement/project.py @@ -61,6 +61,7 @@ class Work(metaclass=PoolMeta): account_disbursement = fields.Many2One( 'account.account', "Account Disbursement", domain=[ + ('type.disbursement', '=', True), ('closed', '!=', True), ('company', '=', Eval('company', -1)), ],