Repository navigation
[FIX] document_page: history display_name rendered as tuple - #660
Open
GMImrosell wants to merge 1 commit into
Open
GMImrosell wants to merge 1 commit into
GMImrosell wants to merge 1 commit into
Conversation
The 19.0 migration of document.page.history from name_get to _compute_display_name kept the (id, name) tuple shape, so the Char display_name is stringified as e.g. "(42, 'Test Page OCA#42')". Return the plain "<page name> #<id>" string instead, and add a regression test.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
The 19.0 migration of
document.page.historyfromname_getto_compute_display_namekept the(id, name)tuple shape:Since
display_nameis aCharfield, assigning a tuple makes the ORM stringify it, so every history record is shown as e.g.(42, 'Test Page #42')instead ofTest Page #42. Visible anywhere history versions are referenced (many2one widgets, approval e-mails, etc.).Fix
Return the plain
"<page name> #<id>"string, matching the pre-19.0name_getbehaviour, and add a regression test intest_document_page_history.Test
TestDocumentPageHistory.test_history_display_namepasses locally on a 19.0 scratch database (0 failed, 0 errors).