wms icon indicating copy to clipboard operation
wms copied to clipboard

[IMP] stock_available_to_promise_release: Improve migration/init script to initialize 'release_policy' field with default values

Open rousseldenis opened this issue 10 months ago • 6 comments

The upgrade script should initialize the value with the sql default instead updating every existing record (maybe billions).

rousseldenis avatar Apr 10 '24 10:04 rousseldenis

@jbaudoux @mt-software-de

rousseldenis avatar Apr 10 '24 12:04 rousseldenis

This is the magic:

image

rousseldenis avatar Apr 10 '24 12:04 rousseldenis

Many thanks yes this was missing. Why did not set the release_policy as it is done here? https://github.com/OCA/wms/blob/111d87780457fa740dc0cc5609c47ab26be5916d/stock_available_to_promise_release/migrations/16.0.3.1.0/post-migrate.py#L5

mt-software-de avatar Apr 10 '24 13:04 mt-software-de

Many thanks yes this was missing. Why did not set the release_policy as it is done here?

https://github.com/OCA/wms/blob/111d87780457fa740dc0cc5609c47ab26be5916d/stock_available_to_promise_release/migrations/16.0.3.1.0/post-migrate.py#L5

Here, I initialize the field with the default value, so, it should be done in pre script.

I've put it also in pre-init as the module can be installed on huge database too

rousseldenis avatar Apr 10 '24 15:04 rousseldenis

Many thanks yes this was missing. Why did not set the release_policy as it is done here? https://github.com/OCA/wms/blob/111d87780457fa740dc0cc5609c47ab26be5916d/stock_available_to_promise_release/migrations/16.0.3.1.0/post-migrate.py#L5

Here, I initialize the field with the default value, so, it should be done in pre script.

I've put it also in pre-init as the module can be installed on huge database too

Many thanks yes this was missing. Why did not set the release_policy as it is done here? https://github.com/OCA/wms/blob/111d87780457fa740dc0cc5609c47ab26be5916d/stock_available_to_promise_release/migrations/16.0.3.1.0/post-migrate.py#L5

Here, I initialize the field with the default value, so, it should be done in pre script.

I've put it also in pre-init as the module can be installed on huge database too

Yes i have seen this, but why we don't remove the post_migration and moving the post_migration part into the new init method?

mt-software-de avatar Apr 11 '24 07:04 mt-software-de

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

github-actions[bot] avatar Aug 11 '24 12:08 github-actions[bot]