From 05279c69fc17a5d1e9a996ba9549e0d93156420e Mon Sep 17 00:00:00 2001
From: Emanuel Buzey <buzeyemanuel@gmail.com>
Date: Thu, 22 Feb 2024 11:24:55 +0100
Subject: [PATCH] [IMP] energy_selfconsumption: readonly if type is variable
 schedule

---
 energy_selfconsumption/views/distribution_table_views.xml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/energy_selfconsumption/views/distribution_table_views.xml b/energy_selfconsumption/views/distribution_table_views.xml
index ad064b904..3e8338989 100644
--- a/energy_selfconsumption/views/distribution_table_views.xml
+++ b/energy_selfconsumption/views/distribution_table_views.xml
@@ -65,7 +65,8 @@
                 widget="one2many"
                 mode="list"
                 context="{'default_distribution_table_id':id}"
-                attrs="{'readonly': [('state', 'not in', ['draft'])]}"
+                attrs="{'readonly': ['|', ('type', '=', 'variable_schedule'), '&amp;', ('type', '=', 'fixed'), ('state', 'not in', ['draft'])]}"
+              >
               >
                                 <tree editable="bottom">
                                     <field
-- 
GitLab