Перейти к содержимому
Odoo Меню
  • Войти
  • Попробовать бесплатно
  • Модули
    Финансы
    • Бухгалтерия
    • Выставление счетов
    • Расходы
    • Таблицы
    • Документооборот
    • Подпись
    Продажи
    • CRM
    • Продажи
    • POS Магазин
    • POS Ресторан
    • Подписки
    • Аренда
    Вебсайты
    • Конструктор вебсайтов
    • eCommerce
    • Блог
    • Форум
    • Онлайн-чат
    • Электронное обучение
    Логистика
    • Склад
    • Производство
    • PLM
    • Закупки
    • Обслуживание
    • Качество
    Отдел кадров
    • Сотрудники
    • Подбор персонала
    • Отпуска
    • Оценка персонала
    • Реферальная программа
    • Автопарк
    Маркетинг
    • SMM
    • E-mail рассылки
    • СМС рассылки
    • Мероприятия
    • Автоматизация маркетинга
    • Опросы
    Услуги
    • Проекты
    • Табели
    • Выездной сервис
    • Поддержка
    • Планирование
    • Встречи
    Продуктивность
    • Обсуждения
    • Согласование
    • IoT
    • VoIP-телефония
    • Knowledge
    • WhatsApp
    Сторонние приложения Модуль Студия Odoo Платформа Odoo Cloud
  • Индустрии
    Розничная торговля
    • Книжный магазин
    • Магазин одежды
    • Мебельный магазин
    • Продуктовый магазин
    • Строительный магазин
    • Магазин игрушек
    Гостинично-ресторанный бизнес
    • Бар и паб
    • Ресторан
    • Фастфуд
    • Гостевой дом
    • Дистрибьютор напитков
    • Отель
    Недвижимость
    • Агентство недвижимости
    • Архитектурное бюро
    • Строительство
    • Управление недвижимостью
    • Ландшафтный дизайн
    • Товарищество собственников жилья
    Консалтинг
    • Бухгалтерская фирма
    • Партнер Odoo
    • Маркетинговое агентство
    • Юридическая фирма
    • Подбор персонала
    • Аудиторское бюро
    Производство
    • Текстиль
    • Металл
    • Мебель
    • Продукты питания
    • Пивоварня
    • Корпоративные сувениры
    Здоровье и фитнес
    • Спортивный комплекс
    • Магазин оптики
    • Фитнес-клуб
    • Велнес-центр
    • Аптека
    • Салон красоты
    Услуги
    • Специалист по бытовым услугам
    • Продажа и обслуживание IT-оборудования
    • Солнечные энергосистемы
    • Производство обуви
    • Клининг
    • Системы ОВКВ
    Прочее
    • Некоммерческая организация
    • Консалтинг в сфере устойчивого развития
    • Аренда рекламных щитов
    • Бизнес по фотосъемке
    • Прокат велосипедов
    • Реселлер программного обеспечения
    Все индустрии
  • Community
    Обучение
    • Видео уроки
    • Документация
    • Сертификация
    • Тренинг
    • Блог
    • Подкаст
    Образование и развитие
    • Образовательная программа
    • Деловая игра Scale Up!
    • Экскурсия в офис Odoo
    ПО
    • Скачать
    • Сравнить версии
    • Релизы
    Сотрудничество
    • Github
    • Форум
    • Мероприятия
    • Перевод
    • Стать партнером
    • Услуги для партнеров
    • Зарегистрировать бухгалтерскую фирму
    Услуги
    • Найти партнера
    • Найти бухгалтера
    • Встреча с экспертом
    • Услуги по внедрению
    • Отзывы клиентов
    • Поддержка
    • Обновления
    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:

  • CRM
  • e-Commerce
  • Бухгалтерия
  • Склад
  • PoS
  • Проекты
  • MRP
All apps
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Все посты Люди Значки
Теги (Смотреть все)
odoo accounting v14 pos v15
Об этом форуме
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Все посты Люди Значки
Теги (Смотреть все)
odoo accounting v14 pos v15
Об этом форуме
Помощь

Why XML in odoo ?

Подписаться

Получайте уведомления о появлении активности в этом посте

Этот вопрос был отмечен
actionxmlodoo
3 Ответы
2222 Представления
Аватар
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
Аватар
Отменить
Аватар
Andry Ang
Лучший ответ

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
Аватар
Отменить
yahya sbini
Автор

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
Автор

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
Автор

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
Автор

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

Аватар
Ray Carnes (ray)
Лучший ответ

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
Аватар
Отменить
yahya sbini
Автор

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 ?

Аватар
Apiuser
Лучший ответ

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
Аватар
Отменить
Не оставайтесь в стороне – присоединяйтесь к обсуждению!

Создайте аккаунт сегодня, чтобы получить доступ к эксклюзивным функциям и стать частью нашего замечательного сообщества!

Регистрация
Похожие посты Ответы Просмотры Активность
HOW CAN I GET CURRENT COMPANY ID IN CONTEXT OF ACTION USING JUST XML
action xml context odoo
Аватар
Аватар
1
июл. 24
2633
Problemas al imprimir factura en el odoo
xml odoo
Аватар
0
янв. 25
1942
How to post xml code
xml odoo
Аватар
1
мар. 25
652
How can I include my generic qweb view on my Odoo 16 Form View using JS or Controller
xml odoo
Аватар
Аватар
1
сент. 23
3472
How can i call a specific module view when i log ? am using Odoo studio
action odoo
Аватар
0
дек. 22
2524
Сообщество
  • Видео уроки
  • Документация
  • Форум
Открытый исходный код
  • Скачать
  • Github
  • Runbot
  • Перевод
Услуги
  • Хостинг Odoo.sh
  • Поддержка
  • Обновление
  • Индивидуальные решения по доработке
  • Образование
  • Найти бухгалтера
  • Найти партнера
  • Стать партнером
О нас
  • Наша компания
  • Активы бренда
  • Cвяжитесь с нами
  • Вакансии
  • Мероприятия
  • Подкаст
  • Блог
  • Клиенты
  • Правовые документы • Конфиденциальность
  • Безопасность
الْعَرَبيّة 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 – это набор бизнес-модулей с открытым исходным кодом, который закроет все потребности вашей компании: CRM, E-commerce, Бухгалтерия, Склад, POS, управление проектами и др.

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