From 787e09a8de6a3e29d75b09a80a371bfb6791ffc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 29 May 2012 18:12:23 +0200 Subject: [PATCH] Add invisible states on locations issue2629 --- product.py | 5 ++++- product.xml | 7 ++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/product.py b/product.py index 89e8afc7ef..1e0da00f9e 100644 --- a/product.py +++ b/product.py @@ -1,12 +1,15 @@ #This file is part of Tryton. The COPYRIGHT file at the top level of #this repository contains the full copyright notices and license terms. from trytond.model import ModelView, ModelSQL, fields +from trytond.pyson import Eval class Product(ModelSQL, ModelView): _name = 'product.product' locations = fields.One2Many('stock.product.location', 'product', - 'Default Locations') + 'Default Locations', states={ + 'invisible': ~Eval('type').in_(['goods', 'assets']), + }) Product() diff --git a/product.xml b/product.xml index c5a5400ceb..61307c8a0e 100644 --- a/product.xml +++ b/product.xml @@ -11,9 +11,10 @@ this repository contains the full copyright notices and license terms. --> - - - + + + ]]>