check module gotenberg installed

This commit is contained in:
Vitaly D 2021-12-06 11:34:00 +05:00
parent ca21f97af7
commit 6aa28edbd8

View File

@ -19,11 +19,12 @@ try:
from odoo.addons.gotenberg.service.utils import ( from odoo.addons.gotenberg.service.utils import (
get_auth, # noqa get_auth, # noqa
convert_pdf_from_office_url, # noqa convert_pdf_from_office_url, # noqa
check_gotenberg_installed, # noqa
) )
gotenberg_installed = True gotenberg_imported = True
except ImportError: except ImportError:
gotenberg_installed = False gotenberg_imported = False
_logger = getLogger(__name__) _logger = getLogger(__name__)
@ -124,7 +125,7 @@ class IrActionsReport(models.Model):
docx_content = self._render_docx(res_ids, data=data) docx_content = self._render_docx(res_ids, data=data)
pdf_content = ( pdf_content = (
self._get_pdf_from_office(docx_content) if gotenberg_installed else None self._get_pdf_from_office(docx_content) if check_gotenberg_installed() else None
) )
if not pdf_content: if not pdf_content: