Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions ai_oca_bridge_extra_parameters/models/ai_extra_parameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ class AIExtraParameter(models.Model):
"sorted",
"enumerate",
"range",
"env",
}

ALLOWED_FORMULA_CONTEXT_VARS = {
Expand Down Expand Up @@ -116,6 +117,7 @@ class AIExtraParameter(models.Model):
"KeyError",
"IndexError",
"ZeroDivisionError",
"env",
}

@staticmethod
Expand Down Expand Up @@ -247,6 +249,7 @@ def evaluate_single_expression(match):
"True": True,
"False": False,
"None": None,
"env": self.env,
}

try:
Expand Down Expand Up @@ -314,6 +317,7 @@ def _evaluate_formula(self, obj=None):
"True": True,
"False": False,
"None": None,
"env": self.env,
}

try:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,6 @@ def test_invalid_variable_names(self):
"{partner.name}",
"{obj.name}",
"{user.name}",
"{env}",
"{cr}",
]

Expand Down