# Sale prints to PDF, but not Invoice

**URL:** <https://discuss.tryton.org/t/sale-prints-to-pdf-but-not-invoice/6809>\
**Category:** User\
**Created:** [December 20, 2023, 4:52pm UTC](https://discuss.tryton.org/t/sale-prints-to-pdf-but-not-invoice/6809 "2023-12-20T16:52:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dalers](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/dalers/32/1767_2.png) [@dalers](https://discuss.tryton.org/u/dalers)\
**Post date:** [December 20, 2023, 4:52pm UTC](https://discuss.tryton.org/t/sale-prints-to-pdf-but-not-invoice/6809/1 "2023-12-20T16:52:31Z")

</div>

This is a continuation of [Print to PDF instead of ODT](https://discuss.tryton.org/t/print-to-pdf-instead-of-odt/6799)

Following @lars_wuerfel and @2cadz directions to configure the report actions for a Sale, printing now produces a PDF instead of an ODT. However, when I repeated the same procedure for an Invoice, an ODT is still generated instead of a PDF.

I believe I configured the Invoice in exactly the same way, can anyone point out what is going wrong? Do I have the wrong “invoice”?

TIA for your help.

**Report Action Config for Sale and Invoice**

 ![2023-12-20 09_44_28 Admin - UI - Actions - Reports - Sale](https://discuss-cdn.tryton.org/uploads/default/original/2X/0/0feaceeffb86e627f4f0992f3144311a6ecea845.png)

 ![2023-12-20 09_45_54 Admin - UI - Actions - Reports - Invoice](https://discuss-cdn.tryton.org/uploads/default/original/2X/0/0a2b520ce86c8baf6974e637674e260a9406453e.png)

**Print Sale and Invoice**

 ![2023-12-20 09_46_40 Sale - legend](https://discuss-cdn.tryton.org/uploads/default/original/2X/c/c9b0e7b3664d0dc216db0b459208282eabb2744b.png)

 ![2023-12-20 09_47_58 Invoice - legend](https://discuss-cdn.tryton.org/uploads/default/original/2X/c/c44d51915b4ee971a53ad25ff679c2a6fde48530.png)

---

<div class="post-metadata">

**Author:** ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)\
**Post date:** [December 20, 2023, 5:18pm UTC](https://discuss.tryton.org/t/sale-prints-to-pdf-but-not-invoice/6809/2 "2023-12-20T17:18:39Z")

</div>

Report for posted invoice is archived when posting so it is always the same document that is returned no matter how the configuration is changed after.

---

<div class="post-metadata">

**Author:** ![edbo](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/e/f14d63/32.png) [@edbo](https://discuss.tryton.org/u/edbo)\
**Post date:** [December 20, 2023, 6:07pm UTC](https://discuss.tryton.org/t/sale-prints-to-pdf-but-not-invoice/6809/3 "2023-12-20T18:07:47Z")

</div>

What @ced said, when you print an invoice which is not in state `draft` it will be cached. So every time you print that same invoice, the data is taken from cache and this cache is persistent so a restart of Tryton doesn’t help.

You _can_ remove the cache by login into the database by hand and setting the column `invoice_report_cache` in the `account_invoice` table to `Null` and if that’s not working also the `invoice_report_cache_id` to `Null`. After that it should print a PDF.

I thought there is an issue somewhere which added this possibility to the `admin` user in Tryton to override the cache.

---

<div class="post-metadata">

**Author:** ![dalers](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/dalers/32/1767_2.png) [@dalers](https://discuss.tryton.org/u/dalers)\
**Post date:** [December 21, 2023, 5:24am UTC](https://discuss.tryton.org/t/sale-prints-to-pdf-but-not-invoice/6809/4 "2023-12-21T05:24:54Z")

</div>

> [@edbo](#):
>
> setting the column `invoice_report_cache` in the `account_invoice` table to `Null`

Thanks @ced and @edbo. Fwiw this was sufficient (and the invoice\_report\_cache\_id was Null already). My SQL is a little shaky, so I asked MS Copilot to write an SQL query for your instructions. This AI stuff is amazing! (but I still created a backup of the db first).

---

<div class="post-metadata">

**Author:** ![system](https://discuss-cdn.tryton.org/uploads/default/original/1X/c6f8ec0a40525cdcd50058c734283450a4b3d38b.png) [@system](https://discuss.tryton.org/u/system)\
**Post date:** [January 20, 2024, 5:25am UTC](https://discuss.tryton.org/t/sale-prints-to-pdf-but-not-invoice/6809/5 "2024-01-20T05:25:38Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
