Skip to content

Fix analytic_get_view function

oury.balde requested to merge topic/16.0/ob into branch/16.0

An AttributeError occurs when including analytics from the wrong analytic model.

The error message indicates that the object does not have the attribute "_required_analytic_fields". To resolve this, replace the line:

required = self.env[view["model"]]._required_analytic_fields()

with:

model_analytic = model.replace("_", ".") required = self.env[model_analytic]._required_analytic_fields()

This change ensures that the correct analytic model is referenced, avoiding the AttributeError and enabling the retrieval of the required analytics fields.

--HG-- branch : 16.0

Merge request reports