Skip ke Konten
Odoo Menu
  • Login
  • Uji coba gratis
  • Aplikasi
    Keuangan
    • Akuntansi
    • Faktur
    • Pengeluaran
    • Spreadsheet (BI)
    • Dokumen
    • Tanda Tangan
    Sales
    • CRM
    • Sales
    • POS Toko
    • POS Restoran
    • Langganan
    • Rental
    Website
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Rantai Pasokan
    • Inventaris
    • Manufaktur
    • PLM
    • Purchase
    • Maintenance
    • Kualitas
    Sumber Daya Manusia
    • Karyawan
    • Rekrutmen
    • Cuti
    • Appraisal
    • Referensi
    • Armada
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Acara
    • Otomatisasi Marketing
    • Survei
    Layanan
    • Project
    • Timesheet
    • Layanan Lapangan
    • Meja Bantuan
    • Planning
    • Appointment
    Produktivitas
    • Diskusi
    • Approval
    • IoT
    • VoIP
    • Pengetahuan
    • WhatsApp
    Aplikasi pihak ketiga Odoo Studio Platform Odoo Cloud
  • Industri-Industri
    Retail
    • Toko Buku
    • Toko Baju
    • Toko Furnitur
    • Toko Kelontong
    • Toko Hardware
    • Toko Mainan
    Makanan & Hospitality
    • Bar dan Pub
    • Restoran
    • Fast Food
    • Rumah Tamu
    • Distributor Minuman
    • Hotel
    Real Estate
    • Agensi Real Estate
    • Firma Arsitektur
    • Konstruksi
    • Estate Management
    • Perkebunan
    • Asosiasi Pemilik Properti
    Konsultansi
    • Firma Akuntansi
    • Mitra Odoo
    • Agensi Marketing
    • Firma huku
    • Talent Acquisition
    • Audit & Sertifikasi
    Manufaktur
    • Tekstil
    • Logam
    • Perabotan
    • Makanan
    • Brewery
    • Corporate Gift
    Kesehatan & Fitness
    • Sports Club
    • Toko Kacamata
    • Fitness Center
    • Wellness Practitioners
    • Farmasi
    • Salon Rambut
    Perdagangan
    • Handyman
    • IT Hardware & Support
    • Sistem-Sistem Energi Surya
    • Pembuat Sepatu
    • Cleaning Service
    • Layanan HVAC
    Lainnya
    • Organisasi Nirlaba
    • Agen Lingkungan
    • Rental Billboard
    • Fotografi
    • Penyewaan Sepeda
    • Reseller Software
    Browse semua Industri
  • Komunitas
    Belajar
    • Tutorial-tutorial
    • Dokumentasi
    • Sertifikasi
    • Pelatihan
    • Blog
    • Podcast
    Empower Education
    • Program Edukasi
    • Game Bisnis 'Scale Up!'
    • Kunjungi Odoo
    Dapatkan Softwarenya
    • Download
    • Bandingkan Edisi
    • Daftar Rilis
    Kolaborasi
    • Github
    • Forum
    • Acara
    • Terjemahan
    • Menjadi Partner
    • Layanan untuk Partner
    • Daftarkan perusahaan Akuntansi Anda.
    Dapatkan Layanan
    • Temukan Mitra
    • Temukan Akuntan
    • Temui penasihat
    • Layanan Implementasi
    • Referensi Pelanggan
    • Bantuan
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dapatkan demo
  • Harga
  • Bantuan

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

  • CRM
  • e-Commerce
  • Akuntansi
  • Inventaris
  • PoS
  • Project
  • MRP
All apps
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Help

Define an unchangeable external id for xml files on data folder

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
data.xmlexternal_idodoo12.0
1 Balas
8601 Tampilan
Avatar
Paulo Matos

Hello everyone,

I am working with Odoo v12 and having some problems on understanding "external IDs".
As per my understanding, an external ID is created on 2 situations:

1- When we create a record (by installing a module, adding data to tables, etc.), Odoo takes care of it automatically. In this case the external ID name is provided by Odoo itself;
 2- On a custom module by "forcing" the external ID name using the "<record id...>"

So, based on that, I have created the following external id for my account data for a localization module:

      <record id="ao_1161" model="account.account.template">
           <field name="code">11.6.1</field>
           <field name="reconcile" eval="False"/>
           <field name="name">Taras e vasilhame</field>
           <field name="user_type_id" ref="account.data_account_type_current_assets"/>
           <field name="chart_template_id" ref="ao_chart_template"/>
      </record>

So, if I correctly understood the external ID functionality, when my module is installed, this record for this specific account will have the following external ID:

          module_name.ao_1161

The problem is that when I install my module, I can see that the external ID for this record is:

          module_name.1_ao_1161

This is raising a problem because all modules I use that depends on this specific record are failing to install because they refer to "module_name.ao_1161" and it does not exist on the database...

Note: This is only happening with the accounts from my chart of accounts. Other external IDs are kept as defined on xml, for instance:

      <record id="money_sale_journal" model="account.journal">
            <field name="name">Sale Money Sales</field>
            <field name="code">VDC</field>
            <field name="type">sale</field>
            <field name="sequence_number_next">1</field>
            <field name="sequence_id" ref="sequence_customer_moneysale"/>
            <field name="default_debit_account_id" ref="l10n_ao_account.ao_6111"/>
            <field name="default_credit_account_id" ref="l10n_ao_account.ao_6111"/>
      </record>

The external ID for the above record is kept as: module_name.money_sale_journal

Can anyone help me correctly understand how can I keep the original external ID defined on the custom module for the chart of accounts records or other information saved on the "data" folder?

I think is something related with the xml file base location.

The chart of accounts data is on "data" folder under my module structure.
The other xml files (the ones that external ids are preserved) are on "views" folder under my module structure.

So, how can I make the desired records located on "data" to keep the original "external ids"?

Thank you everyone for helping me

Best regards

Paulo

1
Avatar
Buang
Avatar
Paresh Wagh
Jawaban Terbai

Hi Paulo: 

The external id, if specified, is retained "as is" by Odoo i.e. when you install the module, the id will be set to "<module>.<record id specified by you>". It does not matter where the file is located. The issue you are facing with the chart of accounts theoretically should not happen. You may want to double check to make sure this is not happening because of a typo.

Also, try specifying the complete name (including the module id) in the record id. This is not a best practice but is an alternate way of specifying the id. For example,

      <record id="module_name.ao_1161" model="account.account.template">

<field name="code">11.6.1</field>
<field name="reconcile" eval="False"/>
<field name="name">Taras e vasilhame</field>
<field name="user_type_id" ref="account.data_account_type_current_assets"/>
<field name="chart_template_id" ref="ao_chart_template"/>
    </record>
1
Avatar
Buang
Paulo Matos
Penulis

Hi @Paresh,

Tank you very much.

You're right when you say this is not a normal behaviour.

I have doubble checked and all my account are acting like that.

After making some tests, I have found something which seems to be strange to me.

My chart data definition refers to the "account.account.template"

Here, my account data is set as:

<record id="ao_1111" model="account.account.template">.

Note: Tested with "l10n_ao_account.ao_1111" and see no changes on external IDs.

After installing the module, I look for the external IDs (just for the last part) and I see that the accounts are set on both "account.account.template" and "account.account" modules.

Is this correct?

I think "account.account.template" is just a template to be used for future reference, for instance on multicompany environments where Odoo gets the chart data from this model.

The "account.account" module, contains the chart data actually installed for the actual company...

So, my actual working chart of accounts is on "account.account" and this is where the problem is, because on the "account.account", the external ID is changed to "l10n_ao_account.1_ao_1111" and this is where problem resides.

On the "account.account.template", the external ID is kept as "l10n_ao_account.ao_1111" which is correct.

My problem is I want to set default values for a new journal on the "default_debit_account_id" field which is has a relation with "account.account" model.

Even thinking that I have this problem, when I install my module "exactly" from the "module name" (from my localization module with no modules installed), everything runs fine because Odoo will install all required dependencies.

If I try to instal this module on a database with existing modules, for instance "account" module, it fails to install because the external id... "1_ao_1111" is not found.

Thank you

Paulo

Paresh Wagh

Hi Paulo: There seem to be 3 pieces to the puzzle here. Chart Template (account.chart.template), Account Template (account.account.template) and Chart of Accounts (account.account). The 1st two define the core structure of the localization template. The 3rd seems to be a copy that gets created for each company that uses the template. It seems like the "1" in the id of the account.account records you are seeing is referring to the internal (database) id of the main company (res.company).

You may find it beneficial to study how the generic coa localization has been defined in the system. Here's a link to the l10n_generic_coa module.

https://github.com/odoo/odoo/tree/12.0/addons/l10n_generic_coa

Hope this helps.

Paresh Wagh

This link in the same module may also help since it is an example of creating demo data.

https://github.com/odoo/odoo/blob/12.0/addons/l10n_generic_coa/data/account_invoice_demo.xml

Paresh Wagh

This may provide a clue that answers the question you have about how to set the default_debit_account_id.

https://github.com/odoo/odoo/blob/12.0/addons/account/test/account_minimal_test.xml#L223

Paulo Matos
Penulis

@Paresh,

You're great my friend.

I will look at every single peace of code here and will update you about what I am missing here.

Thank you once again

Best regards and have great weekend

Paulo

Menikmati diskusi? Jangan hanya membaca, ikuti!

Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!

Daftar
Post Terkait Replies Tampilan Aktivitas
Expected singleton: hr.emp.travel.location(62, 63)
odoo12.0
Avatar
Avatar
Avatar
2
Okt 25
2006
How to write Record Rule with domain based on the company_dependent Fields Diselesaikan
odoo12.0
Avatar
Avatar
Avatar
3
Okt 23
10800
loan request
odoo12.0
Avatar
Avatar
1
Sep 23
4038
sum Colum of based on id
odoo12.0
Avatar
Avatar
1
Mei 23
3013
How to make pagination that has a table in qweb
odoo12.0
Avatar
Avatar
2
Apr 23
3763
Komunitas
  • Tutorial-tutorial
  • Dokumentasi
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Terjemahan
Layanan
  • Odoo.sh Hosting
  • Bantuan
  • Peningkatan
  • Custom Development
  • Pendidikan
  • Temukan Akuntan
  • Temukan Mitra
  • Menjadi Partner
Tentang Kami
  • Perusahaan kami
  • Aset Merek
  • Hubungi kami
  • Tugas
  • Acara
  • Podcast
  • Blog
  • Pelanggan
  • Hukum • Privasi
  • Keamanan
الْعَرَبيّة 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 adalah rangkaian aplikasi bisnis open source yang mencakup semua kebutuhan perusahaan Anda: CRM, eCommerce, akuntansi, inventaris, point of sale, manajemen project, dan seterusnya.

Mudah digunakan dan terintegrasi penuh pada saat yang sama adalah value proposition unik 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