Patch is available from upstream, see https://bugs.gnucash.org/show_bug.cgi?id=799262
Created attachment 895564 [details, diff] The upstream's patch