From 650aa96a42e9babe90b53cbb72a437723180af2e Mon Sep 17 00:00:00 2001 From: Sergi Almacellas Abellana Date: Fri, 22 Feb 2019 19:30:42 +0100 Subject: [PATCH] Make payment_direct_debit readonly for non draft invoices issue8083 review45931002 --- account.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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