Overslaan naar inhoud
Odoo Menu
  • Aanmelden
  • Probeer het gratis
  • Apps
    Financiën
    • Boekhouding
    • Facturatie
    • Onkosten
    • Spreadsheet (BI)
    • Documenten
    • Ondertekenen
    Verkoop
    • CRM
    • Verkoop
    • Kassasysteem winkel
    • Kassasysteem Restaurant
    • Abonnementen
    • Verhuur
    Websites
    • Websitebouwer
    • E-commerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Bevoorradingsketen
    • Voorraad
    • Productie
    • PLM
    • Inkoop
    • Onderhoud
    • Kwaliteit
    Personeelsbeheer
    • Werknemers
    • Werving & Selectie
    • Verlof
    • Evaluaties
    • Aanbevelingen
    • Wagenpark
    Marketing
    • Social media Marketing
    • E-mailmarketing
    • SMS Marketing
    • Evenementen
    • Marketingautomatisering
    • Enquêtes
    Diensten
    • Project
    • Urenstaten
    • Buitendienst
    • Helpdesk
    • Planning
    • Afspraken
    Productiviteit
    • Chat
    • Goedkeuringen
    • IoT
    • VoIP
    • Kennis
    • WhatsApp
    Apps van derden Odoo Studio Odoo Cloud Platform
  • Bedrijfstakken
    Detailhandel
    • Boekhandel
    • kledingwinkel
    • Meubelzaak
    • Supermarkt
    • Bouwmarkt
    • Speelgoedwinkel
    Food & Hospitality
    • Bar en Pub
    • Restaurant
    • Fastfood
    • Gastenverblijf
    • Drankenhandelaar
    • Hotel
    Vastgoed
    • Makelaarskantoor
    • Architectenbureau
    • Bouw
    • Vastgoedbeheer
    • Tuinieren
    • Vereniging van eigenaren
    Consulting
    • Accountantskantoor
    • Odoo Partner
    • Marketingbureau
    • Advocatenkantoor
    • Talentenwerving
    • Audit & Certificering
    Productie
    • Textiel
    • Metaal
    • Meubels
    • Eten
    • Brewery
    • Relatiegeschenken
    Gezondheid & Fitness
    • Sportclub
    • Opticien
    • Fitnesscentrum
    • Wellness-medewerkers
    • Apotheek
    • Kapper
    Trades
    • Klusjesman
    • IT-hardware & support
    • Zonne-energiesystemen
    • Schoenmaker
    • Schoonmaakdiensten
    • HVAC-diensten
    Andere
    • Non-profitorganisatie
    • Milieuagentschap
    • Verhuur van Billboards
    • Fotograaf
    • Fietsleasing
    • Softwareverkoper
    Browse all Industries
  • Community
    Leren
    • Tutorials
    • Documentatie
    • Certificeringen
    • Training
    • Blog
    • Podcast
    Versterk het onderwijs
    • Onderwijs- programma
    • Scale Up! Business Game
    • Bezoek Odoo
    Download de Software
    • Downloaden
    • Vergelijk edities
    • Releases
    Werk samen
    • Github
    • Forum
    • Evenementen
    • Vertalingen
    • Word een Partner
    • Services for Partners
    • Registreer je accountantskantoor
    Diensten
    • Vind een partner
    • Vind een boekhouder
    • Een adviseur ontmoeten
    • Implementatiediensten
    • Klantreferenties
    • Ondersteuning
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Vraag een demo aan
  • Prijzen
  • Help

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

  • CRM
  • e-Commerce
  • Boekhouding
  • Voorraad
  • PoS
  • Project
  • MRP
All apps
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Help

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

Inschrijven

Ontvang een bericht wanneer er activiteit is op deze post

Deze vraag is gerapporteerd
2 Antwoorden
20018 Weergaven
Avatar
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
Avatar
Annuleer
Avatar
William Brugger
Beste antwoord

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
Avatar
Annuleer
Dr Obx
Auteur

Great thanks Will, works beautifully.

Dr Obx
Auteur

I was so close ... :)

Avatar
Koffi KPONOUGLO
Beste antwoord

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
Avatar
Annuleer
Dr Obx
Auteur

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

Geniet je van het gesprek? Blijf niet alleen lezen, doe ook mee!

Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!

Aanmelden
Community
  • Tutorials
  • Documentatie
  • Forum
Open Source
  • Downloaden
  • Github
  • Runbot
  • Vertalingen
Diensten
  • Odoo.sh Hosting
  • Ondersteuning
  • Upgrade
  • Gepersonaliseerde ontwikkelingen
  • Onderwijs
  • Vind een boekhouder
  • Vind een partner
  • Word een Partner
Over ons
  • Ons bedrijf
  • Merkelementen
  • Neem contact met ons op
  • Vacatures
  • Evenementen
  • Podcast
  • Blog
  • Klanten
  • Juridisch • Privacy
  • Beveiliging
الْعَرَبيّة 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 is een suite van open source zakelijke apps die aan al je bedrijfsbehoeften voldoet: CRM, E-commerce, boekhouding, inventaris, kassasysteem, projectbeheer, enz.

Odoo's unieke waardepropositie is om tegelijkertijd zeer gebruiksvriendelijk en volledig geïntegreerd te zijn.

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