Skip to Content
Menu
This question has been flagged
3 Replies
15984 Views

good afternoon,
when a bbdd is restored or odoo is migrated from one container to another, you must always correct the assets (regenerate Assets Bundles) manually or execute a script in the database, there is some way to do it automatically so that Always available immediately.
you have the services in aws and every time you run autoscaling, all the bbdd stop working.
I will appreciate your help.

Avatar
Discard
Best Answer

not a complete solution, but the following article might help:

https://medium.com/@reedrehg/odoo-images-and-attachments-explaining-and-regenerating-assets-d1eb7fe8a3ed

Avatar
Discard
Best Answer

Yes, when a database is restored or Odoo is migrated from one container to another, it is indeed necessary to regenerate asset bundles and refresh the base module to ensure everything functions correctly. This process can be done from the Odoo backend by going to Settings > Technical > Frontend > Assets and choosing to regenerate bundles. Additionally, updating the base module from the backend can resolve many initialization issues that may arise from migrations or container changes.

To automate this, especially for AWS autoscaling, you might consider running a script to refresh the assets and update the base module upon container startup. This can typically be done with a custom startup script using odoo -u base --load=web,web_asset to reload the necessary assets and modules each time a new instance is launched.

Let me know if you need further assistance with scripting this automation!

Avatar
Discard
Best Answer

Just in case someone stumbles over this question and is looking for a solution:

One way would be to automate the deletion of the attachments either via XML RPC with the domain 

domain = ["&", ("res_model", "=", "ir\\.ui\\.view"\\),\\ "\\|",\\ \\("name",\\ "=like",\\ "%\\.assets_%\\.css"\\),\\ \\("name",\\ "=like",\\ "%\\.assets_%\\.js"\\)\\]

or\ directly\ in\ the\ database:

delete\ from\ ir_attachment\ where\ res_model\ =\ 'ir\.ui\.view'\ and\ \(name\ ilike\ '%\.assets_%\.css'\ or\ name\ ilike\ '%\.assets_%\.js'\)

The debug javascript menu does it similar

Avatar
Discard
Related Posts Replies Views Activity
4
Mar 24
11010
2
Nov 24
275
1
Oct 24
335
4
Oct 24
327
2
Oct 24
364