[IMP] cow_templates_replicate_upstream: also update inherit_id - #463
Conversation
pedrobaeza
left a comment
There was a problem hiding this comment.
Wait, this is not correct at all. Maybe there's another parent specific for the website, and it should be set as the inherit. Can it be? Or am I wrong?
|
I think the best approach would be:
This way we preserve the website-specific inheritance chain instead of always pointing the COW view directly to the generic parent. |
6d2f732 to
ea6e1c4
Compare
Exactly, that's the approach I already pushed — get the generic parent's key, look for a COW copy of it for the same |
|
Now to apply these 2 methods in all the OpenUpgrade versions... |
cow_templates_replicate_upstreamonly copiesarch_dbfrom the generic view to its COW'd copies, notinherit_id.That's enough when a module migration only changes the content of the parent template, but not when the migration itself re-targets which template the view inherits from — the COW copy keeps the old
inherit_idand view combination still fails at render time, even afterarch_dbis refreshed.This showed up in a real migration: OCA/e-commerce#1295 restructures
website_sale_product_attribute_filter_category's view becausewebsite_salemoved the attribute-filter loop to a different template between 18.0 and 19.0. A website that had the option toggled on in 18.0 kept crashing/shopafter upgrading, because its COW copy still inherited from the old template.The fix copies
inherit_idalong witharch_db, but first checks whether the new parent template itself has its own COW copy for that same website — if so, it points there instead of at the generic parent, preserving that website's own customization chain. When the parent didn't change, or there's no website-specific copy of it, it falls back togeneric.inherit_idas before (no-op / same behavior as the initial version of this fix).@Tecnativa TT64160
@pedrobaeza @pilarvargas-tecnativa