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