[FIX] lp bug 1315445

ported from
https://code.launchpad.net/~agilebg/sale-reports/7_fix_1315445/+merge/223795