Skip to content

Commit

Permalink
Merge PR #2763 into 15.0
Browse files Browse the repository at this point in the history
Signed-off-by dreispt
  • Loading branch information
OCA-git-bot committed Mar 9, 2024
2 parents 6ca2644 + ddea6a9 commit a851efa
Show file tree
Hide file tree
Showing 21 changed files with 923 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Do NOT update manually; changes here will be overwritten by Copier
_commit: v1.17.2
_commit: v1.20
_src_path: gh:oca/oca-addons-repo-template
ci: GitHub
convert_readme_fragments_to_markdown: false
generate_requirements_txt: true
github_check_license: true
github_ci_extra_env: {}
Expand All @@ -19,4 +20,6 @@ repo_description: 'TODO: add repo description.'
repo_name: web
repo_slug: web
repo_website: https://github.com/OCA/web
use_pyproject_toml: false
use_ruff: false

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ __pycache__/
*.py[cod]
/.venv
/.pytest_cache
/.ruff_cache

# C extensions
*.so
Expand Down
5 changes: 4 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ exclude: |
^docs/_templates/.*\.html$|
# Don't bother non-technical authors with formatting issues in docs
readme/.*\.(rst|md)$|
# Ignore build and dist directories in addons
/build/|/dist/|
# You don't usually want a bot to modify your legal texts
(LICENSE.*|COPYING.*)
default_language_version:
Expand All @@ -35,7 +37,7 @@ repos:
language: fail
files: '[a-zA-Z0-9_]*/i18n/en\.po$'
- repo: https://github.com/oca/maintainer-tools
rev: 969238e47c07d0c40573acff81d170f63245d738
rev: 9a170331575a265c092ee6b24b845ec508e8ef75
hooks:
# update the NOT INSTALLABLE ADDONS section above
- id: oca-update-pre-commit-excluded-addons
Expand All @@ -48,6 +50,7 @@ repos:
- --org-name=OCA
- --repo-name=web
- --if-source-changed
- --keep-source-digest
- repo: https://github.com/OCA/odoo-pre-commit-hooks
rev: v0.0.25
hooks:
Expand Down
1 change: 1 addition & 0 deletions setup/web_widget_mermaid/odoo/addons/web_widget_mermaid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
..\\..\\..\\..\\web_widget_mermaid
6 changes: 6 additions & 0 deletions setup/web_widget_mermaid/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
113 changes: 113 additions & 0 deletions web_widget_mermaid/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
========================
Mermaid flowchart widget
========================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:136879c1f5cb11ecd5f2466b0b12748e10fa17e1a95bd0bc9296316444760a86
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github
:target: https://github.com/OCA/web/tree/15.0/web_widget_mermaid
:alt: OCA/web
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/web-15-0/web-15-0-web_widget_mermaid
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/web&target_branch=15.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module adds a basic widget for rendering text fields as flowcharts using
`mermaid <https://mermaidjs.github.io>`_.

**Table of contents**

.. contents::
:local:

Usage
=====

Put a ``widget="mermaid"`` attribute in relevant field tags in the view
declaration::

<field name="flowchart" widget="mermaid"/>

Optionally, use an ``options`` attribute to pass a JSON object with
`mermaid configuration <https://mermaidjs.github.io/#/mermaidAPI?id=configuration>`_::

<field name="flowchart"
widget="mermaid"
options='{"theme": "forest", "gantt": {"fontSize": 14}}'/>

The syntax for creating diagrams is described in
`mermaid's documentation <https://mermaidjs.github.io/#/flowchart>`_.

As an example, this text::

graph LR
10.0 --> 11.0
11.0 --> 12.0
12.0 -.-> 13.0

Produces this flowchart:

.. image:: https://raw.githubusercontent.com/OCA/web/15.0/web_widget_mermaid/static/description/flowchart_example.png
:alt: Flowchart

Demonstration
=============

In demo mode, the addon adds a flowchart field to users so you can try it. This shows up in Runbot instances.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/web/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/web/issues/new?body=module:%20web_widget_mermaid%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
~~~~~~~

* Therp BV

Contributors
~~~~~~~~~~~~

* Jan Verbeek <[email protected]>
* RoboHeart <[email protected]>

Maintainers
~~~~~~~~~~~

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/web <https://github.com/OCA/web/tree/15.0/web_widget_mermaid>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions web_widget_mermaid/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html)
22 changes: 22 additions & 0 deletions web_widget_mermaid/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright 2019 Therp BV <https://therp.nl>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html)

{
"name": "Mermaid flowchart widget",
"category": "Web",
"author": "Therp BV,Odoo Community Association (OCA)",
"version": "15.0.1.0.0",
"license": "AGPL-3",
"summary": "Render mermaid markdown flowcharts",
"website": "https://github.com/OCA/web",
"depends": ["web"],
"demo": [
"demo/res_users_flowchart.xml",
],
"assets": {
"web.assets_common": [
"https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js",
"web_widget_mermaid/static/src/js/web_widget_mermaid.js",
],
},
}
25 changes: 25 additions & 0 deletions web_widget_mermaid/demo/res_users_flowchart.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="res_users_flowchart" model="ir.model.fields">
<field name="name">x_flowchart</field>
<field name="model_id" ref="base.model_res_users" />
<field name="field_description">Demo mermaid flowchart</field>
<field name="ttype">char</field>
</record>
<record id="view_users_form_flowchart" model="ir.ui.view">
<field name="inherit_id" ref="base.view_users_form" />
<field name="model">res.users</field>
<field name="arch" type="xml">
<xpath expr="//notebook" position="inside">
<page name="mermaid_page" string="Mermaid flowchart">
<field name="x_flowchart" widget="mermaid" />
</page>
</xpath>
</field>
</record>
<record id="base.user_demo" model="res.users">
<field name="x_flowchart">graph TD
A[This is an example flowchart] --> B{{Edit it}}
B -. save it .-> C(See what happens)</field>
</record>
</odoo>
27 changes: 27 additions & 0 deletions web_widget_mermaid/i18n/ca.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * web_widget_mermaid
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2021-02-17 13:45+0000\n"
"Last-Translator: claudiagn <[email protected]>\n"
"Language-Team: none\n"
"Language: ca\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"
"X-Generator: Weblate 4.3.2\n"

#. module: web_widget_mermaid
#: model:ir.model.fields,field_description:web_widget_mermaid.res_users_flowchart
msgid "Demo mermaid flowchart"
msgstr "Diagrama de flux de sirena de demostració"

#. module: web_widget_mermaid
#: model_terms:ir.ui.view,arch_db:web_widget_mermaid.view_users_form_flowchart
msgid "Mermaid flowchart"
msgstr "Diagrama de flux de sirena"
27 changes: 27 additions & 0 deletions web_widget_mermaid/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * web_widget_mermaid
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2020-09-16 14:00+0000\n"
"Last-Translator: claudiagn <[email protected]>\n"
"Language-Team: none\n"
"Language: es\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"
"X-Generator: Weblate 3.10\n"

#. module: web_widget_mermaid
#: model:ir.model.fields,field_description:web_widget_mermaid.res_users_flowchart
msgid "Demo mermaid flowchart"
msgstr "Diagrama de flujo de sirena de demostración"

#. module: web_widget_mermaid
#: model_terms:ir.ui.view,arch_db:web_widget_mermaid.view_users_form_flowchart
msgid "Mermaid flowchart"
msgstr "Diagrama de flujo de sirena"
27 changes: 27 additions & 0 deletions web_widget_mermaid/i18n/fr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * web_widget_mermaid
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2021-02-01 12:44+0000\n"
"Last-Translator: Yann Papouin <[email protected]>\n"
"Language-Team: none\n"
"Language: fr\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"
"X-Generator: Weblate 4.3.2\n"

#. module: web_widget_mermaid
#: model:ir.model.fields,field_description:web_widget_mermaid.res_users_flowchart
msgid "Demo mermaid flowchart"
msgstr "Organigramme de démonstration Mermaid"

#. module: web_widget_mermaid
#: model_terms:ir.ui.view,arch_db:web_widget_mermaid.view_users_form_flowchart
msgid "Mermaid flowchart"
msgstr "Organigramme Mermaid"
27 changes: 27 additions & 0 deletions web_widget_mermaid/i18n/pt_BR.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * web_widget_mermaid
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2021-03-15 06:45+0000\n"
"Last-Translator: Marcel Savegnago <[email protected]>\n"
"Language-Team: none\n"
"Language: pt_BR\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"
"X-Generator: Weblate 4.3.2\n"

#. module: web_widget_mermaid
#: model:ir.model.fields,field_description:web_widget_mermaid.res_users_flowchart
msgid "Demo mermaid flowchart"
msgstr "Fluxograma de demonstração do mermaid"

#. module: web_widget_mermaid
#: model_terms:ir.ui.view,arch_db:web_widget_mermaid.view_users_form_flowchart
msgid "Mermaid flowchart"
msgstr "Fluxograma Mermaid"
25 changes: 25 additions & 0 deletions web_widget_mermaid/i18n/web_widget_mermaid.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * web_widget_mermaid
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: web_widget_mermaid
#: model:ir.model.fields,field_description:web_widget_mermaid.res_users_flowchart
msgid "Demo mermaid flowchart"
msgstr ""

#. module: web_widget_mermaid
#: model_terms:ir.ui.view,arch_db:web_widget_mermaid.view_users_form_flowchart
msgid "Mermaid flowchart"
msgstr ""

2 changes: 2 additions & 0 deletions web_widget_mermaid/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* Jan Verbeek <[email protected]>
* RoboHeart <[email protected]>
2 changes: 2 additions & 0 deletions web_widget_mermaid/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This module adds a basic widget for rendering text fields as flowcharts using
`mermaid <https://mermaidjs.github.io>`_.
Loading

0 comments on commit a851efa

Please sign in to comment.