Skip to Content
Menu
This question has been flagged

I want to install my custom module to show tree view, but the apps not showing in apps list
here's my codes

.py

from odoo import models, fields, apiimport requests
class PokemonCustom(models.Model):    _name = 'pokemon.list'    _description = 'Pokemon List'
    pokemon_id = fields.Integer(string='Pokemon ID', help='ID of the Pokemon')    pokemon_name = fields.Char(string='Pokemon Name', help='Name of the Pokemon')
    def get_all_pokemon(self):        response = requests.get(f'https://pokeapi.co/api/v2/pokemon?limit=10000')                if response.status_code == 200:            data = response.json()
            for pokemon in data['results']:                pokemon_name = pokemon['name']                pokemon_id = int(pokemon['url'].split('/')[-2])
                existing_pokemon = self.search([('pokemon_id', '=', pokemon_id)])                if not existing_pokemon:                    self.create({                        'pokemon_name': pokemon_name,                        'pokemon_id': pokemon_id                    })
    def get_pokemon(self):        random_number = self.get_unique_random_number()        response = requests.get(f'https://pokeapi.co/api/v2/pokemon/{random_number}/')
        if response.status_code == 200:            data = response.json()
            pokemon_name = data['name']            pokemon_id = data['id']
            self.write({                'pokemon_name': pokemon_name,                'pokemon_id': pokemon_id            })


.xml 

     
          Pokemon List      pokemon.list                                                   
          Pokemon List      pokemon.list      tree,form   
      


manifest

# -*- coding: utf-8 -*-{    'name': "Pokemon List",
    'summary': "Manage Pokémon in Odoo",
    'description': """Long description of the module's purpose.    """,
    'author': "Your Company",    'website': "https://www.yourcompany.com",
    'category': 'Uncategorized',    'version': '0.1',    'installable': True,    'application': True,
    'depends': ['base', 'contacts'],
    'data': [        'views/pokemon.xml',        'views/res_partner.xml',        'security/ir.model.access.csv'    ],
    'demo': [        'demo/demo.xml',    ],
    'images': [        'static/description/icon.png',    ],}


security

id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_pokemon_custom,pokemon.list,model_pokemon_list,base.group_user,1,1,1,1


Avatar
Discard
Best Answer

Thank you, I tried all the instruction, but still the custom module not in app list.

Avatar
Discard
Best Answer

To ensure that your custom module shows up in Odoo, follow these steps:


1. Update odoo.conf:

   In your odoo.conf file, specify the path to your custom addons directory. Edit the addons_path parameter to include the path to both the standard addons and your custom addons. For example:


     

     addons_path = /path-to-your-addons/addons, /path-to-your-addons/custom_addons,

     


2. Module Naming and Manifest:

   Ensure that your module name has no spaces, and it should be in the format your_module_name. 

   Verify the spelling of the __manifest__.py file.


3. Manifest Configuration:

   In your module's __manifest__.py file:

     Place the data files first, followed by security files, and then your view files.

     Make sure that the security declarations are positioned at the top of the data list.


By following these guidelines, you can enhance the visibility of your custom module in Odoo and avoid potential issues with the module not showing up. Always double-check the paths, file names, and the structure of your __manifest__.py for accurate configuration. If you encounter any difficulties, reviewing these aspects should help resolve the problem.


Regards

Avatar
Discard
Related Posts Replies Views Activity
4
Apr 20
26883
2
Sep 18
2659
3
Jan 18
3951
1
Feb 17
3439
1
Jul 21
16005