Skip to Content
Odoo Meniu
  • Autentificare
  • Try it free
  • Aplicații
    Finanțe
    • Contabilitate
    • Facturare
    • Cheltuieli
    • Spreadsheet (BI)
    • Documente
    • Semn
    Vânzări
    • CRM
    • Vânzări
    • POS Shop
    • POS Restaurant
    • Abonamente
    • Închiriere
    Site-uri web
    • Constructor de site-uri
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Lanț Aprovizionare
    • Inventar
    • Producție
    • PLM
    • Achiziție
    • Maintenance
    • Calitate
    Resurse Umane
    • Angajați
    • Recrutare
    • Time Off
    • Evaluări
    • Referințe
    • Flotă
    Marketing
    • Social Marketing
    • Marketing prin email
    • SMS Marketing
    • Evenimente
    • Automatizare marketing
    • Sondaje
    Servicii
    • Proiect
    • Foi de pontaj
    • Servicii de teren
    • Centru de asistență
    • Planificare
    • Programări
    Productivitate
    • Discuss
    • Aprobări
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Aplicații Terțe Odoo Studio Platforma Odoo Cloud
  • Industrii
    Retail
    • Book Store
    • Magazin de îmbrăcăminte
    • Magazin de Mobilă
    • Magazin alimentar
    • Magazin de materiale de construcții
    • Magazin de jucării
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Distribuitor de băuturi
    • Hotel
    Proprietate imobiliara
    • Real Estate Agency
    • Firmă de Arhitectură
    • Construcție
    • Estate Managament
    • Grădinărit
    • Asociația Proprietarilor de Proprietăți
    Consultanta
    • Firma de Contabilitate
    • Partener Odoo
    • Agenție de marketing
    • Law firm
    • Atragere de talente
    • Audit & Certification
    Producție
    • Textil
    • Metal
    • Mobilier
    • Mâncare
    • Brewery
    • Cadouri corporate
    Health & Fitness
    • Club Sportiv
    • Magazin de ochelari
    • Centru de Fitness
    • Wellness Practitioners
    • Farmacie
    • Salon de coafură
    Trades
    • Handyman
    • IT Hardware and Support
    • Asigurare socială de stat
    • Cizmar
    • Servicii de curățenie
    • HVAC Services
    Altele
    • Organizație nonprofit
    • Agenție de Mediu
    • Închiriere panouri publicitare
    • Fotografie
    • Închiriere biciclete
    • Asigurare socială
    Browse all Industries
  • Comunitate
    Învăță
    • Tutorials
    • Documentație
    • Certificări
    • Instruire
    • Blog
    • Podcast
    Empower Education
    • Program Educațional
    • Scale Up! Business Game
    • Visit Odoo
    Obține Software-ul
    • Descărcare
    • Compară Edițiile
    • Lansări
    Colaborați
    • Github
    • Forum
    • Evenimente
    • Translations
    • Devino Partener
    • Services for Partners
    • Înregistrează-ți Firma de Contabilitate
    Obține Servicii
    • Găsește un Partener
    • Găsiți un contabil
    • Meet an advisor
    • Servicii de Implementare
    • Referințe ale clienților
    • Suport
    • Actualizări
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obține un demo
  • Prețuri
  • Ajutor

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

  • CRM
  • e-Commerce
  • Contabilitate
  • Inventar
  • PoS
  • Proiect
  • MRP
All apps
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Suport

[SOLVED] How to add field into Quotation/Sale Order (pdf)

Abonare

Primiți o notificare când există activitate la acestă postare

Această întrebare a fost marcată
2 Răspunsuri
20009 Vizualizări
Imagine profil
Dr Obx

Guys,

I would like to add a field into the Quotation/Sale Order so I added it into report_saleorder.xml but either it's not correct place or I did something wrong.

Where should I add it to have it on printouts ?

0
Imagine profil
Abandonează
Imagine profil
William Brugger
Cel mai bun răspuns

First you need to create the fields you want to add.  You can do this in developer mode (http://pulse7.net/openerp/odoo-9-how-to-activate-developer-mode/) or create your own module. (https://www.odoo.com/documentation/8.0/howtos/backend.html#build-an-odoo-module)

Developer Mode:  Go to settings->technical->models and search for sale.order.  Once you are on the sale model you can edit and add a field.  It is good practice to name your field with the prefix "x_"  (i.e. "x_mycustomfield")  Use other fields as a means to determine what type of data (Field Type) you should choose. (i.e. char, integer, datetime etc).

Now that you have added your field you can now add it to the qweb view of the report.    The one you will want to edit is "report_saleorder_document".  FYI, the way to find the correct qweb views for any report is as follows:

Go to  settings->technical->reports and search for the model (i.e. sale.order.)  Open that and look click the link "search associated qweb views".  


Once you have opened report_saleorder_document you can edit in your custom field.  For example, if you wanted to add your field right after Unit Price you would look for

<th class="text-right">Unit Price</th> 

and add

<th class="text-right">My Custom Field</th>

Then look below for

<td class="text-right">
<span t-field="l.price_unit"/> </td>

and add right after

<td class="text-right">
<span t-field="l.x_mycustomfield"/> </td>    


If you get an error when saving it may be that your custom field is not registered yet or misspelled.

The better way to do this is with a custom module.  It's not too hard to do and there are several good tutorials.  You will need to search for how to create custom modules that extend models and how to create custom reports or modify reports.


Also, as the previous answer indicated, you can also easily add your custom field to the tree and form views if desired.  As long as you are in developer mode just go to sales->sales orders and  on the bottom of the window click view-edit tree view or if you click on an order you can click view -> edit form view.  Use the existing fields as an example of how to add your field.  It's a little different than the qweb.


Have fun.

2
Imagine profil
Abandonează
Dr Obx
Autor

Great thanks Will, works beautifully.

Dr Obx
Autor

I was so close ... :)

Imagine profil
Koffi KPONOUGLO
Cel mai bun răspuns

Hi Dr Obx,

it is depend of your gool. Classicly you can follow these step : 

  1. Add the field into sale.py in object sale.order.

  2. Add the field into sale_view.xml (form and tree view of sale.order)

  3. Add the field into report_saleorder.xml


Good work

1
Imagine profil
Abandonează
Dr Obx
Autor

Before I posted my question I already did the steps you suggested but I cant see my custom field. Actually I can see my field but only on screen, I can't see it in PDF/printout

Enjoying the discussion? Don't just read, join in!

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

Înscrie-te
Comunitate
  • Tutorials
  • Documentație
  • Forum
Open Source
  • Descărcare
  • Github
  • Runbot
  • Translations
Servicii
  • Hosting Odoo.sh
  • Suport
  • Actualizare
  • Custom Developments
  • Educație
  • Găsiți un contabil
  • Găsește un Partener
  • Devino Partener
Despre Noi
  • Compania noastră
  • Active de marcă
  • Contactați-ne
  • Locuri de muncă
  • Evenimente
  • Podcast
  • Blog
  • Clienți
  • Aspecte juridice • Confidențialitate
  • Securitate
الْعَرَبيّة 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 este o suită de aplicații de afaceri open source care acoperă toate nevoile companiei dvs.: CRM, comerț electronic, contabilitate, inventar, punct de vânzare, management de proiect etc.

Propunerea de valoare unică a Odoo este să fie în același timp foarte ușor de utilizat și complet integrat.

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