From c9409cfd1b013d931f3e0bbc49e4dadcebe94ca6 Mon Sep 17 00:00:00 2001 From: Simone Orsi Date: Wed, 10 Apr 2024 16:41:22 +0200 Subject: [PATCH] storage_media_product: gray out inactive relations --- storage_media_product/models/product.py | 2 ++ storage_media_product/views/product.xml | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/storage_media_product/models/product.py b/storage_media_product/models/product.py index 12832b70af..d8a5e5c048 100644 --- a/storage_media_product/models/product.py +++ b/storage_media_product/models/product.py @@ -46,6 +46,8 @@ class ProductMediaRelation(models.Model): sequence = fields.Integer() media_id = fields.Many2one("storage.media", required=True) + # Just to gray out relations in the tree view on the product + active = fields.Boolean(related="media_id.active") attribute_value_ids = fields.Many2many( "product.attribute.value", string="Attributes" ) diff --git a/storage_media_product/views/product.xml b/storage_media_product/views/product.xml index bed85ec77b..26a82b1474 100644 --- a/storage_media_product/views/product.xml +++ b/storage_media_product/views/product.xml @@ -40,7 +40,8 @@ product.media.relation - + +