diff --git a/product_oneclick.py b/product_oneclick.py
index 35c719e..35ba624 100644
--- a/product_oneclick.py
+++ b/product_oneclick.py
@@ -3,7 +3,7 @@
# the full copyright notices and license terms.
from trytond.model import fields
from trytond.pool import PoolMeta
-from trytond.pyson import Eval
+from trytond.pyson import Eval, Not, Bool
from trytond.modules.product_esale.tools import slugify
__all__ = ['ProductOneClickView', 'ProductOneClick']
@@ -86,6 +86,13 @@ class ProductOneClickView:
name = slugify(name)
return name
+ @classmethod
+ def view_attributes(cls):
+ return super(ProductOneClickView, cls).view_attributes() + [
+ ('//page[@id="esale"]', 'states', {
+ 'invisible': Not(Bool(Eval('esale_available'))),
+ })]
+
class ProductOneClick:
__name__ = 'product.oneclick'
diff --git a/view/product_oneclick_view_form.xml b/view/product_oneclick_view_form.xml
index 34b4444..5616cb0 100644
--- a/view/product_oneclick_view_form.xml
+++ b/view/product_oneclick_view_form.xml
@@ -8,9 +8,7 @@ The COPYRIGHT file at the top level of this repository contains the full copyrig
-
+