[IMP] addons info in models graph#11
Conversation
to see better picture: where the model is extended
fkantelberg
left a comment
There was a problem hiding this comment.
Finally got some time to look over it. I understand the idea but I'm currently not sure if this is how we should implement it as this would make the output unusable for something like often used models.
| if addons: | ||
| extended_name = (f"{model_name} \\n\\n*addons*\\n" | ||
| f" {',\\n'.join(addons)}") | ||
| name_mapping[model_name] = extended_name |
There was a problem hiding this comment.
This will just clutter the output especially if you have models like res.partner which are all over the place. I'm not sure if the MRO from this tool is reliable enough outside of the Odoo shell if you want to know which function is behind the next super() and if you have an Odoo shell there are better options to analyze an Odoo environment and the dependencies. Knowing which module extends a model is quite important though but I'm not sure if this format is great here.
Do you have a better suggestion? If not this shouldn't be the default behaviour and only available with a flag/option set.
|
|
||
| self._show_graph( | ||
| graph, check_node, color_node, color_edge, filename=filename or "model.gv" | ||
| graph, check_node, color_node, color_edge, filename=filename or "model.gv.dot" |
There was a problem hiding this comment.
It doesn't have to be dot because you can change the engine with an option.
| for model_name, deps in graph.items(): | ||
| extended_name = name_mapping.get(model_name, model_name) | ||
| extended_deps = {name_mapping.get(x, x) for x in deps} | ||
| extended_graph[extended_name] = extended_deps |
There was a problem hiding this comment.
I would rather implement a labels argument in _show_graph than using these extended names here.
to see better picture: where the model is extended