diff --git a/MetaAnalytic.py b/MetaAnalytic.py index 6ea1a5ccf9078cdddd0cf3db5391a68718d14f98_TWV0YUFuYWx5dGljLnB5..3931edcf2fe415296220e1d306eb0b0b0591f180_TWV0YUFuYWx5dGljLnB5 100644 --- a/MetaAnalytic.py +++ b/MetaAnalytic.py @@ -219,7 +219,14 @@ self.env["analytic.structure"] .search( [ - ("model_name", "=", self._name.replace(".", "_")), + ( + "model_name", + "=", + self._analytic + if hasattr(self, "_analytic") + and isinstance(self._analytic, str) + else self._name.replace(".", "_"), + ), ("required", "=", True), ] ) diff --git a/NEWS.rst b/NEWS.rst index 6ea1a5ccf9078cdddd0cf3db5391a68718d14f98_TkVXUy5yc3Q=..3931edcf2fe415296220e1d306eb0b0b0591f180_TkVXUy5yc3Q= 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -2,6 +2,16 @@ Changes ======= +.. _10.0.1.1.0: + +10.0.1.1.0 +---------- + +Corrected a bug, when seeking if analytic codes are required in a form or tree +view. If the associated analytic structures were defined with a model name, +which did not match the original model technical name, the system was unable to +determine, if the analytic codes were wanted as required. + .. _10.0.1.0.0: 10.0.1.0.0 diff --git a/models/analytic_structure.py b/models/analytic_structure.py index 6ea1a5ccf9078cdddd0cf3db5391a68718d14f98_bW9kZWxzL2FuYWx5dGljX3N0cnVjdHVyZS5weQ==..3931edcf2fe415296220e1d306eb0b0b0591f180_bW9kZWxzL2FuYWx5dGljX3N0cnVjdHVyZS5weQ== 100644 --- a/models/analytic_structure.py +++ b/models/analytic_structure.py @@ -350,7 +350,12 @@ # Now we can insert the fields in the view's architecture. model_map = { - model._name.replace(".", "_"): model._name + ( + model._analytic + if hasattr(model, "_analytic") + and isinstance(model._analytic, str) + else model._name.replace(".", "_") + ): model._name for name, model in iter(self.env.registry.items()) } required = self.env[