Repository navigation
[OU-FIX] base: create missing cron server action XML IDs - #6057
Conversation
carlos-lopez-tecnativa
left a comment
There was a problem hiding this comment.
Just out of curiosity, from which Odoo version did you migrate? I reviewed a database created in v13, and it already has the XML IDs for ir.cron and ir.actions.server, so I'm not sure whether this code should target a lower branch.
|
Good point!!. I'd still keep the fix in 18.0: 18.0 is the first version whose data references these XML IDs (the stock and mrp procurement menus), so the missing ones are harmless before, and fixing it in 11.0 wouldn't help databases that already went through it. |
|
I have updated de PR description |
hbrunn
left a comment
There was a problem hiding this comment.
as this is a quite generic problem, I'd like to see a function in openupgradelib that handles this in a generic way
When a record with an XML ID is created, Odoo also creates the XML ID `<xmlid>_<parent model>` of its `_inherits` parent, but crons created by old versions lack the one of their server action. This happens on databases started in 10.0 or earlier, whose crons got their server action in the 11.0 migration. 18.0 is the first version whose data references them (stock.ir_cron_scheduler_action_ir_actions_server in the stock and mrp procurement menus), so updating stock fails with "External ID not found in the system". They are added with the generic openupgradelib add_inherits_parent_xmlids. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
PR to openupgradelib done: OCA/openupgradelib#476 |
e5a1d05 to
591f248
Compare
|
This PR (OCA/openupgradelib#476) has been merged so now we can use the method PR updated |
carlos-lopez-tecnativa
left a comment
There was a problem hiding this comment.
/ocabot merge nobump
|
This PR looks fantastic, let's merge it! |
|
This PR has the |
|
Congratulations, your PR was merged at a393ddb. Thanks a lot for contributing to OCA. ❤️ |
When a record with an XML ID is created, Odoo also creates the XML ID
<xmlid>_<parent model>of its_inheritsparent, but crons created by old versions lack the one of their server action. This happens on databases started in 10.0 or earlier, whose crons got their server action in the 11.0 migration.18.0 is the first version whose data references them (stock.ir_cron_scheduler_action_ir_actions_server in the stock and mrp procurement menus), so updating stock fails with "External ID not found in the system: stock.ir_cron_scheduler_action_ir_actions_server".
Reloading the cron data can't fix it, as the parent XML ID is only added when the record is created, not when an existing one is updated, so the missing XML IDs are added from the cron ones with add_xmlid.
@Tecnativa
ping @carlosdauden @carlos-lopez-tecnativa @CarlosRoca13