Steps to reproduce: ------------------- - create an invoice without confirm it; - go to the preview and download it; Issue: ------ A traceback appears. Cause: ------ We try to get `ids` field of a non "record" object. Solution: --------- Make sure you are in the case of an invoice that is `posted` to download a pdf. sentry-4612532780 closes odoo/odoo#141640 Signed-off-by: Laurent Smet (las) <las@odoo.com> Co-authored-by: adwid <awt@odoo.com>