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

Custom fields get overwritten in order templates

Odoberať

Get notified when there's activity on this post

This question has been flagged
templatesordercustomizationOdoo.sh
1 Odpoveď
446 Zobrazenia
Avatar
Hannes Winkler

I am using Odoo.sh in Version 18.0, I added some custom fields to my sale order view and have them printed in the pdf order. Now I would like to have them included in the order templates to have them precompiled and be able to make just little modifications to it, so I don't have to copy/paste the text all the time. I added the fields to the template view and changed the fields in the order view in a way, that they are dependent on the fields of the template (screenshots below). So far that works good, if I make a template and write stuff in that fields, the text is inserted in the orders, but now my problem: If I make some modification in the order to the text, it overwrites the text in the template as well, so everytime I create a new order, the modificated text will be shown, not the original one from the template. How can I make sure, that if I use the template and make changes to the text, that it only affects this specific order and does not overwrite the template?

Thanks for any help.





0
Avatar
Zrušiť
Avatar
Christoph Farnleitner
Best Answer

Based on your configuration, this is behaving as intended.

The Related Field Definition (zu deutsch Bezugsfeld) is meant to define a direct 'link' between two fields on different models to have exactly the same value in both (das, was wir gemeinhin als 'durchschleifen' bezeichnen).

What you need is the Compute field (zu deutsch Berechnen), in order to only set the value of x_studio_teil_1 upon selecting/changing a Sale Order Template.

Something like this should do:

for record in self:
    record['x_studio_teil_1'] = record.sale_order_template_id.x_studio_teil_1


For this to work you need to set the Dependencies field (Abhängigkeiten) to 

sale_order_template_id

in order to have Odoo know, under what circumstance to change the value.

Finally, since by default, a field with a compute function is Readonly, you may want to untick that checkbox then (Nur Lesen) so you can also override the value in the Sale Order.


This will, whenever you change the Sale Order Template on a Sale Order, reset the Value to the one from the selected Template.

If you prefer the value to remain the same if set once, change the compute method to something like this:

for record in self:
    record['x_studio_teil_1'] = record.sale_order_template_id.x_studio_teil_1 if not record.x_studio_teil_1 else record.x_studio_teil_1
0
Avatar
Zrušiť
Hannes Winkler
Autor

Thanks for your help, the first part works fine, it does not even change the text when the template is modified. The second option was not exactly what I wanted, it would not even have changed the text if I would used another template, it would always stay the same. But the first one works, so thanks for that.

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
Related Posts Replies Zobrazenia Aktivita
Customize purchase order
purchase order customization
Avatar
Avatar
1
mar 15
12277
Odoo Sign Email Template Issue
templates signature customization missing
Avatar
Avatar
1
okt 22
6363
How can our team "hold" and "release" Delivery Orders based on the Sales Order? Solved
release delivery order customization 18.0
Avatar
Avatar
1
mar 25
1414
How to revert customized views and templates on website (Odoo 10) ?
views translations templates customization odoo10
Avatar
Avatar
1
mar 22
9721
How to Add a User to Access the Database on Odoo.sh?
Odoo.sh
Avatar
Avatar
1
okt 25
3992
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