-
-
Notifications
You must be signed in to change notification settings - Fork 377
[18.0][IMP] document_page: Use odoo standard diff tool for showing the real difference #563
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
And what happens with HTML? |
|
The proble with diff made with HTML is that is usually less clear to final users. It includes a lot of changes, that are not clear for them. Markdown is clear for them. In any case, with the current change, the mardown difference is only accessible if you have defined it (we could even do a parameter for this in order to make it cleaner and keep HTML by default). |
|
Yeah, what I mean is that right now, there's no HTML diff, but plain text over HTML code diff, so what I'm talking about is to render the HTML and the marks of diff. |
|
I am not sure if that is factible... for example Github is not doing that with html files It shows the diff of lines. |
|
Well, but that's because it's mostly code, but here we have documentation in rich text format, so I think it's a different beast, and we should provide proper tools for it. |
luisDIXMIT
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally and LGTM!
|
@pedrobaeza There is something like: https://pypi.org/project/html-diff/. What do you think? |
|
Yeah, it seems interesting. |
|
@pedrobaeza Something like this?
|
|
Yeah, it looks great!! |
3a42978 to
060f8d3
Compare
233255d to
e920170
Compare
LoisRForgeFlow
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!! for sure is better than it is now... I got very used to ignore the diff because it was unusable...
e920170 to
c01b26c
Compare
luisDIXMIT
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Retested locally after recent changes and it works fine. Good job!
luisDIXMIT
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I detected something weird. After deleting one line, the whole document is crossed out and detected as new.
Grabacion.de.pantalla.desde.2025-12-17.08-11-43.mp4
|
@luisDIXMIT I found the same at some point, but I think this is a consequence of the import of the demo data. Can you try with a document created by you directly? |
I created a new test document with one line. After saving it, I added another line, and this is how it was detected:
|
f5f8494 to
7e86662
Compare
|
I found the problem and a much better solution. Odoo provides a diff method, so we can do everything without external libraries. |
7e86662 to
92775bd
Compare
|
I think it is much cleaner now:
@pedrobaeza WDYT? It can be ported automatically to v17, but on 16 we might need to add some code from odoo on it |
|
This PR has the |
luisDIXMIT
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested with the latest changes and LGTM!
pedrobaeza
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the great improvement.
/ocabot merge minor
|
What a great day to merge this nice PR. Let's do it! |
|
Congratulations, your PR was merged at 6305191. Thanks a lot for contributing to OCA. ❤️ |



Shows differences by markdown: