diff --git a/account.py b/account.py index c7464d4f25..8b06bbf43f 100644 --- a/account.py +++ b/account.py @@ -386,8 +386,9 @@ class Invoice(metaclass=PoolMeta): payment_direct_debit = fields.Boolean("Direct Debit", states={ 'invisible': Eval('type') != 'in', + 'readonly': Eval('state') != 'draft', }, - depends=['type'], + depends=['type', 'state'], help="Check if the invoice is paid by direct debit.") @classmethod