Skip to Content
Odoo Меню
  • Увійти
  • Спробуйте це безкоштовно
  • Додатки
    Фінанси
    • Бухоблік
    • Виставлення рахунку
    • Витрати
    • Електронні таблиці (BI)
    • Документи
    • Підпис
    Продажі
    • CRM
    • Продажі
    • POS Магазин
    • POS Ресторан
    • Підписки
    • Оренда
    Веб-сайти
    • Конструктор веб-сайту
    • Електронна комерція
    • Блог
    • Форум
    • Живий чат
    • Електронне навчання
    Ланцюг поставок
    • Склад
    • Виробництво
    • PLM
    • Купівлі
    • Технічне обслуговування
    • Якість
    Кадри
    • Співробітники
    • Рекрутинг
    • Відпустки
    • Оцінювання
    • Рекомендації
    • Автотранспорт
    Маркетинг
    • Маркетинг соцмереж
    • Email-маркетинг
    • SMS-маркетинг
    • Події
    • Автом. маркетингу
    • Опитування
    Послуги
    • Проект
    • Табелі
    • Виїзне обслуговування
    • Служба підтримки
    • Планування
    • Призначення
    Продуктивність
    • Обговорення
    • Схвалення
    • IoT
    • IP-телефонія
    • База знань
    • WhatsApp
    Сторонні модулі Odoo Studio Платформа Odoo Cloud
  • Сфери
    Роздрібна торгівля
    • Книжковий магазин
    • Магазин одягу
    • Магазин меблів
    • Продуктовий магазин
    • Магазин будівельних матеріалів
    • Магазин іграшок
    Food & Hospitality
    • Бар та паб
    • Ресторан
    • Фастфуд
    • Guest House
    • Дистриб'ютор напоїв
    • Hotel
    Нерухомість
    • Real Estate Agency
    • Архітектурна фірма
    • Будівництво
    • Управління нерухомістю
    • Садівництво
    • Асоціація власників нерухомості
    Консалтинг
    • Бухгалтерська компанія
    • Партнер Odoo
    • Агенція маркетингу
    • Юридична фірма
    • Придбання Талантів
    • Аудит та сертифікація
    Виробництво
    • Textile
    • Metal
    • Меблі
    • Їжа
    • Brewery
    • Корпоративні подарунки
    Здоров'я & Фітнес
    • Спортивний клуб
    • Оптика
    • Фітнес-центр
    • Практики здоров'я
    • Аптека
    • Салон краси
    Trades
    • Ремонтник
    • IT-обладнання та Підтримка
    • Системи сонячної енергії
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Інші
    • Nonprofit Organization
    • Екологічна агенція
    • Оренда білбордів
    • Фотографія
    • Лізинг велосипедів
    • Реселлер програмного забезпечення
    Browse all Industries
  • Спільнота
    Навчання
    • Навчальний посібник
    • Документація
    • Сертифікації
    • Тренування
    • Блог
    • Подкаст
    Сприяйте Освіті
    • Програма навчання
    • Бізнес гра Scale Up!
    • Відвідайте Odoo
    Отримайте програмне забезпечення
    • Завантаження
    • Порівняйте версії
    • Релізи
    Співпрацюйте
    • Github
    • Форум
    • Події
    • Переклади
    • Стати партнером
    • Services for Partners
    • Зареєструйте вашу бухгалтерську фірму
    Отримайте послуги
    • Знайдіть партнера
    • Знайдіть бухгалтера
    • Зустріньтеся з консультантом
    • Послуги з впровадження
    • Референси клієнтів
    • Підтримка
    • Оновлення
    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
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
All Posts Люди Значки
Мітки (View all)
odoo accounting v14 pos v15
Про цей форум
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
All Posts Люди Значки
Мітки (View all)
odoo accounting v14 pos v15
Про цей форум
Допомога

adding custom field in quotation/invoice

Підписатися

Отримуйте сповіщення про активність щодо цієї публікації

Це запитання позначене
salespdf
1 Відповісти
559 Переглядів
Аватар
L Scales , LScales

i want to add a custom field in a quotation and fill it manually each time then it appears in the pdf when i create an invoice

0
Аватар
Відмінити
Аватар
Cybrosys Techno Solutions Pvt.Ltd
Найкраща відповідь

Hi,


Step 1: Create the Custom Field in the sale.order Model


Activate developer mode and create a custom module (if you don't have one). In your custom module's models/sale_order.py file, add a new field to the sale.order model using _inherit. Define the field with an appropriate type (e.g., fields.Text for multi-line text), a descriptive string for the label, and set store=True to ensure the field is stored in the database.


from odoo import models, fields, api


class SaleOrder(models.Model):

    _inherit = 'sale.order'


    x_custom_field = fields.Text(string="Your Custom Field", store=True)


Step 2: Add the Field to the Quotation Form View


In your custom module's views/sale_order_views.xml file, create a view inheritance to modify the existing quotation form view. Use an xpath expression to specify where to insert the new field in the form. Add the <field name="x_custom_field"/> tag to include the custom field in the form view.


<odoo>

        <record id="sale_order_form_custom_field" model="ir.ui.view">

            <field name="name">sale.order.form.custom.field</field>

            <field name="model">sale.order</field>

            <field name="inherit_id" ref="sale.view_order_form"/>

            <field name="arch" type="xml">

                <xpath expr="//notebook/page[@name='other_information']/group" position="inside">

                    <field name="x_custom_field"/>

                </xpath>

            </field>

        </record>

</odoo>


Step 3: Update the Module


Go to the Apps module in Odoo and update your custom module. This will install the new field and view changes, making the custom field visible in the quotation form.


Step 4: Add the Field to the Invoice PDF Report


Identify the ID of the invoice PDF report template (e.g., account.report_invoice_document). In your custom module's views/report_invoice_views.xml file, create a view inheritance to modify the report template. Use an xpath expression to specify where to insert the custom field in the PDF report. Add the necessary HTML and QWeb code to display the custom field's label and value in the PDF.


<odoo>

        <template id="report_invoice_document_custom_field" inherit_id="account.report_invoice_document">

            <xpath expr="//div[@class='page']/div[@class='row mt20']" position="inside">

                <div class="col-auto mw-100 mb-2">

                    <strong>Your Custom Field:</strong>

                    <p t-field="o.x_custom_field"/>

                </div>

            </xpath>

        </template>

</odoo>


Step 5: Update the Module


Go to the Apps module and update your custom module. This will install the new report view changes, ensuring that the custom field appears in the generated invoice PDFs.


Hope it helps

0
Аватар
Відмінити
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Реєстрація
Related Posts Відповіді Переглядів Дія
How to achieve the effect shown in the image? The video is from the official channel: 2 Minutes to Understand Odoo
sales pdf
Аватар
0
лист. 25
206
Odoo 18 Quotation Builder Header/Footer Print Problem Вирішено
sales pdf
Аватар
Аватар
2
серп. 25
4637
Digital products
sales pdf
Аватар
Аватар
1
лют. 25
8151
How to hide units of measure in PDF reports?
sales debug pdf
Аватар
Аватар
Аватар
3
жовт. 25
732
How to keep footer always at the bottom of the very last page in QWeb PDF report
sales debug pdf
Аватар
Аватар
Аватар
2
серп. 25
1376
Спільнота
  • Навчальний посібник
  • Документація
  • Форум
Open Source
  • Завантаження
  • Github
  • Runbot
  • Переклади
Послуги
  • Хостинг Odoo.sh
  • Підтримка
  • Оновлення
  • Кастомні доробки
  • Навчання
  • Знайдіть бухгалтера
  • Знайдіть партнера
  • Стати партнером
Про нас
  • Наша компанія
  • Торгові активи
  • Зв'яжіться з нами
  • Вакансії
  • Події
  • Подкаст
  • Блог
  • Клієнти
  • Юридичні документи • Конфіденційність
  • Безпека
الْعَرَبيّة 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, електронна комерція, бухгалтерський облік, склад, точка продажу, управління проектами тощо.

Унікальна пропозиція 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