Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
d6f218f
[MIG] web_diagram: move from odoo
mathben Mar 26, 2026
ebb79b4
[FIX] web_diagram: fix qunit test asset injection for Odoo 14
mathben Mar 26, 2026
c73a980
[FIX] web_diagram: register diagram as valid ir.ui.view type
mathben Mar 26, 2026
59cfd5d
[FIX] web_diagram: validate node/arrow fields against their own model
mathben Mar 26, 2026
58ee565
[FIX] web_diagram: fix BasicView field processing for Odoo 14
mathben Mar 26, 2026
61bde2f
[FIX] web_diagram: restore graph_get removed in Odoo 14
mathben Mar 26, 2026
c215f28
[FIX] web_diagram: bundle graph layout class removed from odoo.tools
mathben Mar 26, 2026
196509f
[MIG] web_diagram: migrate asset declarations to Odoo 15
mathben Mar 26, 2026
1b8d337
[FIX] web_diagram: adapt view postprocessing for Odoo 15
mathben Mar 26, 2026
55c2fda
[FIX] web_diagram: javascript change parameter to get id object
mathben Mar 26, 2026
983fb65
[ADD] web_diagram_builder: initial module
mmaanneell May 5, 2026
63ddfb3
[ADD] web_diagram_builder: CSV import/export and node/link detail views
mmaanneell May 5, 2026
63b0e97
[ADD] web_diagram_builder: French (fr_CA) translations
mmaanneell May 5, 2026
72eb91a
[ADD] web_diagram_builder: in-app tutorial (help wizard + Quick Guide…
mmaanneell May 5, 2026
88f24ec
[ADD] web_diagram_builder: find path between two nodes
mmaanneell May 5, 2026
b3e98a7
[ADD] web_diagram_builder: add Python unit tests
mmaanneell May 5, 2026
ee4a4f8
[FIX] web_diagram, web_diagram_builder: Odoo 15 compatibility fixes
mmaanneell May 8, 2026
68b1032
[IMP] web_diagram: replace Raphael/CuteGraph renderer with Cytoscape …
mmaanneell May 8, 2026
75cb344
[ADD] web_diagram: navigation help popup with bilingual keyboard shor…
mmaanneell May 8, 2026
cd493a5
[IMP] web_diagram: export full diagram as PNG using Cytoscape cy.png
mmaanneell May 8, 2026
d52d793
[ADD] web_diagram: Python unit tests for view validation and graph_get
mmaanneell May 8, 2026
5baae43
[ADD] web_diagram: pager navigation between diagrams in diagram view
mmaanneell May 8, 2026
35b9eec
[IMP] web_diagram_builder: OCA compliance metadata and readme
mmaanneell May 8, 2026
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
3 changes: 3 additions & 0 deletions web_diagram/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.

from . import controllers, models
39 changes: 39 additions & 0 deletions web_diagram/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.

{
'name': 'Odoo Web Diagram',
'category': 'Hidden',
'description': """
Openerp Web Diagram view.
=========================

""",
'version': "15.0.1.0.0",
'depends': ['web'],
'data': [
'security/ir.model.access.csv',
'views/diagram_nav_help_views.xml',
],
'assets': {
'web.assets_backend': [
'web_diagram/static/src/scss/diagram_view.scss',
# Cytoscape + dagre must load in this order (global scripts)
'web_diagram/static/lib/js/dagre.min.js',
'web_diagram/static/lib/js/cytoscape.min.js',
'web_diagram/static/lib/js/cytoscape-dagre.min.js',
'web_diagram/static/src/js/diagram_model.js',
'web_diagram/static/src/js/diagram_controller.js',
'web_diagram/static/src/js/diagram_renderer.js',
'web_diagram/static/src/js/diagram_view.js',
'web_diagram/static/src/js/view_registry.js',
],
'web.assets_qweb': [
'web_diagram/static/src/xml/base_diagram.xml',
],
'web.qunit_suite_tests': [
'web_diagram/static/tests/diagram_tests.js',
],
},
'auto_install': True,
'license': 'LGPL-3',
}
3 changes: 3 additions & 0 deletions web_diagram/controllers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.

from . import main
115 changes: 115 additions & 0 deletions web_diagram/controllers/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.

import odoo.http as http

from odoo.tools.safe_eval import safe_eval


class DiagramView(http.Controller):

@http.route('/web_diagram/diagram/get_diagram_info', type='json', auth='user')
def get_diagram_info(self, id, model, node, connector,
src_node, des_node, label, **kw):

visible_node_fields = kw.get('visible_node_fields', [])
invisible_node_fields = kw.get('invisible_node_fields', [])
node_fields_string = kw.get('node_fields_string', [])
connector_fields = kw.get('connector_fields', [])
connector_fields_string = kw.get('connector_fields_string', [])

bgcolors = {}
shapes = {}
bgcolor = kw.get('bgcolor', '')
shape = kw.get('shape', '')

if bgcolor:
for color_spec in bgcolor.split(';'):
if color_spec:
colour, color_state = color_spec.split(':')
bgcolors[colour] = color_state

if shape:
for shape_spec in shape.split(';'):
if shape_spec:
shape_colour, shape_color_state = shape_spec.split(':')
shapes[shape_colour] = shape_color_state

ir_view = http.request.env['ir.ui.view']
graphs = ir_view.graph_get(int(id), model, node, connector, src_node,
des_node, label, (140, 180))
nodes = graphs['nodes']
transitions = graphs['transitions']
isolate_nodes = {}
for blnk_node in graphs['blank_nodes']:
isolate_nodes[blnk_node['id']] = blnk_node
y = [
t['y']
for t in nodes.values()
if t['x'] == 20
if t['y']
]
y_max = (y and max(y)) or 120

connectors = {}
list_tr = []

for tr in transitions:
list_tr.append(tr)
connectors.setdefault(tr, {
'id': int(tr),
's_id': transitions[tr][0],
'd_id': transitions[tr][1]
})

connector_model = http.request.env[connector]
data_connectors = connector_model.search([('id', 'in', list_tr)]).read(connector_fields)

for tr in data_connectors:
transition_id = str(tr['id'])
_sourceid, label = graphs['label'][transition_id]
t = connectors[transition_id]
t.update(
source=tr[src_node][1],
destination=tr[des_node][1],
options={},
signal=label
)

for i, fld in enumerate(connector_fields):
t['options'][connector_fields_string[i]] = tr[fld]

fields = http.request.env['ir.model.fields']
field = fields.search([('model', '=', model), ('relation', '=', node)])
node_act = http.request.env[node]
search_acts = node_act.search([(field.relation_field, '=', id)])
data_acts = search_acts.read(invisible_node_fields + visible_node_fields)

for act in data_acts:
n = nodes.get(str(act['id']))
if not n:
n = isolate_nodes.get(act['id'], {})
y_max += 140
n.update(x=20, y=y_max)
nodes[act['id']] = n

n.update(
id=act['id'],
color='white',
options={}
)
for color, expr in bgcolors.items():
if safe_eval(expr, act):
n['color'] = color

for shape, expr in shapes.items():
if safe_eval(expr, act):
n['shape'] = shape

for i, fld in enumerate(visible_node_fields):
n['options'][node_fields_string[i]] = act[fld]

_id, name = http.request.env[model].browse([id]).name_get()[0]
return dict(nodes=nodes,
conn=connectors,
display_name=name,
parent_field=graphs['node_parent_field'])
93 changes: 93 additions & 0 deletions web_diagram/i18n/af.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * web_diagram
#
# Translators:
msgid ""
msgstr ""
"Project-Id-Version: Odoo 9.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-08-18 14:08+0000\n"
"PO-Revision-Date: 2015-08-25 10:26+0000\n"
"Last-Translator: <>\n"
"Language-Team: Afrikaans (http://www.transifex.com/odoo/odoo-9/language/"
"af/)\n"
"Language: af\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. module: web_diagram
#. openerp-web
#: code:addons/web_diagram/static/src/js/diagram.js:249
#: code:addons/web_diagram/static/src/js/diagram.js:277
#, python-format
msgid "Activity"
msgstr "Aktiwiteit"

#. module: web_diagram
#. openerp-web
#: code:addons/web_diagram/static/src/js/diagram.js:282
#: code:addons/web_diagram/static/src/js/diagram.js:326
#, python-format
msgid "Create:"
msgstr ""

#. module: web_diagram
#. openerp-web
#: code:addons/web_diagram/static/src/js/diagram.js:220
#, python-format
msgid ""
"Deleting this node cannot be undone.\n"
"It will also delete all connected transitions.\n"
"\n"
"Are you sure ?"
msgstr ""

#. module: web_diagram
#. openerp-web
#: code:addons/web_diagram/static/src/js/diagram.js:238
#, python-format
msgid ""
"Deleting this transition cannot be undone.\n"
"\n"
"Are you sure ?"
msgstr ""

#. module: web_diagram
#. openerp-web
#: code:addons/web_diagram/static/src/js/diagram.js:19
#, python-format
msgid "Diagram"
msgstr ""

#. module: web_diagram
#. openerp-web
#: code:addons/web_diagram/static/src/js/diagram.js:124
#, python-format
msgid "New"
msgstr "Nuwe"

#. module: web_diagram
#. openerp-web
#: code:addons/web_diagram/static/src/xml/base_diagram.xml:5
#, python-format
msgid "New Node"
msgstr ""

#. module: web_diagram
#. openerp-web
#: code:addons/web_diagram/static/src/js/diagram.js:254
#: code:addons/web_diagram/static/src/js/diagram.js:310
#, python-format
msgid "Open: "
msgstr ""

#. module: web_diagram
#. openerp-web
#: code:addons/web_diagram/static/src/js/diagram.js:305
#: code:addons/web_diagram/static/src/js/diagram.js:321
#, python-format
msgid "Transition"
msgstr ""
92 changes: 92 additions & 0 deletions web_diagram/i18n/am.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * web_diagram
#
# Translators:
msgid ""
msgstr ""
"Project-Id-Version: Odoo 9.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-08-18 14:08+0000\n"
"PO-Revision-Date: 2015-09-08 09:26+0000\n"
"Last-Translator: Martin Trigaux\n"
"Language-Team: Amharic (http://www.transifex.com/odoo/odoo-9/language/am/)\n"
"Language: am\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"

#. module: web_diagram
#. openerp-web
#: code:addons/web_diagram/static/src/js/diagram.js:249
#: code:addons/web_diagram/static/src/js/diagram.js:277
#, python-format
msgid "Activity"
msgstr ""

#. module: web_diagram
#. openerp-web
#: code:addons/web_diagram/static/src/js/diagram.js:282
#: code:addons/web_diagram/static/src/js/diagram.js:326
#, python-format
msgid "Create:"
msgstr ""

#. module: web_diagram
#. openerp-web
#: code:addons/web_diagram/static/src/js/diagram.js:220
#, python-format
msgid ""
"Deleting this node cannot be undone.\n"
"It will also delete all connected transitions.\n"
"\n"
"Are you sure ?"
msgstr ""

#. module: web_diagram
#. openerp-web
#: code:addons/web_diagram/static/src/js/diagram.js:238
#, python-format
msgid ""
"Deleting this transition cannot be undone.\n"
"\n"
"Are you sure ?"
msgstr ""

#. module: web_diagram
#. openerp-web
#: code:addons/web_diagram/static/src/js/diagram.js:19
#, python-format
msgid "Diagram"
msgstr ""

#. module: web_diagram
#. openerp-web
#: code:addons/web_diagram/static/src/js/diagram.js:124
#, python-format
msgid "New"
msgstr "አዲስ"

#. module: web_diagram
#. openerp-web
#: code:addons/web_diagram/static/src/xml/base_diagram.xml:5
#, python-format
msgid "New Node"
msgstr ""

#. module: web_diagram
#. openerp-web
#: code:addons/web_diagram/static/src/js/diagram.js:254
#: code:addons/web_diagram/static/src/js/diagram.js:310
#, python-format
msgid "Open: "
msgstr ""

#. module: web_diagram
#. openerp-web
#: code:addons/web_diagram/static/src/js/diagram.js:305
#: code:addons/web_diagram/static/src/js/diagram.js:321
#, python-format
msgid "Transition"
msgstr ""
Loading
Loading