Ir al contenido
Odoo Menú
  • Iniciar sesión
  • Pruébalo gratis
  • Aplicaciones
    Finanzas
    • Contabilidad
    • Facturación
    • Gastos
    • Hoja de cálculo (BI)
    • Documentos
    • Firma electrónica
    Ventas
    • CRM
    • Ventas
    • PdV para tiendas
    • PdV para restaurantes
    • Suscripciones
    • Alquiler
    Sitios web
    • Creador de sitios web
    • Comercio electrónico
    • Blog
    • Foro
    • Chat en vivo
    • eLearning
    Cadena de suministro
    • Inventario
    • Manufactura
    • PLM
    • Compras
    • Mantenimiento
    • Calidad
    Recursos humanos
    • Empleados
    • Reclutamiento
    • Vacaciones
    • Evaluaciones
    • Referencias
    • Flotilla
    Marketing
    • Redes sociales
    • Marketing por correo
    • Marketing por SMS
    • Eventos
    • Automatización de marketing
    • Encuestas
    Servicios
    • Proyectos
    • Registro de horas
    • Servicio externo
    • Soporte al cliente
    • Planeación
    • Citas
    Productividad
    • Conversaciones
    • Aprobaciones
    • IoT
    • VoIP
    • Artículos
    • WhatsApp
    Aplicaciones externas Studio de Odoo Plataforma de Odoo en la nube
  • Industrias
    Venta minorista
    • Librería
    • Tienda de ropa
    • Mueblería
    • Tienda de abarrotes
    • Ferretería
    • Juguetería
    Alimentos y hospitalidad
    • Bar y pub
    • Restaurante
    • Comida rápida
    • Casa de huéspedes
    • Distribuidora de bebidas
    • Hotel
    Bienes inmuebles
    • Agencia inmobiliaria
    • Estudio de arquitectura
    • Construcción
    • Gestión de bienes inmuebles
    • Jardinería
    • Asociación de propietarios
    Consultoría
    • Firma contable
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Manufactura
    • Textil
    • Metal
    • Muebles
    • Comida
    • Cervecería
    • Regalos corporativos
    Salud y ejercicio
    • Club deportivo
    • Óptica
    • Gimnasio
    • Especialistas en bienestar
    • Farmacia
    • Peluquería
    Trades
    • Personal de mantenimiento
    • Hardware y soporte de TI
    • Sistemas de energía solar
    • Zapateros y fabricantes de calzado
    • Servicios de limpieza
    • Servicios de calefacción, ventilación y aire acondicionado
    Otros
    • Organización sin fines de lucro
    • Agencia para la protección del medio ambiente
    • Alquiler de anuncios publicitarios
    • Fotografía
    • Alquiler de bicicletas
    • Distribuidor de software
    Descubre todas las industrias
  • Odoo Community
    Aprende
    • Tutoriales
    • Documentación
    • Certificaciones
    • Capacitación
    • Blog
    • Podcast
    Fortalece la educación
    • Programa educativo
    • Scale Up! El juego empresarial
    • Visita Odoo
    Obtén el software
    • Descargar
    • Compara ediciones
    • Versiones
    Colabora
    • GitHub
    • Foro
    • Eventos
    • Traducciones
    • Conviértete en partner
    • Servicios para partners
    • Registra tu firma contable
    Obtén servicios
    • Encuentra un partner
    • Encuentra un contador
    • Contacta a un consultor
    • Servicios de implementación
    • Referencias de clientes
    • Soporte
    • Actualizaciones
    GitHub YouTube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicita una demostración
  • Precios
  • Ayuda

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

  • CRM
  • e-Commerce
  • Contabilidad
  • Inventario
  • PoS
  • Proyectos
  • MRP
All apps
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Ayuda

Why XML in odoo ?

Suscribirse

Reciba una notificación cuando haya actividad en esta publicación

Se marcó esta pregunta
actionxmlodoo
3 Respuestas
2203 Vistas
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
Descartar
Avatar
Andry Ang
Mejor respuesta

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
Descartar
yahya sbini
Autor

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
Autor

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
Autor

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
Autor

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)
Mejor respuesta

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
Descartar
yahya sbini
Autor

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
Mejor respuesta

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
Descartar
¿Le interesa esta conversación? ¡Participe en ella!

Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.

Registrarse
Publicaciones relacionadas Respuestas Vistas Actividad
HOW CAN I GET CURRENT COMPANY ID IN CONTEXT OF ACTION USING JUST XML
action xml context odoo
Avatar
Avatar
1
jul 24
2625
Problemas al imprimir factura en el odoo
xml odoo
Avatar
0
ene 25
1933
How to post xml code
xml odoo
Avatar
1
mar 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
sept 23
3465
How can i call a specific module view when i log ? am using Odoo studio
action odoo
Avatar
0
dic 22
2505
Comunidad
  • Tutoriales
  • Documentación
  • Foro
Código abierto
  • Descargar
  • GitHub
  • Runbot
  • Traducciones
Servicios
  • Alojamiento en Odoo.sh
  • Soporte
  • Actualizaciones del software
  • Desarrollos personalizados
  • Educación
  • Encuentra un contador
  • Encuentra un partner
  • Conviértete en partner
Sobre nosotros
  • Nuestra empresa
  • Activos de marca
  • Contáctanos
  • Empleos
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Legal • Privacidad
  • Seguridad
الْعَرَبيّة 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 es un conjunto de aplicaciones de código abierto que cubren todas las necesidades de tu empresa: CRM, comercio electrónico, contabilidad, inventario, punto de venta, gestión de proyectos, etc.

La propuesta única de valor de Odoo es ser muy fácil de usar y estar totalmente integrado.

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