2 Commits
Author SHA1 Message Date
Romain Derie ce345b5947 [IMP] website: avoid copying cdn enabled website setting on db duplicate
When a DB is duplicated, it's going through the neutralize process
which is helpful to clean stuff that will be messing around with the
duplicated DB.

The CDN should actually be part of that. Since a CDN url is bound to a
domain, when you copy the database (and most likely run it on its own
different domain), it just won't properly work.

Indeed, if you setup a CDN X for domain A and then copy a DB to domain
B, this will happen:
- You access website B
- You try to load an img, which is using CDN X URL
- CDN X URL is fetching the ressource on DB A instead of DB B, which
  might or might not exist (an image will likely share the same path so
  it might work, but for assets url it might not if the bundle url has
  changed)

In the event of the assets having changed, they will never be loaded and
the duplicated DB won't be loading properly.
The only workaround in this case is to switch to debug mode to bypass
the post processing and so the CDN url transform.

Useful commits:
- Introduction of neutralize
  https://github.com/odoo/odoo/pull/67825
- Conversion of neutralize from ORM calls to raw SQL
  https://github.com/odoo/odoo/commit/e5dbded9bb363351feff7ca8a56c7f8a6860f492

opw-3880102

closes odoo/odoo#163210

X-original-commit: ab6493ae9fff218a43df12829011a4f642902114
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2024-04-25 11:21:55 +00:00
Laurent Desausoi 7593c073d2 [IMP] core: use inert SQL based neutralization
Before this commit the neutralize system introduced in v16 was using ORM
methods in order to change appropriate records. Although flexible, this approach
could lead to call some methods with side effects while neutralizing
(eg: overloads of write).

This patch converts the neutralize system to a safer "inert" SQL based approach
by migrating the generic method _neutralize to SQL files exposed in the
data folder.

Task id: 2961687

closes odoo/odoo#102792

X-original-commit: e5dbded9bb363351feff7ca8a56c7f8a6860f492
Related: odoo/enterprise#32580
Signed-off-by: Fabien Meghazi <fme@odoo.com>
2022-10-09 22:04:00 +02:00