Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
3 Replies
28982 Tampilan

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
Buang
Jawaban Terbai

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

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

Avatar
Buang
Jawaban Terbai

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
Buang
Jawaban Terbai

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
Buang
Post Terkait Replies Tampilan Aktivitas
4
Mar 24
12252
2
Agu 25
2365
1
Jul 25
877
1
Agu 25
1151
0
Mei 25
1328