Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
2 Răspunsuri
3824 Vizualizări

Hello, I'm having trouble creating a custom module for Odoo. To begin, I created a test module but I keep getting this error:

Unable to load the book module: the file /tmp/tmpsvqqfu2g/book/security/ir.model.access.csv was not processed:

No record found for external ID 'model_test_model' in the field 'Model'

Required value missing for the field 'Model' (model_id)


Below is the code I wrote for the test:

__manifest__.py

```python

{

    'name': 'Test Module',

    'version': '1.0',

    'depends': ['base'],

    'data': [

        'security/ir.model.access.csv',

        'views/book_views.xml',

    ],

    'installable': True,

    'auto_install': False,

}

```

__init__.py

```python

from . import models

```

models/__init__.py

```python

from . import book

```

models/book.py

```python

from odoo import fields, models


class TestModel(models.Model):

    _name = "test_model"

    _description = "Test Model"


    name = fields.Char()

```

security/ir.model.access.csv

```csv

id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink

access_test_model,model_test_model,model_test_model,base.group_user,1,0,0,0

```

views/book_views.xml

```xml

   

        test.model.tree

        test_model

       

           

               

           

       

   

   

        test.model.form

        test_model

       

           

               

                   

                       

                   

               

           

       

   

```


Can someone help me? Thanks in advance.

Imagine profil
Abandonează
Cel mai bun răspuns

Hi,
It seems you are trying to import the app to the database, as your module contains python files and a new model is defined, you cannot use this option. The import option is for the modules with xml/data files.

So you have to add your modules to the addons path and update the app list and install it in the db.

Thanks

Imagine profil
Abandonează
Autor Cel mai bun răspuns

Hi, thank you very much, I solved the problem.

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
0
iul. 25
2073
2
nov. 24
7926
2
oct. 24
4475
2
aug. 24
2510
3
iul. 24
9004