[IMP] report_carbone : bump to version 18.0.1.1.4

This commit is contained in:
2026-09-25 17:11:23 +02:00
parent 8a4d393dc0
commit 40a08e2ef8
18 changed files with 932 additions and 433 deletions

View File

@@ -1,3 +1,5 @@
import os
from odoo import fields, models
@@ -14,12 +16,20 @@ class CarboneResConfigSettings(models.TransientModel):
return self.env["ir.actions.actions"]._for_xml_id("report_carbone.action_carbone_report_template_tree_all")
def retrieve_carbone_api_key(self, test_mode_key=False):
"""Depending on the ‘test mode’ checkbox or 'test_mode_key' parameter, either the production key or
the staging key is returned."""
"""Depending on the ‘test mode’ checkbox or ‘test_mode_key’ parameter, either the production key or
the staging key is returned.
The value set in the UI (ir.config_parameter) takes priority. If absent, the environment variable
CARBONE_STAGE_API_KEY or CARBONE_PROD_API_KEY is used as a fallback.
"""
stage_mode = self.env["ir.config_parameter"].sudo().get_param("report-engine.is_stage_mode")
if stage_mode or test_mode_key:
return self.env["ir.config_parameter"].sudo().get_param("report-engine.stage_api_key")
return self.env["ir.config_parameter"].sudo().get_param("report-engine.prod_api_key")
return self.env["ir.config_parameter"].sudo().get_param("report-engine.stage_api_key") or os.environ.get(
"CARBONE_STAGE_API_KEY"
)
return self.env["ir.config_parameter"].sudo().get_param("report-engine.prod_api_key") or os.environ.get(
"CARBONE_PROD_API_KEY"
)
def action_download_carbone_documentation(self):
ir_action_report = self.env["ir.actions.report"]