erplibre/script
Mathieu Benoit 00eb0a3c7a [ADD] migration: find the COW copies that drifted from their module view
Third COW incident of this migration, and the first two tools did not cover
it. A copy freezes the module view it came from; version after version the
MODULE view is modernised and the copy is not, until a child xpath lands on an
anchor the copy never had:

  Element '<xpath expr="//head/script[@id='web.layout.odooscript']">'
  cannot be located in parent view

On 14.0 -> 15.0 that was web.layout, copied in the 12.0 era: no id on the
script tag, QWeb still saying t-raw. It had survived only because the 14.0
module xpath carried a fallback — //head/script[@id='…'] | //head/script
[last()] — that 15.0 removed. The breakage was years old; 15.0 merely stopped
hiding it.

The test is DIFFERENTIAL, and it has to be. Resolving a child's xpath against
its parent's own arch proves nothing: Odoo resolves against the COMBINED arch
of the whole chain, so a child of website.layout legitimately targets //header
coming from an ancestor. Measured on the real database, that naive rule
reported 5 copies where only 1 had a problem. Resolving twice — against the
module twin and against the copy — and keeping only what the twin satisfies
and the copy cannot, isolates drift and nothing else.

Two accuracy fixes the real data forced:
  · inactive children are skipped; Odoo never applies them
  · a missing lxml is now a LOUD failure. The first version fell back to
    « everything resolves », so the checker answered « all clean » while
    checking nothing — the worst possible outcome for a checker. Verified: the
    bare system python3 has no lxml, .venv.erplibre does.

--reset copies the module arch over the copy, after saving the previous arch
to a timestamped file and printing the diff, because a copy can hold a real
customisation buried in the drift — on web.layout it was one <meta viewport>
among six differences.

Timing matters: drift only exists once the module views carry the new version,
so run this AFTER OpenUpgrade and BEFORE update_addons_all. Run on the 14.0
database it finds nothing about web.layout, and rightly so — there the module
view says t-raw too.

Verified end to end on a scratch database rebuilt from the real arches:
detection of the exact reported failure, dry-run changing nothing, --apply
resetting it, the backup holding the previous arch, and a clean re-check.
Then across the four migration databases, where it flags two latent drifts
(website_sale.product, website_blog.blog_post_complete) that no version bump
has surfaced yet.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-08-02 03:57:26 -04:00
..
addons [IMP] script: update copyright year to 2026 2026-03-11 23:16:05 -04:00
apache [ADD] apache configuration template 2025-10-31 01:31:21 -04:00
code [UPD] script Format 2026-03-14 23:26:31 -04:00
code_generator [IMP] script: update copyright year to 2026 2026-03-11 23:16:05 -04:00
config [IMP] script: update copyright year to 2026 2026-03-11 23:16:05 -04:00
database [UPD] script Format 2026-03-14 23:26:31 -04:00
deployment [IMP] script: update copyright year to 2026 2026-03-11 23:16:05 -04:00
docker [IMP] script: update copyright year to 2026 2026-03-11 23:16:05 -04:00
execute [FIX] migration: stop recording failed steps as successful 2026-07-31 23:22:02 -04:00
fork_github_repo [ADD] Multilingual translation of all documentation (EN/FR) 2026-03-04 22:23:52 -05:00
git [ADD] installation: add optional extra modules (CybroOdoo) 2026-05-19 15:17:45 -04:00
ide [UPD] script Format 2026-03-14 23:26:31 -04:00
install [FIX] install: poetry — rejeu -vvv (et non -v) à l'échec pour la vraie cause 2026-07-30 01:56:04 -04:00
maintenance [IMP] script: update copyright year to 2026 2026-03-11 23:16:05 -04:00
manifest [FIX] update_manifest_local_dev: git daemon doublon -> exit 1 2026-07-31 01:59:36 -04:00
nginx [IMP] script: update copyright year to 2026 2026-03-11 23:16:05 -04:00
odoo [ADD] migration: find the COW copies that drifted from their module view 2026-08-02 03:57:26 -04:00
performance [ADD] script performance: use tool to test request per second on website 2025-11-01 01:09:32 -04:00
poetry [IMP] script: update copyright year to 2026 2026-03-11 23:16:05 -04:00
postgresql/migration [UPD] script Format 2026-03-14 23:26:31 -04:00
process [IMP] script: update copyright year to 2026 2026-03-11 23:16:05 -04:00
qemu [IMP] qemu: generate an SSH key during host setup when none exists 2026-08-01 04:49:03 -04:00
restful [IMP] script: update copyright year to 2026 2026-03-11 23:16:05 -04:00
selenium [FIX] selenium: retirer -remote-allow-system-access (refusé par geckodriver récent) 2026-07-30 15:15:32 -04:00
shell_script_odoo [ADD] brin_advisor brin_cluster 2026-07-15 04:38:38 -04:00
statistic [IMP] script: update copyright year to 2026 2026-03-11 23:16:05 -04:00
system [ADD] script system: search_docker_compose_erplibre.sh 2024-05-03 23:13:59 -04:00
systemd [IMP] script: update copyright year to 2026 2026-03-11 23:16:05 -04:00
terminal [IMP] todo support odoo upgrade 2025-10-31 01:43:26 -04:00
test [IMP] script: update copyright year to 2026 2026-03-11 23:16:05 -04:00
todo [ADD] migration: a read-only statistics screen, and a way out 2026-08-02 03:16:50 -04:00
version [FIX] update_env_version: --with_extra clone CybroOdoo + config.conf 2026-07-31 01:18:14 -04:00
__init__.py [IMP] Copy ERPLibre from https://github.com/mathbentech/InstallScript 2020-04-20 03:56:45 -04:00
generate_config.sh WIP 2026-05-19 15:17:45 -04:00
lib_asyncio.py [IMP] script: update copyright year to 2026 2026-03-11 23:16:05 -04:00
make.sh [FIX] script python: missing color log error 2024-05-03 23:13:59 -04:00
open_terminal_code_generator.sh [IMP] todo support odoo upgrade 2025-10-31 01:43:26 -04:00