Перейти к содержимому
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
Об этом форуме
Помощь

Customize Report problem

Подписаться

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

Этот вопрос был отмечен
pdf
3 Ответы
1591 Представления
Аватар
Jitesh Jeram

Hi,

I have inserted new columns into the pdf quote

  • Now two of the other coloumns are not printing correctly.
  • I also need to get the numbers all looking the same, besides the discount column.

https://ibb.co/C5kcZGMK


Current Code:

<data>

  <data>

    <xpath position="inside" expr="/t[@t-name='sale.report_saleorder_document_copy_1']//t[@t-call='web.external_layout']/div/div" meta-class="oe_structure">

      <br/>

    </xpath>

  </data>

  <data>

    <xpath position="inside" expr="/t[@t-name='sale.report_saleorder_document_copy_1']//t[@t-call='web.external_layout']/div/div[3]" meta-class="oe_structure">

      <br/>

    </xpath>

  </data>

  <data>

    <xpath position="replace" expr="/t[@t-name='sale.report_saleorder_document_copy_1']//t[@t-call='web.external_layout']/div/table/thead/tr/th[@name='th_taxes']" meta-name="th_taxes" meta-class="text-end"/>

    <xpath position="after" expr="/t[@t-name='sale.report_saleorder_document_copy_1']//t[@t-call='web.external_layout']/div/table/thead/tr/th[@name='th_discount']" meta-name="th_discount" meta-t-if="display_discount" meta-class="text-end">

      <th class="text-center"> Price Excl

      </th>

      <th name="th_taxes" class="text-center">VAT</th>

    </xpath>

  </data>

  <data>

    <xpath position="replace" expr="/t[@t-name='sale.report_saleorder_document_copy_1']//t[@t-call='web.external_layout']//th[@name='th_quantity']" meta-name="th_quantity" meta-class="text-end">

      <th name="th_quantity" class="text-end" style="text-align: center;">Qty</th>

    </xpath>

  </data>

  <data>

    <xpath position="replace" expr="/t[@t-name='sale.report_saleorder_document_copy_1']//t[@t-call='web.external_layout']//th[@name='th_subtotal']/span"/>

    <xpath position="inside" expr="/t[@t-name='sale.report_saleorder_document_copy_1']//t[@t-call='web.external_layout']//th[@name='th_subtotal']" meta-name="th_subtotal" meta-class="text-end">

      <span class="text-center">Price Incl</span>

      <br/>

    </xpath>

  </data>

  <data>

    <xpath position="replace" expr="/t[@t-name='sale.report_saleorder_document_copy_1']//t[@t-call='web.external_layout']/div/table/tbody/t[2]/tr/t/td[@name='td_quantity']" meta-name="td_quantity" meta-class="text-end text-nowrap"/>

    <xpath position="after" expr="/t[@t-name='sale.report_saleorder_document_copy_1']//t[@t-call='web.external_layout']/div/table/tbody/t[2]/tr/t/td[@name='td_name']" meta-name="td_name">

      <td name="td_quantity" class="text-center">

        <p>

          <span t-field="line.product_uom_qty"/>

        </p>

        <xpath position="after" expr="/t[@t-name='sale.report_saleorder_document_copy_1']//t[@t-call='web.external_layout']/div/table/tbody/t[2]/tr/t/td[@name='td_quantity'][2]/span[3]" meta-t-if="line.product_uom_id != line.product_id.uom_id" meta-class="text-center"/>

      </td>

    </xpath>

    <xpath position="after" expr="/t[@t-name='sale.report_saleorder_document_copy_1']//t[@t-call='web.external_layout']/div/table/tbody/t[2]/tr/t/td[@name='td_discount']" meta-name="td_discount" meta-t-if="display_discount" meta-class="text-center">

      <td>

        <p>

          <span t-field="line.price_reduce_taxexcl"/>

        </p>

      </td>

    </xpath>

  </data>

  <data>

    <xpath position="replace" expr="/t[@t-name='sale.report_saleorder_document_copy_1']//t[@t-call='web.external_layout']//td[@name='td_priceunit']/span[@t-field='line.price_unit']" meta-t-field="line.price_unit"/>

    <xpath position="inside" expr="/t[@t-name='sale.report_saleorder_document_copy_1']//t[@t-call='web.external_layout']//td[@name='td_priceunit']" meta-name="td_priceunit" meta-class="text-end ">

      <p><span class="text-end" t-field="line.price_unit"/></p>

    </xpath>

  </data>

  <data>

    <xpath position="replace" expr="/t[@t-name='sale.report_saleorder_document_copy_1']//t[@t-call='web.external_layout']//td[@name='td_taxes']/span" meta-t-out="taxes"/>

    <xpath position="inside" expr="/t[@t-name='sale.report_saleorder_document_copy_1']//t[@t-call='web.external_layout']//td[@name='td_taxes']" meta-name="td_taxes" meta-t-attf-class="text-center {{ 'text-nowrap' if len(taxes) &lt; 10 else '' }}">

      <p t-out="taxes">Tax 15%</p>

      <p class="text-end"><span t-field="line.price_tax"/></p>

    </xpath>

  </data>

  <data>

    <xpath position="attributes" expr="/t[@t-name='sale.report_saleorder_document_copy_1']//t[@t-call='web.external_layout']//td[@name='td_section_line']" meta-name="td_section_line" meta-colspan="99">

      <attribute name="colspan">100</attribute>

    </xpath>

  </data>

  <data>

    <xpath position="attributes" expr="/t[@t-name='sale.report_saleorder_document_copy_1']//t[@t-call='web.external_layout']//td[@name='td_note_line']" meta-name="td_note_line" meta-colspan="99">

      <attribute name="colspan">100</attribute>

    </xpath>

  </data>

  <data>

    <xpath position="attributes" expr="/t[@t-name='sale.report_saleorder_document_copy_1']//t[@t-call='web.external_layout']//td[@name='td_section_subtotal']" meta-name="td_section_subtotal" meta-colspan="99">

      <attribute name="colspan">100</attribute>

    </xpath>

  </data>

  <data>

    <xpath position="inside" expr="/t[@t-name='sale.report_saleorder_document_copy_1']//t[@t-call='web.external_layout']/div/div[5]" meta-class="oe_structure">

      <br/>

    </xpath>

  </data>

  <data>

    <xpath position="inside" expr="/t[@t-name='sale.report_saleorder_document_copy_1']//t[@t-call='web.external_layout']/div/div[9]/div" meta-class="oe_structure">

      <br/>

    </xpath>

  </data>

  <data>

    <xpath position="inside" expr="/t[@t-name='sale.report_saleorder_document_copy_1']//t[@t-call='web.external_layout']/div/div[10]/div" meta-class="oe_structure">

      <br/>

    </xpath>

  </data>

  <data>

    <xpath position="inside" expr="/t[@t-name='sale.report_saleorder_document_copy_1']//t[@t-call='web.external_layout']/div/div[11]" meta-class="oe_structure">

      <br/>

    </xpath>

  </data>

</data>

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

Hi,


* Use text-center, text-end, or utility classes like col-x (width) to align content.

        <th class="text-center col-2">Price Excl</th>


* To render numeric expressions cleanly and consistently, replace t-field or t-out with:

           <span t-esc="line.price_unit * (1 - (line.discount or 0.0) / 100.0)" />


* Define Column Widths and Avoid Replacing Incorrect Nodes.

- Rather than replacing generic tags, target the correct sale order report template:

              - Inherit from sale.report_saleorder_document (not its copy).

              - Modify existing <th name="th_quantity">, <td name="td_priceunit">, etc.


Try the following code.


<odoo>

  <template id="report_saleorder_document_custom" inherit_id="sale.report_saleorder_document">


    <!-- Modify Table Headers -->

    <xpath expr="//thead/tr/th[@name='th_discount']" position="after">

      <th class="text-end" name="th_price_excl">Price Excl</th>

      <th class="text-end" name="th_tax">VAT</th>

    </xpath>


    <!-- Quantity Column -->

    <xpath expr="//th[@name='th_quantity']" position="attributes">

      <attribute name="class">text-end</attribute>

    </xpath>

    <xpath expr="//td[@name='td_quantity']" position="attributes">

      <attribute name="class">text-end</attribute>

    </xpath>


    <!-- Modify Table Data Rows: Add Price Excl and Tax -->

    <xpath expr="//td[@name='td_discount']" position="after">

      <td class="text-end" name="td_price_excl">

        <span t-esc="line.price_reduce_taxexcl"/>

      </td>

      <td class="text-end" name="td_tax">

        <span t-field="line.price_tax"/>

      </td>

    </xpath>


    <!-- Format Price Unit -->

    <xpath expr="//td[@name='td_priceunit']" position="replace">

      <td class="text-end" name="td_priceunit">

        <span t-esc="line.price_unit"/>

      </td>

    </xpath>


    <!-- Optional: Format subtotal for consistency -->

    <xpath expr="//td[@name='td_subtotal']" position="replace">

      <td class="text-end" name="td_subtotal">

        <span t-esc="line.price_total"/>

      </td>

    </xpath>


  </template>

</odoo>


* Ensure that the inherited template is correct.



Hope it helps.

1
Аватар
Отменить
Jitesh Jeram
Автор

Thank you so much. This helped with the spacing.

https://ibb.co/JY687qw

How can I
- format the "Unit Price" & "Vat" (not the percentage) values to all look like the "Price Excl" value
- Calculate the discount amount and show it (similar to the "VAT" coloumn)
- Change the "Qty" to integer

Аватар
Jitesh Jeram
Автор Лучший ответ

I also want to adjust the heading

https://ibb.co/5g7MRrBk

I want to move the red section to under the "Quotation" heading to the right of the customer details.

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

Hi,

Adds Price Excl and VAT columns after Discount

Ensures column counts between <thead> and <tbody> match

Formats all prices and numbers consistently using t-field

Aligns all numeric columns to the right with text-end

Avoids duplicated fields or broken nesting

please try this code 
<odoo>

    <data>


        <!-- HEADER: Add new columns after 'Discount' -->

        <xpath expr="//thead/tr/th[@name='th_discount']" position="after">

            <th class="text-end">Price Excl</th>

            <th class="text-end">VAT</th>

        </xpath>


        <!-- LINE ITEMS: Add matching <td> for new columns -->

        <xpath expr="//tbody//td[@name='td_discount']" position="after">

            <td class="text-end">

                <span t-field="line.price_reduce_taxexcl"/>

            </td>

            <td class="text-end">

                <span t-field="line.price_tax"/>

            </td>

        </xpath>


        <!-- QUANTITY COLUMN: Center align -->

        <xpath expr="//th[@name='th_quantity']" position="replace">

            <th name="th_quantity" class="text-center">Qty</th>

        </xpath>


        <xpath expr="//td[@name='td_quantity']" position="replace">

            <td name="td_quantity" class="text-center">

                <span t-field="line.product_uom_qty"/>

            </td>

        </xpath>


        <!-- PRICE UNIT COLUMN: Format properly -->

        <xpath expr="//td[@name='td_priceunit']" position="replace">

            <td name="td_priceunit" class="text-end">

                <span t-field="line.price_unit"/>

            </td>

        </xpath>


        <!-- SUBTOTAL / PRICE INCL COLUMN: Update header and value -->

        <xpath expr="//th[@name='th_subtotal']/span" position="replace"/>

        <xpath expr="//th[@name='th_subtotal']" position="inside">

            <span class="text-end">Price Incl</span>

        </xpath>


        <xpath expr="//td[@name='td_subtotal']" position="replace">

            <td name="td_subtotal" class="text-end">

                <span t-field="line.price_total"/>

            </td>

        </xpath>


        <!-- OPTIONAL: Ensure colspan is high enough for notes and sections -->

        <xpath expr="//td[@name='td_section_line']" position="attributes">

            <attribute name="colspan">100</attribute>

        </xpath>


        <xpath expr="//td[@name='td_note_line']" position="attributes">

            <attribute name="colspan">100</attribute>

        </xpath>


        <xpath expr="//td[@name='td_section_subtotal']" position="attributes">

            <attribute name="colspan">100</attribute>

        </xpath>


    </data>

</odoo>


i hope it is usefull

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

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

Регистрация
Похожие посты Ответы Просмотры Активность
Quote Builder With Custom Rental Report (Studio)
pdf
Аватар
0
окт. 25
506
Quote Builder With Custom Rental Report (Studio)
pdf
Аватар
0
окт. 25
4
How to edit the header of the quote template Решено
pdf
Аватар
Аватар
Аватар
2
авг. 25
1293
How to Edit Out the Blank Space in the Quote/Order Confirmation PDFs? Решено
pdf
Аватар
Аватар
Аватар
Аватар
3
авг. 25
2717
How to Disable Automatic PDF Download When Selecting "Invoice" in POS (Odoo Online)?
pdf
Аватар
1
июл. 25
1485
Сообщество
  • Видео уроки
  • Документация
  • Форум
Открытый исходный код
  • Скачать
  • 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