Skip to content

[14.0][FIX] website_sale_extra_fields: slug_name NOT NULL on fresh install#870

Closed
eantones wants to merge 1 commit into14.0from
14.0-fix-website_sale_extra_fields-slug_name_not_null
Closed

[14.0][FIX] website_sale_extra_fields: slug_name NOT NULL on fresh install#870
eantones wants to merge 1 commit into14.0from
14.0-fix-website_sale_extra_fields-slug_name_not_null

Conversation

@eantones
Copy link
Copy Markdown
Member

Summary

  • Add pre_init_hook to pre-create the slug_name column on product_public_category and fill existing NULL rows with a placeholder before _auto_init runs
  • Prevents ERROR: column "slug_name" contains null values when installing on a database that already has product.public.category records (e.g. from website_sale demo data)
  • Standard OCA pattern for required stored computed fields on inherited models

Test plan

  • Install website_sale_extra_fields on a fresh database with demo data enabled — should not crash
  • Verify slug_name is computed correctly after install

Add pre_init_hook to pre-create the slug_name column and fill existing
rows with a placeholder value before _auto_init runs. This prevents
the SET NOT NULL constraint from failing when product_public_category
records already exist from website_sale demo data.
@eantones eantones closed this Mar 25, 2026
@eantones eantones deleted the 14.0-fix-website_sale_extra_fields-slug_name_not_null branch March 25, 2026 22:19
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 50.58%. Comparing base (ce814c2) to head (6ad89cf).

Additional details and impacted files
@@            Coverage Diff             @@
##             14.0     #870      +/-   ##
==========================================
+ Coverage   50.53%   50.58%   +0.05%     
==========================================
  Files         979      980       +1     
  Lines       16685    16692       +7     
  Branches     3558     3558              
==========================================
+ Hits         8432     8444      +12     
+ Misses       8034     8033       -1     
+ Partials      219      215       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant