From cf0ffe21d3f4a1e2598e112b547c2d9f4b557855 Mon Sep 17 00:00:00 2001 From: ?ngel ?lvarez Date: Thu, 4 Sep 2014 16:44:05 +0200 Subject: [PATCH] fix readonly states of process in production --- production.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/production.py b/production.py index e707980..5c81140 100644 --- a/production.py +++ b/production.py @@ -259,7 +259,12 @@ class Production: domain=[ ('output_products', '=', Eval('product', 0)), ], - depends=['product']) + states={ + 'readonly': (~Eval('state').in_(['request', 'draft']) + | ~Eval('warehouse', 0) | ~Eval('location', 0)), + 'invisible': ~Eval('product'), + }, + depends=['product', 'state', 'warehouse', 'location']) @classmethod def __setup__(cls):