Compare commits

..

3 Commits

Author SHA1 Message Date
Stéphan Sainléger
969414e649 [IMP] detect missing pos.order hashes and regenerate them 2026-05-28 11:45:18 +02:00
Stéphan Sainléger
f9d678508b [IMP] add Odoo addons known changes 2026-05-28 11:45:18 +02:00
Stéphan Sainléger
55218946c5 [NEW] add detection of obsolete, Odoo core integrated or renamed addons 2026-05-28 11:45:18 +02:00

View File

@@ -121,38 +121,8 @@ EOF
echo "Fixing company-dependent columns for Odoo 18..."
query_postgres_container "$COMPANY_DEPENDENT_FIX_SQL" ou18 || exit 1
# ============================================================================
# CLEAN: Reset l10n_fr_secure_sequence_number field from table pos_order
# In Odoo 18, several checks are done concerning the pos order, for instance
# that there is no missing number in the order sequence. BUT, if add-on l10n_fr_pos_cert
# has been installer AFTER the creation of some pos orders, then the l10n_fr_secure_sequence_number
# is not filled correctly for all the pos order, and v18 checks fails.
# Solution: reset all the l10n_fr_secure_sequence_number values so that there
# is no missing sequence.
# ============================================================================
RESET_SECURE_SEQUENCE_NUMBER_SQL=$(cat <<'EOF'
DO $$
BEGIN
-- res.partner.barcode (base module)
IF EXISTS (SELECT 1 FROM information_schema.columns
WHERE table_name = 'pos_order' AND column_name = 'l10n_fr_secure_sequence_number') THEN
UPDATE pos_order t
SET l10n_fr_secure_sequence_number = r.num
FROM (
SELECT id,
ROW_NUMBER() OVER (ORDER BY date_order ASC) AS num
FROM pos_order
) r
WHERE t.id = r.id;
END IF;
END $$;
EOF
)
echo "Reset l10n_fr_secure_sequence_number values to avoid missing sequence value for Odoo 18..."
query_postgres_container "$RESET_SECURE_SEQUENCE_NUMBER_SQL" ou18 || exit 1
# Execute SQL pre-migration commands
PRE_MIGRATE_SQL=$(cat <<'EOF'