Hi
I have a pice of code what I use to get a PDF byte string which is created when I try to generate a PDF Document from 'account_move' module.
But the problem is that PDF file is empty. I take only metadata of the file.
```
import base64
import datetime
import os
import threading
from dotenv import load_dotenv
from odoo.http import request
from odoo.tools.config import config
from odoo.tools import pdf
from telebot import apihelper, types
from odoo import SUPERUSER_ID, api, fields, http, models, sql_db, _
from . import bot_controller
class AccountMove(models.Model):
_inherit = 'account.move'
automatic_send = fields.Char(compute='auto_send_invoice')
pdf_file = fields.Binary(string="PDF File", readonly=True)
@api.constrains('state')
def auto_send_invoice(self, ):
if self.state == 'posted' and self.move_type == 'out_invoice' and : self.env['ir.actions.report']._get_report_from_name('telegram_bot_module.report_tg')
pdf_content = report._render_qweb_pdf(report.id)
invoice_name = f"invoice_{self.id}.pdf"
with open('invoice_from_action.pdf', 'wb') as file:
file.write((pdf_file[0]))rning(f"PDF content: {(report)}")
```