Migrate process plugin for adjusting stock level during update

Created on 24 December 2021, almost 3 years ago

Problem/Motivation

Currently the stock levels (using local stock storage) may be imported with Migrate as a normal field value, e.g.:

process:
  field_stock_level: field_stock_level

However, running the same migration again (--update) would cause stock levels to double.
The specific use case is using Migrate to sync data to an external source (e.g. with migrate_cron β†’ ).

Steps to reproduce

  1. Use Migrate to import product variations data including stock level.
  2. Execute migration several times (with --update).
  3. Observe the stock level to be multiplied.

Proposed resolution

Introduce a Migrate process plugin to convert incoming absolute stock level to an adjustment transaction.

Remaining tasks

Tests?

User interface changes

None.

API changes

None.

Data model changes

None.

✨ Feature request
Status

Needs review

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡¦Ukraine abramm Lutsk

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024