Перейти к содержимому
Odoo Меню
  • Войти
  • Попробовать бесплатно
  • Модули
    Финансы
    • Бухгалтерия
    • Выставление счетов
    • Расходы
    • Таблицы
    • Документооборот
    • Подпись
    Продажи
    • CRM
    • Продажи
    • POS Магазин
    • POS Ресторан
    • Подписки
    • Аренда
    Вебсайты
    • Конструктор вебсайтов
    • eCommerce
    • Блог
    • Форум
    • Онлайн-чат
    • Электронное обучение
    Логистика
    • Склад
    • Производство
    • PLM
    • Закупки
    • Обслуживание
    • Качество
    Отдел кадров
    • Сотрудники
    • Подбор персонала
    • Отпуска
    • Оценка персонала
    • Реферальная программа
    • Автопарк
    Маркетинг
    • SMM
    • E-mail рассылки
    • СМС рассылки
    • Мероприятия
    • Автоматизация маркетинга
    • Опросы
    Услуги
    • Проекты
    • Табели
    • Выездной сервис
    • Поддержка
    • Планирование
    • Встречи
    Продуктивность
    • Обсуждения
    • Искусственный интеллект
    • IoT
    • VoIP-телефония
    • Knowledge
    • WhatsApp
    Сторонние приложения Модуль Студия Odoo Платформа Odoo Cloud
  • Индустрии
    Розничная торговля
    • Книжный магазин
    • Магазин одежды
    • Мебельный магазин
    • Продуктовый магазин
    • Строительный магазин
    • Магазин игрушек
    Гостинично-ресторанный бизнес
    • Бар и паб
    • Ресторан
    • Фастфуд
    • Гостевой дом
    • Дистрибьютор напитков
    • Отель
    Недвижимость
    • Агентство недвижимости
    • Архитектурное бюро
    • Строительство
    • Управление недвижимостью
    • Ландшафтный дизайн
    • Товарищество собственников жилья
    Консалтинг
    • Бухгалтерская фирма
    • Партнер Odoo
    • Маркетинговое агентство
    • Юридическая фирма
    • Подбор персонала
    • Аудиторское бюро
    Производство
    • Текстиль
    • Металл
    • Мебель
    • Продукты питания
    • Пивоварня
    • Корпоративные сувениры
    Здоровье и фитнес
    • Спортивный комплекс
    • Магазин оптики
    • Фитнес-клуб
    • Велнес-центр
    • Аптека
    • Салон красоты
    Услуги
    • Специалист по бытовым услугам
    • Продажа и обслуживание IT-оборудования
    • Солнечные энергосистемы
    • Производство обуви
    • Клининг
    • Системы ОВКВ
    Прочее
    • Некоммерческая организация
    • Консалтинг в сфере устойчивого развития
    • Аренда рекламных щитов
    • Бизнес по фотосъемке
    • Прокат велосипедов
    • Реселлер программного обеспечения
    Все индустрии
  • Community
    Обучение
    • Видео уроки
    • Документация
    • Сертификация
    • Тренинг
    • Блог
    • Подкаст
    Образование и развитие
    • Образовательная программа
    • Деловая игра Scale Up!
    • Экскурсия в офис Odoo
    ПО
    • Скачать
    • Сравнить версии
    • Релизы
    Сотрудничество
    • Github
    • Форум
    • Мероприятия
    • Перевод
    • Стать партнером
    • Услуги для партнеров
    • Зарегистрировать бухгалтерскую фирму
    Услуги
    • Найти партнера
    • Найти бухгалтера
    • Встреча с экспертом
    • Услуги по внедрению
    • Отзывы клиентов
    • Поддержка
    • Обновления
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Заказать демонстрацию
  • Цены
  • Поддержка
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Все посты Люди Значки
Теги (Смотреть все)
odoo accounting v14 pos v15
Об этом форуме
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Все посты Люди Значки
Теги (Смотреть все)
odoo accounting v14 pos v15
Об этом форуме
Помощь

pdf_viewer widget error

Подписаться

Получайте уведомления о появлении активности в этом посте

Этот вопрос был отмечен
pdfwidget
2 Ответы
3281 Представления
Аватар
Ricky Raymond

I'm trying to use widget="pdf_viewer" on form view.


on form view under notebook --> Page section: 


field="certificate" widget="pdf_viewer"


After uploading the pdf files, it's showing content correctly. But if i'm reloading / revisit the records, it can't show the PDF content. Here's the error message :


Message: Unexpected server response (500) while retrieving PDF "http://192.168.1.1:8069/web/content?model=skills.matrix&field=certificate&id=18".

0
Аватар
Отменить
Аватар
Cybrosys Techno Solutions Pvt.Ltd
Лучший ответ
Hi,

The pdf_viewer widget expects a valid binary field that Odoo can retrieve through the /web/content route. Since the PDF displays immediately after upload but fails after reloading the record, the issue is usually related to how the file is being stored or accessed rather than the widget itself.

First, verify that your field is defined as a stored binary field:

certificate = fields.Binary(string="Certificate",attachment=True,)

It is also recommended to add a filename field and reference it in the view:

certificate_filename = fields.Char()

XML

<field name="certificate"
       widget="pdf_viewer"
       filename="certificate_filename"/>


The 500 error indicates that the /web/content endpoint is failing to retrieve the PDF, so the issue is usually related to file storage or access permissions rather than the pdf_viewer widget itself. Common causes include missing or corrupted ir.attachment records, record rules preventing access to the attachment, non-stored computed or related binary fields, custom read() or write() methods altering the field value, or missing files in the filestore after a database restore or migration. To identify the exact cause, check the Odoo server logs while opening the record or access the /web/content URL directly and review the resulting traceback. In most cases, the server logs will reveal the underlying issue.

Hope it helps

0
Аватар
Отменить
Аватар
Sandeep Paulraj R
Лучший ответ

The pdf_viewer widget itself is usually not the root cause. The key clue is the error:

Unexpected server response (500) while retrieving PDF
/web/content?model=skills.matrix&field=certificate&id=18

A 500 error means Odoo failed while serving the binary content through the /web/content route.

Things to check:

  1. Field definition

    Make sure the field is defined as a Binary field:

    certificate = fields.Binary(
        string="Certificate",
        attachment=True,
    )
    
  2. Check Odoo server logs

    When opening the record, inspect the full traceback in the Odoo log. The actual exception causing the 500 error will be there.

  3. Verify attachment access

    If attachment=True, Odoo stores the file in ir.attachment. Check whether the current user has access to:

    • The parent record (skills.matrix)

    • The related ir.attachment

    Access rule issues often cause files to load during upload but fail when reloading the record.

  4. Test without attachment storage

    Temporarily change:

    certificate = fields.Binary(
        string="Certificate",
        attachment=False,
    )
    

    If the PDF loads correctly afterward, the issue is likely related to ir.attachment access or storage.

  5. Verify the attachment record

    In Developer Mode, locate the corresponding ir.attachment and confirm:

    • res_model = skills.matrix

    • res_id = 18

    • The attachment file exists

    • The mimetype is application/pdf

  6. Custom record rules

    If there are custom security rules on either skills.matrix or ir.attachment, they may prevent /web/content from reading the file after the page reloads.

Since the PDF displays immediately after upload but fails after revisiting the record, the file is most likely being saved correctly. The issue is usually related to attachment access rights, attachment metadata, or an exception raised by /web/content when retrieving the stored file.

0
Аватар
Отменить
Не оставайтесь в стороне – присоединяйтесь к обсуждению!

Создайте аккаунт сегодня, чтобы получить доступ к эксклюзивным функциям и стать частью нашего замечательного сообщества!

Регистрация
Похожие посты Ответы Просмотры Активность
Odoo 10: widget='pdf_viewer', download option doesn't appear when the field is defined inside notebook.
pdf widget odoo10
Аватар
0
нояб. 16
8770
Odoo19 PDF Viewer widget not showing Save, download and print button Решено
pdf widget binary odoo19
Аватар
Аватар
Аватар
Аватар
3
июн. 26
805
Cotizacion con multi-moneda
pdf
Аватар
0
апр. 26
1445
『📞Teléfono→Volaris✦México 24horas』 volaris telefono mexico 24 horas
pdf
Аватар
0
апр. 26
49
Odoo Chatter Edit/Create Permissions
pdf
Аватар
0
апр. 26
8
Сообщество
  • Видео уроки
  • Документация
  • Форум
Открытый исходный код
  • Скачать
  • Github
  • Runbot
  • Перевод
Услуги
  • Хостинг Odoo.sh
  • Поддержка
  • Обновление
  • Индивидуальные решения по доработке
  • Образование
  • Найти бухгалтера
  • Найти партнера
  • Стать партнером
О нас
  • Наша компания
  • Активы бренда
  • Cвяжитесь с нами
  • Вакансии
  • Мероприятия
  • Подкаст
  • Блог
  • Клиенты
  • Правовые документы • Конфиденциальность
  • Безопасность
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk Slovenščina Español (América Latina) Español Svenska ภาษาไทย Türkçe українська Tiếng Việt

Odoo – это набор бизнес-модулей с открытым исходным кодом, который закроет все потребности вашей компании: CRM, E-commerce, Бухгалтерия, Склад, POS, управление проектами и др.

Odoo сочетает в себе простоту использования и полную интеграцию всех бизнес-процессов в одной системе.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now