Skip to Content
Odoo मेन्यू
  • Sign in
  • मुफ़्त में आज़माएं
  • ऐप्लिकेशन
    फ़ाइनेंस
    • अकाउंटिंग
    • इनवॉइसिंग
    • एक्सपेंस
    • स्प्रेडशीट (बीआई)
    • डॉक्यूमेंट्स
    • साइन
    सेल्स
    • सीआरएम
    • सेल्स
    • पीओएस शॉप
    • पीओएस रेस्टोरेंट
    • सब्सक्रिप्शन
    • रेंटल
    वेबसाइट
    • वेबसाइट बिल्डर
    • ई-कॉमर्स
    • ब्लॉग
    • फ़ोरम
    • लाइव चैट
    • ई-लर्निंग
    सप्लाई चेन
    • इन्वेंट्री
    • मैन्युफ़ैक्चरिंग
    • पीएलएम
    • परचेज़
    • मेंटेनेंस
    • क्वालिटी
    मानव संसाधन
    • कर्मचारी
    • रिक्रूटमेंट
    • टाइम ऑफ़
    • अप्रेज़ल
    • रेफ़रल
    • फ़्लीट
    मार्केटिंग
    • सोशल मार्केटिंग
    • ईमेल मार्केटिंग
    • एसएमएस मार्केटिंग
    • इवेंट
    • मार्केटिंग ऑटोमेशन
    • सर्वे
    सेवाएं
    • प्रोजेक्ट
    • टाइमशीट
    • फ़ील्ड सर्विस
    • हेल्पडेस्क
    • प्लानिंग
    • अपॉइंटमेंट
    प्रॉडक्टिविटी
    • डिस्कस
    • अप्रूवल
    • आईओटी
    • वीओआईपी
    • नॉलेज
    • WhatsApp
    तीसरे पक्ष के ऐप्लिकेशन Odoo स्टूडियो Odoo क्लाउड प्लेटफ़ॉर्म
  • इंडस्ट्री
    रीटेल
    • बुक स्टोर
    • क्लोदिंग स्टोर
    • फ़र्नीचर स्टोर
    • ग्रॉसरी स्टोर
    • हार्डवेयर स्टोर
    • टॉय स्टोर
    Food & Hospitality
    • बार और पब
    • रेस्टोरेंट
    • फ़ास्ट फ़ूड
    • Guest House
    • बेवरिज डिस्ट्रीब्यूटर
    • होटल
    रियल एस्टेट
    • Real Estate Agency
    • आर्किटेक्चर फ़र्म
    • कंसट्रक्शन
    • एस्टेट मैनेजमेंट
    • गार्ड्निंग
    • प्रॉपर्टी ओनर असोसिएशन
    कंसल्टिंग
    • अकाउंटिंग फ़र्म
    • Odoo पार्टनर
    • मार्केटिंग एजेंसी
    • लॉ फ़र्म
    • टैलेंट ऐक्विज़िशन
    • ऑडिट & सर्टिफ़िकेशन
    मैन्युफ़ैक्चरिंग
    • टेक्सटाइल
    • Metal
    • फ़र्नीचर
    • फ़ूड
    • Brewery
    • कॉर्पोरेट गिफ़्ट
    हेल्थ & फिटनेस
    • स्पोर्ट्स क्लब
    • आईवियर स्टोर
    • फिटनेस सेंटर
    • वेलनेस प्रैक्टिशनर
    • फॉर्मेसी
    • हेयर सैलून
    Trades
    • Handyman
    • आईटी हॉर्डवेयर और सपोर्ट
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    अन्य
    • Nonprofit Organization
    • एन्वायरमेंटल एजेंसी
    • बिलबोर्ड रेंटल
    • फ़ोटोग्राफी
    • बाइक लीजिंग
    • सॉफ़्टवेयर रीसेलर
    Browse all Industries
  • कम्यूनिटी
    सीखें
    • ट्यूटोरियल्स
    • दस्तावेज़
    • सर्टिफ़िकेशन
    • ट्रेनिंग
    • ब्लॉग
    • पॉडकास्ट
    शिक्षा को बढ़ावा दें
    • एजुकेशन प्रोग्राम
    • स्केल अप! बिजनेस गेम
    • Odoo के ऑफ़िस में आएं
    सॉफ़्टवेयर पाएं
    • डाउनलोड
    • वर्शन की तुलना करें
    • रिलीज़
    साथ मिलकर काम करें
    • Github
    • फ़ोरम
    • इवेंट
    • अनुवाद
    • पार्टनर बनें
    • Services for Partners
    • अपना अकाउंटिंग फ़र्म रजिस्टर करें
    सेवाएं पाएं
    • पार्टनर ढूंढें
    • अकाउंटेंट खोजें
    • सलाहकार की मदद लें
    • इम्प्लिमेंटेशन सेवाएं
    • कस्टमर रेफ़रेंस
    • सहायता
    • अपग्रेड
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    डेमो देखें
  • कीमत
  • सहायता

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

  • सीआरएम
  • e-Commerce
  • लेखांकन
  • इन्वेंटरी
  • PoS
  • प्रोजेक्ट
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
टैग (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
टैग (View all)
odoo accounting v14 pos v15
About this forum
Help

Why XML in odoo ?

Subscribe

Get notified when there's activity on this post

This question has been flagged
actionxmlodoo
3 Replies
2200 Views
Avatar
yahya sbini

I have an issue with understanding the core use of xml in odoo !

for example ,If i want to cerate an window action I can do that in 2 ways:

  1. xml code
  2. directly through UI 

but the difficult questions: 

does doing that in the UI also generate an XML file and why?

for the option 1 ,if doing that using XML will in the end insert a new record in DB ,what is the need of writing the xml code ,I cannot get the idea of using XML ,I am too much confused since data are stored in DB.

0
Avatar
Discard
Avatar
Andry Ang
Best Answer

Hi Yahya,

First, let's differentiate XML File and XML Code (I am not sure if it's should be called as code or just the way to define).

  1. XML File is file that consists XML "code", just like json file
  2. XML "Code" is define and store data in a shareable manner (Just like how JSON object also do)

Yes, changing UI will also update the Architecture that is written in XML form (form not file)

Let me share my thoughts on this. It will be best if you are familiar with "Factory and Seeding" or Creating Initial Data by Code if you used ORM before.

Example:
How do we add the very first user account? do we technically do an insert query to db? of course we can. But what if we can set it without access directly to db - as it might be concerning to access directly. Of course after you have the user let's say the "Administrator", if you want to change the access will it be easier for you to change it through UI that will update the DB or you prefer to update your xml file to update your code, commit, push, pull, restart your server, upgrade your module.

In short this is how you can think about it:

Uploading XML file that has the XML code > create data in db with the xml code as the architecture > you can edit the architecture (which written in XML format) from the UI on the db - more convenient this way.

Key note: XML file sets the initial data by the data that formatted in XML form written in it, DB plays for the changes in future.

Hope this helps.

0
Avatar
Discard
yahya sbini
Author

Thanks Andry ,but I think most of MVC frameworks do not use XML like Laravel ......etc ,why odoo user xml . we can handle the data and insert also in the HTML ?

yahya sbini
Author

moreover ,how can I display content for by XML ,it is not HTML . so how does browser knows the for example
<field> tag should represents as a gray rectangle for example.

yahya sbini
Author

look at this XML code I ,I do not know how it will be rendered in the browser since it is not an HTML code but I think it will be translated via something ,additionally this code is four 2 things UI display and for sending the record to DB ?

<record id="window_action_hospital_patient" model="ir.actions.act_window">
<field name = "name">Patient</field>
<field name="res_model">Hospitaal<field>
<field name="view_mode">tree,form</field>
<field name="help" type="html">
<p class="o_view_noncontent_smiling_face">
Create a new inconterm
</p>
</field>
</record>

yahya sbini
Author

also I think there is a mapping between view code and XML code so :
data will flow: UI -> view code -> XML -> DB ,is that correct ?

Andry Ang

Hi Yahya,
1. XML is only a way of formatting data.
2. XML is not HTML, browser use HTML to render UI
3. In Odoo, there is explanation on why they use XML, check https://www.odoo.com/documentation/18.0/developer/reference/backend/data.html

Andry Ang

Remember, browser always use HTML.
XML in Odoo which stored in db will be translated by QWeb Template engine to HTML

Avatar
Ray Carnes (ray)
Best Answer

XML is used to create database records. (1)

You can create database records within the database. (2)

Creating a database record (2) does not create an XML file.

XML is just one way Odoo creates database records from files during the installation of a module. The other main way is via CSV files.

0
Avatar
Discard
yahya sbini
Author

Thanks Ray ,If i have for imagination some UI not related to the DB or inserting just for showing some info ,in this situation why to use XML ?

Avatar
Apiuser
Best Answer

I guess it is because you can make them persistent using xml, because they will be added in your module and not only at the db. Take for example if we update the mail module and we added the custom templates using the UI you will overwrite the modifications unless you marked it as noupdate.

That is appart of the ease of installing a module and adding new templates or views on the fly without using the UI.

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

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

Sign up
Related Posts Replies Views Activity
HOW CAN I GET CURRENT COMPANY ID IN CONTEXT OF ACTION USING JUST XML
action xml context odoo
Avatar
Avatar
1
जुल॰ 24
2625
Problemas al imprimir factura en el odoo
xml odoo
Avatar
0
जन॰ 25
1928
How to post xml code
xml odoo
Avatar
1
मार्च 25
652
How can I include my generic qweb view on my Odoo 16 Form View using JS or Controller
xml odoo
Avatar
Avatar
1
सित॰ 23
3463
How can i call a specific module view when i log ? am using Odoo studio
action odoo
Avatar
0
दिस॰ 22
2499
कम्यूनिटी
  • ट्यूटोरियल्स
  • दस्तावेज़
  • फ़ोरम
ओपन सोर्स
  • डाउनलोड
  • Github
  • रनबॉट
  • अनुवाद
सेवाएं
  • Odoo.sh Hosting
  • सहायता
  • अपग्रेड
  • कस्टम डेवलपमेंट्स
  • शिक्षा
  • अकाउंटेंट खोजें
  • पार्टनर ढूंढें
  • पार्टनर बनें
हमारे बारे में
  • हमारी कंपनी
  • ब्रांड ऐसेट
  • संपर्क करें
  • नौकरियां
  • इवेंट
  • पॉडकास्ट
  • ब्लॉग
  • ग्राहक
  • लीगल • गोपनीयता
  • सुरक्षा
الْعَرَبيّة 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, बिज़नेस से जुड़े ऐप्लिकेशन का एक कलेक्शन है जो ओपन सोर्स पर आधारित है. इसमें आपकी कंपनी की हर ज़रूरत के लिए ऐप्लिकेशन हैं. जैसे, सीआरएम, ई-कॉमर्स, अकाउंटिंग, इन्वेंट्री, पॉइंट ऑफ़ सेल, प्रोजेक्ट मैनेजमेंट वगैरह.

Odoo की सबसे बड़ी खासियत है कि यह इस्तेमाल करने में बहुत आसान है और यह पूरी तरह से इंटिग्रेट किया हुआ है.

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