Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
0c2a539
[MIG] web_diagram: move from odoo
mathben Mar 26, 2026
bc6b78d
[FIX] web_diagram: fix qunit test asset injection for Odoo 14
mathben Mar 26, 2026
18dfa19
[FIX] web_diagram: register diagram as valid ir.ui.view type
mathben Mar 26, 2026
422162d
[FIX] web_diagram: validate node/arrow fields against their own model
mathben Mar 26, 2026
92d3f51
[FIX] web_diagram: fix BasicView field processing for Odoo 14
mathben Mar 26, 2026
ddcf8ec
[FIX] web_diagram: restore graph_get removed in Odoo 14
mathben Mar 26, 2026
71c2fc6
[FIX] web_diagram: bundle graph layout class removed from odoo.tools
mathben Mar 26, 2026
1e7b009
[MIG] web_diagram: migrate asset declarations to Odoo 15
mathben Mar 26, 2026
956417c
[FIX] web_diagram: adapt view postprocessing for Odoo 15
mathben Mar 26, 2026
8abe0f5
[FIX] web_diagram: javascript change parameter to get id object
mathben Mar 26, 2026
15fe096
[MIG] web_diagram: migrate JS and assets to Odoo 16
mathben Mar 26, 2026
12e27b1
[ADD] web_diagram: add readme documentation
mathben Mar 27, 2026
c25c172
[MIG] web_diagram migrate to odoo 17
mathben Mar 27, 2026
52f5c2e
[MIG] web_diagram support odoo 18
mathben Mar 27, 2026
d2533d1
[MIG] web_diagram: cleanup and OCA compliance for Odoo 18
mathben Mar 27, 2026
cf2901a
[REF] web_diagram: code quality and OCA compliance
mathben Mar 27, 2026
a0cde1c
[FIX] web_diagram: remove jQuery dependency for Odoo 18
mathben Mar 27, 2026
fbaac49
[FIX] web_diagram: revert invalid OWL 3 props definition
mathben Mar 27, 2026
9f1205e
[FIX] web_diagram: remove type field from view definition
mathben Mar 27, 2026
e97c510
[FIX] web_diagram: fix props syntax for OWL 3 (Odoo 18)
mathben Mar 27, 2026
6798146
[FIX] web_diagram: register diagram in session.view_info for Odoo 18
mathben Mar 27, 2026
ae55923
[FIX] web_diagram: replace rpc service with rpc function for Odoo 18
mathben Mar 27, 2026
3c80eb7
[FIX] web_diagram: resolve resId when switching via control panel in …
mathben Mar 27, 2026
97764fa
[FIX] web_diagram: workaround Odoo 18 switchView crash on lazy contro…
mathben Mar 27, 2026
33b82ec
[IMP] web_diagram: add control panel with breadcrumbs and view switcher
mathben Mar 27, 2026
f53cb6d
[FIX] web_diagram: use correct slot for New Node button in control panel
mathben Mar 27, 2026
5ea65ee
[FIX] web_diagram: fix diagram canvas height inside Layout component
mathben Mar 27, 2026
249ccf5
[IMP] web_diagram: add pager and fix record ID lost on view switch
mathben Mar 27, 2026
67f5cc2
[FIX] web_diagram: fix diagram canvas capped at 150px height
mathben Mar 27, 2026
93e9bd7
[FIX] web_diagram: fix diagram height without breaking Raphael coordi…
mathben Mar 27, 2026
5a17ab7
[FIX] web_diagram: fix nodes invisible due to Raphael overflow:hidden…
mathben Mar 27, 2026
959cbef
[FIX] web_diagram: reload diagram when switching back from form view
mathben Mar 27, 2026
db45791
[FIX] web_diagram: render SVG directly in container for correct height
mathben Mar 27, 2026
03137f2
[FIX] web_diagram: compute SVG height from viewport position
mathben Mar 27, 2026
1591c6e
[IMP] web_diagram: modernise node and edge visual style
mathben Mar 27, 2026
73c48d8
[FIX] web_diagram: guard against empty tree_list in process_order
mathben Mar 27, 2026
5cba98b
[FIX] web_diagram: expand SVG height to fit all nodes
mathben Mar 27, 2026
cbc7677
[FIX] web_diagram: fix layout for multi-root forests
mathben Mar 27, 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
31 changes: 31 additions & 0 deletions web_diagram/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.

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

""",
'version': "18.0.1.0.0",
'depends': ['web'],
'assets': {
'web.assets_backend': [
'web_diagram/static/lib/js/raphael.js',
'web_diagram/static/src/scss/diagram_view.scss',
'web_diagram/static/src/js/vec2.js',
'web_diagram/static/src/js/graph.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/xml/base_diagram.xml',
],
'web.assets_unit_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]

name = http.request.env[model].browse(id).display_name
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