changeset 1758:f40b604be2a9

health : Make the patient field readonly when the record has been saved, not before
author Luis Falcon <falcon@gnu.org>
date Sat, 10 Jan 2015 18:07:57 +0000
parents a840886cc034
children 1808d96979e8
files tryton/health/health.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/tryton/health/health.py
+++ b/tryton/health/health.py
@@ -2271,7 +2271,7 @@
             ('is_patient', '=', True),
             ('is_person', '=', True),
             ],
-        states={'readonly': Bool(Eval('name'))},
+        states = {'readonly': Eval('id', 0) > 0},
         help="Person associated to this patient")
 
     lastname = fields.Function(