Skip to Content
Menu
v 10.0 Third Party 91
Download for v 10.0 Deploy on Odoo.sh
Availability
Odoo Online
Odoo.sh
On Premise
Technical Name web_diff2html
LicenseLGPL-3
Websitehttps://github.com/andriusl/
You bought this module and need support? Click here!

Diff To HTML

Converts diff output of a field value to prettified HTML. (e.g. as seen on github, bitbucket etc.).

This module uses diff2html as a base library to generate HTML diff.

Usage:

  • Field must be of HTML type.
  • Set widget="diff2html" on field where it is defined in a form view.
  • You can provide optional configuration from XML view (on field). For example:
<field name="diff"
       widget="diff2html" data-diff2html="{'options': {'inputFormat': 'diff', 'showFiles': true}, 'extra': {'highlightCode': true, 'fileListCloseable': true, 'fileListCloseableDefault': true}}"/>
  • There are two config parts: options and extra. For all options and what they do, look here. For extra part, there are currently two implementations: highlightCode and fileListCloseable (with optional key fileListCloseableDefault to specify if files are hidden or showed on default.). If you need some additional effect on HTML output that diff2html library provides, then you need to extend function apply_extra.

This a sample diff2html implementation in Odoo using this widget:

Diff Sample

Contributors

  • Andrius Laukavičius

Please log in to comment on this module

  • The author can leave a single reply to each comment.
  • This section is meant to ask simple questions or leave a rating. Every report of a problem experienced while using the module should be addressed to the author directly (refer to the following point).
  • If you want to start a discussion with the author, please use the developer contact information. They can usually be found in the description.
Please choose a rating from 1 to 5 for this module.