Skip to Content
Odoo Menu
  • Prihlásiť sa
  • Vyskúšajte zadarmo
  • Aplikácie
    Financie
    • Účtovníctvo
    • Fakturácia
    • Výdavky
    • Tabuľka (BI)
    • Dokumenty
    • Podpis
    Predaj
    • CRM
    • Predaj
    • POS Shop
    • POS Restaurant
    • Manažment odberu
    • Požičovňa
    Webstránky
    • Tvorca webstránok
    • eShop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Supply Chain
    • Sklad
    • Výroba
    • Správa životného cyklu produktu
    • Nákup
    • Údržba
    • Manažment kvality
    Ľudské zdroje
    • Zamestnanci
    • Nábor zamestnancov
    • Voľné dni
    • Hodnotenia
    • Odporúčania
    • Vozový park
    Marketing
    • Marketing sociálnych sietí
    • Email marketing
    • SMS marketing
    • Eventy
    • Marketingová automatizácia
    • Prieskumy
    Služby
    • Projektové riadenie
    • Pracovné výkazy
    • Práca v teréne
    • Helpdesk
    • Plánovanie
    • Schôdzky
    Produktivita
    • Tímová komunikácia
    • Schvalovania
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Priemyselné odvetvia
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Reštaurácia
    • Fast Food
    • Guest House
    • Beverage distributor
    • Hotel
    Reality
    • Real Estate Agency
    • Architecture Firm
    • Konštrukcia
    • Estate Managament
    • Gardening
    • Property Owner Association
    Poradenstvo
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Jedlo
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware and Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Iní
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Komunita
    Vzdelávanie
    • Tutoriály
    • Dokumentácia
    • Certifikácie
    • Školenie
    • Blog
    • Podcast
    Empower Education
    • Vzdelávací program
    • Scale Up! Business Game
    • Visit Odoo
    Softvér
    • Stiahnuť
    • Porovnanie Community a Enterprise vierzie
    • Releases
    Spolupráca
    • Github
    • Fórum
    • Eventy
    • Preklady
    • Staň sa partnerom
    • Services for Partners
    • Register your Accounting Firm
    Služby
    • Nájdite partnera
    • Nájdite účtovníka
    • Meet an advisor
    • Implementation Services
    • Zákaznícke referencie
    • Podpora
    • Upgrades
    ​Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Získajte demo
  • Cenník
  • Pomoc

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

  • CRM
  • e-Commerce
  • Účtovníctvo
  • Sklady
  • PoS
  • Projektové riadenie
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
Pomoc

Insert a custom field in report_saleorder_document in Odoo 10

Odoberať

Get notified when there's activity on this post

This question has been flagged
6 Replies
5013 Zobrazenia
Avatar
Patrick Roberto

Hello guys,

Sorry for the amateur question. I know that for you this is very simple, but since I am not a developer, I have a great difficulty.

I have created a custom field called  x_cnpj . I need to include this field when I generate the sale quotation report.
I try edit report_saleorder_document  and add this line:
<span t-field="doc.partner_id.x_cnpj"/>

But when generate report, value does not appear, it is as if it did not exist.

I know I'm doing something wrong, can someone help me with a step by step?

thank you very much !

0
Avatar
Zrušiť
Avatar
Niyas Raphy (Walnut Software Solutions)
Best Answer

Hi,

Did you include the new field named x_cnpj inside the customer model(res.partner) ? If so, what you did seems to be right. If the new field is introduced in the sale order model(sale.order) , then use

<span t-field="doc.x_cnpj"/>

instead of <span t-field="doc.partner_id.x_cnpj"/>


Thanks

0
Avatar
Zrušiť
Avatar
Mital Vaghani
Best Answer

Hello,
Please verify once value set in x_cnpj of customer of sale order for which you are generating report.

0
Avatar
Zrušiť
Avatar
Anusha
Best Answer

Hi,

   If you put the  x_cnpj in sale order just use the same as said by Niyas .if it is in Partner form use doc.partner_id.x_cnpj 

<template id="view_id" inherit_id="sale.report_saleorder_document">
<xpath expr="//path" position="after">
<t t-if="doc.x_cnpj">
<strong>x_cnpj :</strong>
<p t-field="doc.x_cnpj"/>
</t>
</xpath>
</template>

​   

0
Avatar
Zrušiť
Avatar
Patrick Roberto
Autor Best Answer

Hi Niyas,

i dont know what i´m doing wrong, but i get this error when generate PDF:


Error to render compiling AST
KeyError: 'x_cnpj'
Template: sale.report_saleorder_document
Path: /templates/t/t/div/div[1]/div[2]/div[1]/span
Node: <span t-field="doc.x_cnpj"/> 
Any ideas ?
0
Avatar
Zrušiť
Niyas Raphy (Walnut Software Solutions)

Can you specify where you have added this field ? from the user interface or by custom module

Patrick Roberto
Autor

Hi Niyas

I´m a IT Pro, but have no experience with development.

I create the custom field in called x_cnpj in "Models" - "res.partner"

Then, i edit res.partner.form and add <field name="x_cnpj" placeholder="CNPJ - Sem pontos ou traços" attrs="{'invisible': [('is_company','=', False)]}"/>

Until here, is working, because i can add information to this field in customer information.

But i need this information appears in my quotation when i generate this from sales

I don´t know what do to in report_saleorder_document to make the field x_cnpj create in res.partner.form appears in this report.

Any ideas ?

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

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

Registrácia
Komunita
  • Tutoriály
  • Dokumentácia
  • Fórum
Open Source
  • Stiahnuť
  • Github
  • Runbot
  • Preklady
Služby
  • Odoo.sh hosting
  • Podpora
  • Vyššia verzia
  • Custom Developments
  • Vzdelávanie
  • Nájdite účtovníka
  • Nájdite partnera
  • Staň sa partnerom
O nás
  • Naša spoločnosť
  • Majetok značky
  • Kontaktujte nás
  • Pracovné ponuky
  • Eventy
  • Podcast
  • Blog
  • Zákazníci
  • Právne dokumenty • Súkromie
  • Bezpečnosť
الْعَرَبيّة 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 je sada podnikových aplikácií s otvoreným zdrojovým kódom, ktoré pokrývajú všetky potreby vašej spoločnosti: CRM, e-shop, účtovníctvo, skladové hospodárstvo, miesto predaja, projektový manažment atď.

Odoo prináša vysokú pridanú hodnotu v jednoduchom použití a súčasne plne integrovanými biznis aplikáciami.

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