Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
2979 Vistas

I'm using the Odoo development essentials book and have been through the creating a new module.

The book introduces creating a todo task module and on the page titled 'Row-level Access'  when defining the domain _force field in the security/todo_access_rules.xml file the value is:

<field name="domain_force">[('create_uid','=',user.id)]</field>


now this is all withn the development database v8dev, I accidentally entered the value 'user_id' instead of 'user.id' in the field definition, needless to say after starting odoo uing the upgrade command, I found when selecting the todo task in Odoo itself  I got an error which basically indicated that user_id did not exist.

I then corrected this line in the file security/todo_access_rules.xml file

and then ran command ./odoo.py -d v8dev -u todo_app to upgrade the todo_app

so that I could ensure everything was updated, however I continued to get the same error so the system was still referring to the incorrect value 'user_id' instead of 'user.id'

To fix this I dropped the DB v8dev, recreated it and then ran the same command to start  the server with module upgrades and this fixed the problem.

However I'd like to know why when I used the start command with upgrades to the todo_app module, the system did not pick up the correct definition from the updated todo_access_rules.xml file?  Is it that although the modle is being upgraded the database itself is not being updated again?

Avatar
Descartar
Mejor respuesta

hello, 

your rule are probably in a <data noupdate="1">...

So, when you update a module, this data are not updated.

If you want avoid to install all the database, you can do a "-i to_do" to force reinstall the module and so update your rules....


Avatar
Descartar