Repository navigation
[18.0][FIX] sql_export: allow unchecked checkbox properties - #1226
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 Execute Query wizard rejected every property whose value is falsy as missing, so a checkbox property could only be run checked: "Please enter a values for the following properties : <name>". An unchecked checkbox is a value (False): do not report it as missing. Fixes OCA#1190 (checkbox part)
Contributor
|
Hi @legalsylvain, @florian-dacosta, |
florian-dacosta
approved these changes
Oct 29, 2026
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.
Fixes the checkbox part of #1190.
Steps: create an SQL Export whose query uses a checkbox property (e.g.
SELECT name FROM res_partner WHERE active = %(Active)swith a checkbox property "Active"), validate it, click "Execute Query", leave the checkbox unchecked and click "Export".Error:
Please enter a values for the following properties : ActiveCause:
export_sqlreports every property whose value is falsy as missing (if not x["value"]), and an unchecked checkbox isFalse. So a query with a checkbox property can only be run with the box checked.Fix: do not report checkbox properties as missing:
Falseis a valid value for them.Test:
test_sql_query_with_unchecked_boolean_paramruns such an export with the checkbox unchecked and checks that an archived partner is in the result. Without the fix it fails with the error above; with the fix it passes, along with the tests ofsql_export,sql_export_mail,sql_export_deltaandsql_export_excel(13 tests on Odoo 18.0).The issue also reports that selection properties are passed to the query as the option's key instead of its label; that is a separate change and is left out of this PR. The same check is in 16.0 and 17.0; I can backport if wanted.