[17.0][OU-ADD] l10n_fr_hr_holidays: Migration scripts#5539
[17.0][OU-ADD] l10n_fr_hr_holidays: Migration scripts#5539remi-filament wants to merge 1 commit intoOCA:17.0from
Conversation
|
Hi @hbrunn I see the following in the logs : We can see that it ends loading the 42 modules present initially, then it goes through the 2 new modules account_payment_term and l10n_fr_hr_holidays. Maybe I need to change the version number or trick something ? |
|
hmm, 17. I don't even have a debug env for 17 any more. Start debugging in https://github.com/OCA/OpenUpgrade/blob/17.0/openupgrade_framework/odoo_patch/odoo/modules/migration.py#L18 to see why this doesn't run |
|
or wait, that's a post-migration script, I don't think we guarantee running those. Please try if it does run a pre-migration script, if so, you'll have to bite the bullet and precreate the field to set the link with sql |
f7e9a1e to
964c369
Compare
|
Thanks for the pointer @hbrunn I found how to force use of post-migration script by adding no_version=True to migrate decorator ! |
|
ah right. might make sense to document that in https://github.com/OCA/OpenUpgrade/blob/documentation/docsource/080_migration_script_development.rst, no? |
|
Yes it should probably be added in documentation, although I think it may not be needed on v18 at least. I found only one other occurence of this no_version=True here : where we were in the same case (sale_project is a new module split from sale_timesheet.However on version 18.0 it seems to be working without having to add this parameter, as done for instance here : I am not sure then if this is because it is not needed anymore on v18 or for any other reason ? Maybe @pedrobaeza or @MiquelRForgeFlow or @legalsylvain or @StefanRijnhart can shed some light here ? |
|
You need to use it when the module is new, no matter the version. |
|
Thanks @pedrobaeza I think I realized why : l10n_fr_account is not considered as new in v18 because it is in apriori.py in merged_modules from l10n_fr_fec and l10n_fr_invoice_addr which is called in base/pre-migration for renaming the modules, so it is not considered as a new module... We should then consider adding it in documentation as pointed out here : #5539 (comment) |
|
Yes, on merged modules, they are considered already installed, so they pass a version in the argument. |
Look for most accurate leave type to set in configuration parameter for this new module