From 089acfa5e3efdd5d37c67d97f77da9d39b39916f Mon Sep 17 00:00:00 2001 From: "AzureAD\\SylvainDUVERNAY" Date: Sat, 30 May 2026 13:28:17 +0200 Subject: [PATCH] Render Tradon processes in iframe viewer --- ir/ui/form.rng | 1 + .../purchase_trade/process_documentation.py | 63 ++++++++++++++++--- .../view/process_documentation_form.xml | 2 +- 3 files changed, 58 insertions(+), 8 deletions(-) diff --git a/ir/ui/form.rng b/ir/ui/form.rng index aca91af..8e0c3da 100755 --- a/ir/ui/form.rng +++ b/ir/ui/form.rng @@ -233,6 +233,7 @@ email float html + html_viewer image integer many2many diff --git a/modules/purchase_trade/process_documentation.py b/modules/purchase_trade/process_documentation.py index 77c9814..87b39cf 100644 --- a/modules/purchase_trade/process_documentation.py +++ b/modules/purchase_trade/process_documentation.py @@ -31,9 +31,12 @@ class ProcessDocumentation(ModelSingleton, ModelSQL, ModelView): def _html_content(): - return HTML_TEMPLATE % { - 'content': _documentation_content(), - } + document = HTML_TEMPLATE % { + 'content': _documentation_content(), + } + return IFRAME_TEMPLATE % { + 'document': html.escape(document, quote=True), + } def _documentation_content(): @@ -191,8 +194,54 @@ def _render_table(lines, current_file): return ''.join(output) -HTML_TEMPLATE = '''
- %(content)s -
+IFRAME_TEMPLATE = ''' +''' + + +HTML_TEMPLATE = ''' + + + + + + +
%(content)s
+ + ''' diff --git a/modules/purchase_trade/view/process_documentation_form.xml b/modules/purchase_trade/view/process_documentation_form.xml index 30d1980..d29dc2e 100644 --- a/modules/purchase_trade/view/process_documentation_form.xml +++ b/modules/purchase_trade/view/process_documentation_form.xml @@ -1,5 +1,5 @@
- +