[16.0][ADD] web_diagram_builder: build interactive dependency diagrams from any many2one field#3539
Draft
mmaanneell wants to merge 22 commits into
Draft
[16.0][ADD] web_diagram_builder: build interactive dependency diagrams from any many2one field#3539mmaanneell wants to merge 22 commits into
mmaanneell wants to merge 22 commits into
Conversation
- apply OCA script migration with OpenUpgrade
In Odoo 14, the test bundle was renamed from web.qunit_suite to web.qunit_suite_tests. The old xpath also referenced kanban_tests.js which no longer exists at the expected path, causing an install error. Use expr="." position="inside" for a stable injection. Generated by Claude Code 2.1.84 model claude-sonnet-4-6 Co-Authored-By: Mathieu Benoit <mathben@technolibre.ca>
Odoo 14 validates the type field of ir.ui.view against a selection
list. Without extending the model to add ("diagram", "Diagram"),
installing any module with a diagram view raises:
"Wrong value for ir.ui.view.type: 'diagram'".
Follows the same pattern as OCA web_timeline.
Generated by Claude Code 2.1.84 model claude-sonnet-4-6
Co-Authored-By: Mathieu Benoit <mathben@technolibre.ca>
Odoo 14's view postprocessor validates all <field> elements against the main diagram model via NameManager. Since <node> and <arrow> each declare their own 'object' model, their child fields must be validated against that model instead. Without this, installing any module with a diagram view raises a field-not-found error on the connector's source/destination fields. Generated by Claude Code 2.1.84 model claude-sonnet-4-6 Co-Authored-By: Mathieu Benoit <mathben@technolibre.ca>
BasicView._processNode traverses all <field> elements in the arch and looks them up in fv.viewFields (the main model's fields). For diagram views, <node> and <arrow> fields belong to their own object models, causing field to be undefined and crashing _getFieldWidgetClass at field.type. Stop traversal into those tags and guard field lookups in init against undefined. Generated by Claude Code 2.1.84 model claude-sonnet-4-6 Co-Authored-By: Mathieu Benoit <mathben@technolibre.ca>
ir.ui.view.graph_get() was dropped from Odoo core when the diagram view was removed in v14. The diagram controller still calls it to compute node positions and transitions. Port the Odoo 13 implementation into the module's own ir.ui.view override so the method is available. Generated by Claude Code 2.1.84 model claude-sonnet-4-6 Co-Authored-By: Mathieu Benoit <mathben@technolibre.ca>
odoo.tools.graph was dropped in Odoo 14 along with the diagram view. Port the Odoo 13 implementation into the module under tools/graph.py and update the import to use the local copy. Generated by Claude Code 2.1.84 model claude-sonnet-4-6 Co-Authored-By: Mathieu Benoit <mathben@technolibre.ca>
Odoo 15 dropped the `qweb` manifest key and the XML template inheritance pattern for assets. Assets must now be declared under the `assets` key in __manifest__.py using named bundles (web.assets_backend, web.assets_qweb, web.qunit_suite_tests). Remove the now-obsolete views/web_diagram_templates.xml. Generated by Claude Code 2.1.84 model claude-sonnet-4-6 Co-Authored-By: Mathieu Benoit <mathben@technolibre.ca>
In Odoo 15, NameManager.__init__ no longer accepts a validate flag, postprocess() was removed in favour of a stack loop inside _postprocess_view(), and check_view_fields() was renamed to check(). Replace the manual NameManager/postprocess pattern with a wrapper element passed to _postprocess_view() against the node/arrow object model, which handles the full processing pipeline correctly. Generated by Claude Code 2.1.84 model claude-sonnet-4-6 Co-Authored-By: Mathieu Benoit <mathben@technolibre.ca>
The legacy web framework (BasicView, AbstractModel, AbstractController, AbstractRenderer) was removed in Odoo 16. Rewrite all JS files as OWL components and ES6 classes. Replace web.assets_qweb (dropped in v16) by including the XML template directly in web.assets_backend. Replace the deprecated name_get() call with display_name. Bump version to 16.0.1.0.0. Generated by Claude Code 2.1.84 model claude-sonnet-4-6 Co-Authored-By: Mathieu Benoit <mathben@technolibre.ca>
Provides developer and user reference for the diagram view module: architecture overview, arch attribute reference, Odoo 16 migration notes, view switcher limitation with recommended workaround, and JSON-RPC endpoint signature. Generated by Claude Code 2.1.85 model claude-sonnet-4-6 Co-Authored-By: Mathieu Benoit <mathben@technolibre.ca>
Recursive dependency diagram builder for any many2one field. Includes node/link generation, template system, diagram and form views, adapted for Odoo 16 (attrs= syntax, post_init_hook(cr, registry)). Co-Authored-By: Manel Guechetouli <manelguechetouli@gmail.com> Generated by Claude Code claude-sonnet-4-6
Add CSV import with validation report and result models, plus dedicated form and list views for nodes and links. Co-Authored-By: Manel Guechetouli <manelguechetouli@gmail.com> Generated by Claude Code claude-sonnet-4-6
Co-Authored-By: Manel Guechetouli <manelguechetouli@gmail.com> Generated by Claude Code claude-sonnet-4-6
… menu)
Add step-by-step help wizard and cron-based Quick Guide data.
JS widget adapted for Odoo 16: owl="1" on template, class-only
registry.add (not {component: Class}).
Co-Authored-By: Manel Guechetouli <manelguechetouli@gmail.com>
Generated by Claude Code claude-sonnet-4-6
Add wizard and BFS algorithm to find the shortest path between any two nodes in the dependency graph. Co-Authored-By: Manel Guechetouli <manelguechetouli@gmail.com> Generated by Claude Code claude-sonnet-4-6
Co-Authored-By: Manel Guechetouli <manelguechetouli@gmail.com> Generated by Claude Code claude-sonnet-4-6
Port Cytoscape.js renderer from Odoo 17. Key Odoo 16 adaptations:
- post_init_hook(cr, registry) signature instead of (env)
- rpc injected via useService("rpc") instead of bare jsonrpc import
- usePager hook replaces inline Pager slot in control panel
- layout-buttons slot instead of control-panel-create-button
- web.qunit_suite_tests instead of web.assets_unit_tests
- _validate_tag_label traverses parent nodes (node_info has no view_type)
Co-Authored-By: Manel Guechetouli <manelguechetouli@gmail.com>
Generated by Claude Code claude-sonnet-4-6
Add web.diagram.nav.help transient model with bilingual HTML content (fr/en), action and form view, and French translations in fr.po. Co-Authored-By: Manel Guechetouli <manelguechetouli@gmail.com> Generated by Claude Code claude-sonnet-4-6
Co-Authored-By: Manel Guechetouli <manelguechetouli@gmail.com> Generated by Claude Code claude-sonnet-4-6
Mise à jour des métadonnées : author OCA, website github.com/OCA/web, development_status Beta, maintainers mmaanneell, version 16.0.1.0.0. Ajout de pyproject.toml et des fragments readme/ (DESCRIPTION, USAGE, CONTRIBUTORS). Co-Authored-By: Manel Guechetouli <manelguechetouli@gmail.com> Generated by Claude Code claude-sonnet-4-6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
web_diagram_builderthat generates interactive hierarchy diagrams from any Odoo model with a recursive many2one field (e.g.parent_id)web_diagramrenderer from Raphael.js to Cytoscape.js for Odoo 16Related PR
Odoo 18 version: #3538
Test plan
web_diagram_builderon a fresh Odoo 16 databaseres.partner+parent_idpytest addons/web_diagram_builder/tests/🤖 Generated with Claude Code