Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
2 Replies
1447 Tampilan

In Apps View, there is a point "Import Modules". If you click it you get this dialog:


The yellow note says: "you can only import data modules (.xml files and static assets)".


How can I do this?


I have made this failed test:

I have changed a setting (+86 into +81) in the german tax report (which is XML based) on the GUI.

Then I have downloaded the XML file which should be the base for this report:

https://github.com/odoo/odoo/blob/tmp.saas-18.1/addons/l10n_de/data/account_account_tags_data.xml

I saved it as "account_account_tags_data.xml" and ziped it.

I have uploaded the ZIP using this dialog. There was no error message. 

But after reloading the tax report, the changed word is still changed

So the upload of the original XML file have not resulted in overwriting my test change.


What is the correct way to do this?

Avatar
Buang
Jawaban Terbai

To make changes or upload modules in the Odoo Online version, follow these steps:

  1. Create Your Own Module: You need to create a custom module according to Odoo specifications. You can use the odoo-bin scaffold command, or ask any language model (such as ChatGPT, Bing, Gemini, or DeepSeek) for guidance on creating modules.
  2. Module Structure: Your custom module should minimally include:
    • A __manifest__.py file: This file defines your module's metadata, dependencies, and references to your modified XML files.
    • A /views/ folder: This folder contains your XML files.
  3. Modifying XML Files: Editing XML files in Odoo is not as simple as direct modification. You need to use XPath to locate the correct elements and make your changes.

Avatar
Buang
Penulis

Thx. My problem before was, i have not tried it whith with __manifest__.py, because it is a python file. I used the data folder, not the views folder, because in the original module, it was also in this folder.

Penulis Jawaban Terbai

it says "only import ... xml and static assets".

Now i have found a way with ignoring this!


Even if "__manifest__.py" is a python file, this manifest file is needed also for data only models !

So i created a folder called like the original model: "l10n_de" (other names resulted in errors)

In this i have putten "__manifest__.py"

And i created an folder "data", in which i have putten my "account_account_tags_data.xml" file.

I zipped the folder "l10n_de" and uploaded it.


Contend of my "__manifest__.py":

{

'name': 'Germany - Accounting - My Tax Report',

'countries': ['de'],

'author': '',

'version': '2.1',

'category': 'Accounting/Localizations/Account Charts',

'description': "Update of VAT Tax-Report for reduced taxes in 2020",

'depends': [

  'base_iban',

  'base_vat',

  'l10n_din5008',

  'account',

],

'auto_install': ['account'],

'data': [

  'data/account_account_tags_data.xml'

],

'post_init_hook': '_post_init_hook',

'license': 'LGPL-3',

}


After importing this ZIP file, it works! My changed settings are gone, because the settings from the uploded package come into effect!

Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
2
Mar 23
2676
0
Sep 24
1059
0
Apr 17
4803
3
Mei 16
7472
2
Mar 15
5461