Bad number of "Action act window"

i am a bit lost. i am trying to construct a really small modules by retry-errors. but it seems that there is some “cache” somewhere.

when i try to view my tree i get

You are not allowed to read records “286” of “Action act window” because of at least one of these rules: User in groups

so i look in ir_action_act_window and the id is 287

in ir_action_act_window_view the id is 287

 id  | act_window | active |        create_date         | create_uid | sequence | view | write_date | write_uid 
-----+------------+--------+----------------------------+------------+----------+------+------------+-----------
 347 |        287 | t      | 2024-11-28 17:49:29.468503 |          0 |       20 |  582 |            |          
 346 |        287 | t      | 2024-11-28 17:49:29.468503 |          0 |       10 |  583 |            | 

where does tryton get this id ?

there is no number in ir_ui_menu

The link between the menu and the action is made with the keyword using à reference field so there no data integrity enforced.
Modifying XML record does not always work after a database update. When developing it is usually simpler to drop the database. Otherwise you may need to force the synchronization of the model data.

:wink: do you know where i can find the “code” that find the 286 ? where can i begin to seaérch ?

Otherwise you may need to force the synchronization of the model data.

where can i do that ?

I think i found

https://docs.tryton.org/latest/server/modules/ir/design/index.html#model-data

even if you delete models data , cache, somewhere is keept some older infos. even when you rsync… there is a ghost somewhere. :wink:

I could wipe out the all database but i would prefer find where things are kept…

File “/trytond/pool.py”, line 187, in get
return self._pool[self.database_name][type][name]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
KeyError: ‘formo_delatour.interet’

and in modele

[[“name”,“Interets”],[“res_model”,“party.formo_interets”]]

there is a thing hidden somewhere

I support @ced 's recommendation: When developing a module, it’s usually simpler to drop the database it something breaks. Don"t waste your time trying to fix the database in this case.

For developing I use sqlite databases, which I can create and drop as easy as backup and restore (without need of advanced permissions on my system).

Hint: For using sqlite add this to your trytond.conf

[database]
uri = sqlite://
path = /full/path/to/directory/where/db/resides/

ok, it is simpler to drop the database, reimport the datas you need to be like in production, reajust your script because id could be différent and verify that all your datas react as expected. it reminds me the time where the solutions was re-install your windows. :slight_smile:

would it be simpler to run a simple script that wipe the xml data :
5 or 6 or even 7 delete from … where … ?

I found 5 of them, i’ll find the others :slight_smile:

tyni-erp/open-erp/tryton-erp exists for maybe 15 years and in 15 years no one knows where goes an xml file in the db ?
there is only an ui_view, an action_act_window, an action_act_window_view and a menu_item and it is simpler to wipe the database and start from the beginning ?

Of course you can wipe the data which can (and usually will) be spread across multiple (referential) tables. However it is much easier to start from a database backup, ideally the production database which will be the target database of your development. It is simply much faster and saves you also from errors made in the cleanup.

If cleanup is required, most developers use the GUI (for small things) or proteus. We typically don’t care about keys in the DB, as this is what Tryton takes care of.