Skip to Content
Odoo Menu
  • Prisijungti
  • Išbandykite nemokamai
  • Programėlės
    Finansai
    • Apskaita
    • Pateikimas apmokėjimui
    • Sąnaudos
    • Skaičiuoklė (BI)
    • Dokumentai
    • Pasirašymas
    Pardavimai
    • CRM
    • Pardavimai
    • Kasų sistema - Parduotuvė
    • Kasų sistema - Restoranas
    • Prenumeratos
    • Nuoma
    Svetainės
    • Svetainių kūrėjimo įrankis
    • El. Prekyba
    • Internetinis Tinklaraštis
    • Forumas
    • Tiesioginis pokalbis
    • eMokymasis
    Tiekimo grandinė
    • Atsarga
    • Gamyba
    • PLM
    • Įsigijimai
    • Priežiūra
    • Kokybė
    Žmogaus ištekliai
    • Darbuotojai
    • Įdarbinimas
    • Atostogos
    • Įvertinimai
    • Rekomendacijos
    • Transporto priemonės
    Rinkodara
    • Socialinė rinkodara
    • Rinkodara el. paštu
    • SMS rinkodara
    • Renginiai
    • Rinkodaros automatizavimas
    • Apklausos
    Paslaugos
    • Projektas
    • Darbo laiko žiniaraščiai
    • Priežiūros tarnyba
    • Pagalbos tarnyba
    • Planavimas
    • Rezervacijos
    Produktyvumas
    • Diskucija
    • Patvirtinimai
    • IoT
    • VoIP
    • Žinių biblioteka
    • WhatsApp
    Trečiųjų šalių programos Odoo Studija Odoo debesijos platforma
  • Pramonės šakos
    Mažmeninė prekyba
    • Knygynas
    • Drabužių parduotuvė
    • Baldų parduotuvė
    • Maisto prekių parduotuvė
    • Techninės įrangos parduotuvė
    • Žaislų parduotuvė
    Food & Hospitality
    • Barai ir pub'ai
    • Restoranas
    • Greitasis maistas
    • Guest House
    • Gėrimų platintojas
    • Hotel
    Nekilnojamasis turtas
    • Real Estate Agency
    • Architektūros įmonė
    • Konstrukcija
    • Estate Managament
    • Sodininkauti
    • Turto savininkų asociacija
    Konsultavimas
    • Accounting Firm
    • Odoo Partneris
    • Marketing Agency
    • Teisinė firma
    • Talentų paieška
    • Auditai & sertifikavimas
    Gamyba
    • Textile
    • Metal
    • Furnitures
    • Maistas
    • Brewery
    • Įmonių dovanos
    Sveikata & Fitnesas
    • Sporto klubas
    • Akinių parduotuvė
    • Fitneso Centras
    • Sveikatos praktikai
    • Vaistinė
    • Kirpėjas
    Trades
    • Handyman
    • IT įranga ir palaikymas
    • Saulės energijos sistemos
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Kiti
    • Nonprofit Organization
    • Aplinkos agentūra
    • Reklaminių stendų nuoma
    • Fotografavimas
    • Dviračių nuoma
    • Programinės įrangos perpardavėjas
    Browse all Industries
  • Bendrija
    Mokykitės
    • Mokomosios medžiagos
    • Dokumentacija
    • Sertifikatai
    • Mokymai
    • Internetinis Tinklaraštis
    • Tinklalaidės
    Skatinkite švietinimą
    • Švietimo programa
    • Scale Up! Verslo žaidimas
    • Aplankykite Odoo
    Gaukite programinę įrangą
    • Atsisiųsti
    • Palyginkite versijas
    • Leidimai
    Bendradarbiauti
    • Github
    • Forumas
    • Renginiai
    • Vertimai
    • Tapkite partneriu
    • Services for Partners
    • Registruokite jūsų apskaitos įmonę
    Gaukite paslaugas
    • Susiraskite partnerį
    • Susirask buhalterį
    • Susitikti su konsultantu
    • Diegimo paslaugos
    • Klientų rekomendavimas
    • Palaikymas
    • Atnaujinimai
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Gaukite demo
  • Kainodara
  • Pagalba

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Apskaita
  • Atsarga
  • PoS
  • Projektas
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Žymos (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Žymos (View all)
odoo accounting v14 pos v15
About this forum
Pagalba

adding custom field in quotation/invoice

Prenumeruoti

Get notified when there's activity on this post

This question has been flagged
salespdf
1 Atsakyti
572 Rodiniai
Portretas
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
Portretas
Atmesti
Portretas
Cybrosys Techno Solutions Pvt.Ltd
Best Answer

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
Portretas
Atmesti
Enjoying the discussion? Don't just read, join in!

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

Registracija
Related Posts Replies Rodiniai Veikla
How to achieve the effect shown in the image? The video is from the official channel: 2 Minutes to Understand Odoo
sales pdf
Portretas
0
lapkr. 25
213
Odoo 18 Quotation Builder Header/Footer Print Problem Solved
sales pdf
Portretas
Portretas
2
rugp. 25
4655
Digital products
sales pdf
Portretas
Portretas
1
vas. 25
8156
How to hide units of measure in PDF reports?
sales debug pdf
Portretas
Portretas
Portretas
3
spal. 25
738
How to keep footer always at the bottom of the very last page in QWeb PDF report
sales debug pdf
Portretas
Portretas
Portretas
2
rugp. 25
1385
Bendrija
  • Mokomosios medžiagos
  • Dokumentacija
  • Forumas
Atvirasis kodas
  • Atsisiųsti
  • Github
  • Runbot
  • Vertimai
Paslaugos
  • Odoo.sh talpinimas
  • Palaikymas
  • Atnaujinti
  • Pritaikytas programavimo kūrimas
  • Švietimas
  • Susirask buhalterį
  • Susiraskite partnerį
  • Tapkite partneriu
Apie mus
  • Mūsų įmonė
  • Prekės ženklo turtas
  • Susisiekite su mumis
  • Darbo pasiūlymai
  • Renginiai
  • Tinklalaidės
  • Internetinis Tinklaraštis
  • Klientai
  • Teisinis • Privatumas
  • Saugumas
الْعَرَبيّة 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 yra atvirojo kodo verslo programų rinkinys, kuris apima visas įmonės poreikius: CRM, El. Prekybą, Apskaitą, Atsargų, Kasų sistemą, Projektų valdymą ir kt.

Unikali Odoo vertės pasiūla – būti tuo pačiu metu labai lengvai naudojama ir visiškai integruota sistema.

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