From 8d47c32e58e959f820ecbe4fbf948c9d4e659e5d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20-=20Le=20Filament?= <remi@le-filament.com>
Date: Tue, 9 Jan 2024 12:08:34 +0100
Subject: [PATCH] [UPD] use instance parameter instead of prod one

---
 templates/odoo.conf.j2 | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/templates/odoo.conf.j2 b/templates/odoo.conf.j2
index c56a478..08cebd3 100644
--- a/templates/odoo.conf.j2
+++ b/templates/odoo.conf.j2
@@ -49,7 +49,7 @@ db_password = {{ odoo_instances[item.value.prod_instance | default(item.key )].d
 db_user = {{ odoo_instances[item.value.prod_instance | default(item.key )].db_user }}
 ; db_template = template0
 db_host = db
-db_maxconn = {{ odoo_instances[item.value.prod_instance | default(item.key )].odoo_db_maxconn | default(64) }}
+db_maxconn = {{ item.value.odoo_db_maxconn | default(64) }}
 ; db_sslmode = prefer
 ; pg_path =
 
@@ -66,10 +66,10 @@ unaccent = True
 ; limit_memory_hard = 2684354560
 ; limit_memory_soft = 2147483648
 ; limit_request = 65536
-limit_time_cpu = {{ odoo_instances[item.value.prod_instance | default(item.key )].odoo_limit_time_cpu | default(300) }}
-limit_time_real = {{ odoo_instances[item.value.prod_instance | default(item.key )].odoo_limit_time_real | default(600) }}
+limit_time_cpu = {{ item.value.odoo_limit_time_cpu | default(300) }}
+limit_time_real = {{ item.value.odoo_limit_time_real | default(600) }}
 ; limit_time_real_cron = -1
-{% if ansible_processor_vcpus > 2 or odoo_instances[item.value.prod_instance | default(item.key )].force_odoo_workers is defined %}
+{% if ansible_processor_vcpus > 2 or item.value.force_odoo_workers is defined %}
 max_cron_threads = {{ ansible_processor_vcpus | int }}
 workers = {{ (ansible_processor_vcpus * 2 - 1) | int | abs }}
 {% else %}
@@ -79,30 +79,30 @@ workers = {{ (ansible_processor_vcpus * 2 - 1) | int | abs }}
 {% if instance_odoo_setup.odoo_version == '12.0' %}
 
 ;; Autoinstall options
-modules_auto_install_disabled = account_facturx,mail_bot,web_unsplash{% if odoo_instances[item.value.prod_instance | default(item.key )].modules_auto_install_disabled is defined %},{{ odoo_instances[item.value.prod_instance | default(item.key )].modules_auto_install_disabled }}{% endif %}
+modules_auto_install_disabled = account_facturx,mail_bot,web_unsplash{% if item.value.modules_auto_install_disabled is defined %},{{ item.value.modules_auto_install_disabled }}{% endif %}
 
-modules_auto_install_enabled = disable_odoo_online,lefilament_release_agent,mail_debrand,partner_disable_gravatar,partner_firstname,password_security,remove_odoo_enterprise,web_responsive,web_no_bubble{% if odoo_instances[item.value.prod_instance | default(item.key )].modules_auto_install_enabled is defined %},{{ odoo_instances[item.value.prod_instance | default(item.key )].modules_auto_install_enabled }}{% endif %}
+modules_auto_install_enabled = disable_odoo_online,lefilament_release_agent,mail_debrand,partner_disable_gravatar,partner_firstname,password_security,remove_odoo_enterprise,web_responsive,web_no_bubble{% if item.value.modules_auto_install_enabled is defined %},{{ item.value.modules_auto_install_enabled }}{% endif %}
 
 {% endif %}
 {% if instance_odoo_setup.odoo_version == '14.0' %}
 
 ;; Autoinstall options
-modules_auto_install_disabled = account_edi,mail_bot,web_unsplash{% if odoo_instances[item.value.prod_instance | default(item.key )].modules_auto_install_disabled is defined %},{{ odoo_instances[item.value.prod_instance | default(item.key )].modules_auto_install_disabled }}{% endif %}
+modules_auto_install_disabled = account_edi,mail_bot,web_unsplash{% if item.value.modules_auto_install_disabled is defined %},{{ item.value.modules_auto_install_disabled }}{% endif %}
 
-modules_auto_install_enabled = account_move_name_sequence,account_reconcile_show_boolean,account_reconciliation_widget,disable_odoo_online,lefilament_release_agent,mail_debrand,partner_disable_gravatar,partner_firstname,password_security,remove_login_links,remove_odoo_enterprise,web_responsive,web_no_bubble{% if odoo_instances[item.value.prod_instance | default(item.key )].modules_auto_install_enabled is defined %},{{ odoo_instances[item.value.prod_instance | default(item.key )].modules_auto_install_enabled }}{% endif %}
+modules_auto_install_enabled = account_move_name_sequence,account_reconcile_show_boolean,account_reconciliation_widget,disable_odoo_online,lefilament_release_agent,mail_debrand,partner_disable_gravatar,partner_firstname,password_security,remove_login_links,remove_odoo_enterprise,web_responsive,web_no_bubble{% if item.value.modules_auto_install_enabled is defined %},{{ item.value.modules_auto_install_enabled }}{% endif %}
 
 {% endif %}
 {% if instance_odoo_setup.odoo_version == '16.0' %}
 
 ;; Autoinstall options
-modules_auto_install_disabled = account_edi,google_gmail,mail_bot,web_unsplash{% if odoo_instances[item.value.prod_instance | default(item.key )].modules_auto_install_disabled is defined %},{{ odoo_instances[item.value.prod_instance | default(item.key )].modules_auto_install_disabled }}{% endif %}
+modules_auto_install_disabled = account_edi,google_gmail,mail_bot,web_unsplash{% if item.value.modules_auto_install_disabled is defined %},{{ item.value.modules_auto_install_disabled }}{% endif %}
 
 ; to be updated once all modules are available
-modules_auto_install_enabled = account_move_name_sequence,disable_odoo_online,lefilament_release_agent,mail_debrand,partner_disable_gravatar,partner_firstname,password_security,remove_login_links,remove_odoo_enterprise,web_responsive,web_no_bubble,web_theme_classic{% if odoo_instances[item.value.prod_instance | default(item.key )].modules_auto_install_enabled is defined %},{{ odoo_instances[item.value.prod_instance | default(item.key )].modules_auto_install_enabled }}{% endif %}
+modules_auto_install_enabled = account_move_name_sequence,disable_odoo_online,lefilament_release_agent,mail_debrand,partner_disable_gravatar,partner_firstname,password_security,remove_login_links,remove_odoo_enterprise,web_responsive,web_no_bubble,web_theme_classic{% if item.value.modules_auto_install_enabled is defined %},{{ item.value.modules_auto_install_enabled }}{% endif %}
 
 {% endif %}
-{% if odoo_instances[item.value.prod_instance | default(item.key )].odoo_extra_conf is defined %}
+{% if item.value.odoo_extra_conf is defined %}
 
 ;; Extra options
-{{ odoo_instances[item.value.prod_instance | default(item.key )].odoo_extra_conf }}
+{{ item.value.odoo_extra_conf }}
 {% endif %}
-- 
GitLab