Перейти к содержимому
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 is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Бухгалтерия
  • Склад
  • PoS
  • Проекты
  • MRP
All apps
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Все посты Люди Значки
Теги (Смотреть все)
odoo accounting v14 pos v15
Об этом форуме
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Все посты Люди Значки
Теги (Смотреть все)
odoo accounting v14 pos v15
Об этом форуме
Помощь

There is an issue with the Odoo 16 PDF report where the content of a table row is moving to the next page.

Подписаться

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

Этот вопрос был отмечен
qwebpdfreportodoov16
1 Ответить
2710 Представления
Аватар
Mathesh

In Odoo 16, inside a table, if the content of a row is too long and doesn't fit on the first page, the entire row moves to the next page. However, when the content is too long for the second page as well, the row gets split, with part of the content appearing on the first page and the rest on the second page. I want it to behave differently: if the content doesn't fit on the first page, it should be split at that point, rather than moving the entire row to the next page. as mentioned below.


  1. doesn't fit to the first page:

  2. when doesn't fit to the second page also:


Thanks,

0
Аватар
Отменить
Аватар
Dmitriy Stepanov
Лучший ответ

Hello,

The issue where table rows in Odoo PDF reports split or move to the next page is commonly related to the limitations of the PDF rendering library used in Odoo, typically wkhtmltopdf. To resolve this issue in Odoo 16 where rows in a table get split across pages, you will need to modify the way Odoo handles table row breaks when generating reports. By default, Odoo handles row content in a way that tries to keep the row together, but in cases where the content is too long, it can split the row. You can adjust the behavior by modifying the report template or the QWeb report styles.

Here's how you can address this issue:

1. Override the QWeb Template:

You will need to update the report template for your specific report, particularly if you are dealing with tables inside a report like invoices, sales orders, or custom reports.

Find the QWeb template associated with the report (usually in views/report_*).

If the issue is with a table row not splitting, add a page-break-inside: auto; CSS property to the row (<tr>) or a surrounding block element.

2. Modify the CSS for the Table Rows:

Modify the CSS to prevent the table row from staying together. You can use the page-break-inside CSS property. By default, Odoo might have this set to avoid, which means the row tries to avoid splitting and moves to the next page entirely if it doesn't fit. You will want to change this to auto so that the row can be split.

Here's an example of how to modify the page-break-inside CSS for the row:

table {

width: 100%;

border-collapse: collapse;

}

tr {

page-break-inside: auto; /* Allows row content to be split across pages */

}

td, th {

padding: 5px;

border: 1px solid #ddd;

}

This CSS will ensure that the row can be split if the content is too large to fit on the page.

3. Add a page-break-after or page-break-before for Specific Rows:

If you want to have more control over when a row is forced onto a new page (for example, for very long content), you can use page-break-after or page-break-before properties on specific rows.

Example:

.long-content-row {

page-break-after: always; /* Forces the row to start on the next page */

}

Apply this class to the specific row that needs to break and be on the next page.

4. Update the Report's style Block:

If the report's template does not have a CSS style block, you can add one to the QWeb report definition. If you're using a custom report, you can include the style block in your template:

<t t-name="your_module.report_template">

<style>

tr {

page-break-inside: auto; /* Allows row splitting */

}

.long-content-row {

page-break-after: always; /* Force next row to be on the next page */

}

</style>

<table>

<tr>

<td>Content</td>

</tr>

</table>

</t>

5. Test and Refine the Output:

After modifying the CSS and template, generate a report and test the layout. You should see that if the content is too long to fit on the first page, it will now split at the point where necessary, instead of moving the entire row to the next page. If there are any issues with content overlapping or not being split as expected, you may need to adjust the styles further.

Another approach:

1. Optimize wkhtmltopdf Settings

If you have control over wkhtmltopdf options, try enabling --disable-smart-shrinking or modifying other parameters to improve rendering.

Update the report.paperformat in Odoo to include these options:

Navigate to Settings > Technical > Reports > Paper Formats.

In the "Custom Paper Format" options, add or modify the "Custom Options" field with:

--disable-smart-shrinking

2. Consider Upgrading wkhtmltopdf

Ensure that you are using a stable and updated version of wkhtmltopdf. Some older versions have rendering issues with complex table layouts.

Recommended version: 0.12.6 or higher (as of recent stable releases).

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

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

Регистрация
Похожие посты Ответы Просмотры Активность
Avoid Page break inside table due to long content
qweb pagebreak long-content pdfreport
Аватар
0
сент. 25
3847
Generate Delivery Report Separately One Click from Sale Order
qweb qweb-report PDF pdfreport
Аватар
Аватар
1
февр. 22
2947
Odoo 18: Display image from char field containing url in qweb form
qweb
Аватар
Аватар
1
июл. 25
2949
PDF Export Option for QWeb Reports in odoo 17.0
qweb
Аватар
Аватар
1
мая 25
3706
QWeb: use t-if to check birthday date Решено
qweb
Аватар
Аватар
1
апр. 25
3222
Сообщество
  • Видео уроки
  • Документация
  • Форум
Открытый исходный код
  • Скачать
  • 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 ภาษาไทย 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