Skip to content

CRM 0.9.0: Bring Catalogue manufacturers into the CRM

CRM 0.9.0 adds a one-off task that moves your Catalogue manufacturers into the CRM as companies, as the supplier import already did for suppliers. It also fixes both imports so descriptions and logos arrive where the CRM shows them.

Manufacturers import

Catalogue manufacturers kept appearing in the item form’s dropdown from the old local list, while the Manufacturers filter on the CRM companies page stayed empty. The new task closes that gap:

mix phoenix_kit_crm.import_manufacturers_from_catalogue           # dry run
mix phoenix_kit_crm.import_manufacturers_from_catalogue --apply   # write

Without --apply it only reports what it would do. For each manufacturer it looks for an existing CRM company by email, then by website, and otherwise creates one, then gives it the manufacturer role. Each manufacturer is marked as imported, so running the task again does not create doubles, and the Catalogue pickers then list the CRM company instead of showing it twice.

Import fixes

  • The description of an imported supplier or manufacturer went into a hidden data field instead of the company’s own Description. Both imports now fill the real field.
  • A manufacturer’s logo is now carried over, so the Catalogue pickers keep showing it.
  • When two catalogue rows matched the same CRM company, for example two brands on one domain, the import failed halfway and left the company listed twice. Such a row is now reported as claimed by another and left alone, for suppliers too.

Upgrading

No CRM migration. The task needs PhoenixKit core migration V178, so run mix phoenix_kit.update first. Run the task without --apply, read the report, then run it with --apply.

Full release notes: CRM 0.9.0

0.9.0 · 31 August 2026

Added

  • Manufacturers backfill (#31). mix phoenix_kit_crm.import_manufacturers_from_catalogue — the twin the supplier import shipped without. Dry-run by default, --apply writes; idempotent via V178’s crm_company_uuid stamp; matches an existing CRM company by extracted email, then by normalized website, otherwise creates one and grants the manufacturer role. Catalogue manufacturers previously kept feeding the item form’s dropdown as the old local list while the CRM Companies page’s Manufacturers filter showed nothing.
  • PhoenixKitCRM.CatalogueImport (#31). The supplier task’s machinery extracted into one engine parameterized per flow; both mix tasks are thin wrappers and the supplier task keeps its public-for-testing surface as delegators.

Fixed

  • The backfill wrote a source row’s description into the company’s metadata map on the premise that a CRM company has no such column. It has one — migration V02 added it for these very rows — so the text was invisible to the company form and every Company consumer. Both flows now write the real column (post-merge review of #31).
  • Manufacturer logo_url was dropped entirely. Migration V03 added phoenix_kit_crm_companies.logo_url so a company could carry the brand mark the catalogue’s manufacturer rows held, and PartyRoles.get_manufacturer/1 returns it to the catalogue’s pickers — once a local row was hidden behind its imported party, every imported manufacturer lost its logo. It is now carried across (post-merge review of #31).
  • Two source rows matching one CRM party (two brands on a shared domain or contact email) granted the role and then raised on the stamp, tripping V178’s partial unique index and leaving the party listed alongside the still-visible unstamped local row — the split-brain that index exists to prevent. Such a row is now reported as claimed-by-other and left untouched, on the supplier path too (post-merge review of #31).

Changed

  • Dependency bump: phoenix_kit 2.13.8 → 2.13.17, phoenix_kit_comments 0.4.3 → 0.4.5, plus hammer, leaf and oban lockfile updates.
  • PhoenixKitCRM.Schemas.PartyRole’s moduledoc no longer states that the manufacturer role is never granted in bulk — the opt-in backfill above is now a sanctioned path. What still holds is that it is never granted implicitly or from a form.

CRM 0.9.0. Install or update: {:phoenix_kit_crm, "~> 0.9"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.