Fix wrong parent test in create_leveling

issue3246
review920002
(transplanted from 7705e9587201bdb38970df1c69d6ad3e325474a8)

--HG--
extra : transplant_source : w%05%E9Xr%01%BD%B3%89p%DF%1Ci%D6%AD%3E2Tt%A8