Repository navigation
[18.0][FIX] report_pdf_form: print number fields equal to 0 - #1228
Open
parabol123654 wants to merge 1 commit into
Open
parabol123654 wants to merge 1 commit into
parabol123654 wants to merge 1 commit into
Conversation
The value formatter is a copy of the one of sale_pdf_quote_builder taken before odoo/odoo@8b37bbe17, so integer and float fields equal to 0 were left empty in the filled PDF form.
Contributor
|
Hi @grindtildeath, |
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.
Bug.
_get_pdf_value_from_pathis a copy of the value formatter ofsale_pdf_quote_builder. The copy predates odoo/odoo@8b37bbe17 ("[FIX] sale_pdf_quote_builder: show zero values in quotation docs", 2025-08-11). Itselif not value_: formatted_value_ = ""also catches integer and float fields equal to 0. A PDF form field mapped to such a field (a quantity, a count, a percentage) is left empty instead of showing0.Fix. Same condition as core:
elif not value_ and field_type_ not in {"integer", "float"}.Test.
test_fill_pdf_form_zero_numbermaps an integer field equal to 0 and reads the filled PDF. Without the fix it fails with'' != '0'. All 4 tests pass with the fix.