|
33 | 33 | ) |
34 | 34 | from .inconsistencies import break_recursive_loops |
35 | 35 | from .indirect_references import indirect_references |
36 | | -from .inherit import direct_inherit_parents, for_each_inherit |
| 36 | +from .inherit import for_each_inherit, inherits_parents |
37 | 37 | from .misc import Sentinel, chunks, parse_version, version_gte |
38 | 38 | from .orm import env, flush |
39 | 39 | from .pg import ( |
@@ -841,16 +841,15 @@ def rename_xmlid(cr, old, new, noupdate=None, on_collision="fail"): |
841 | 841 | """ |
842 | 842 | cr.execute(query, {"old": r"\y{}\y".format(re.escape(old)), "new": new}) |
843 | 843 |
|
844 | | - for parent_model, inh in direct_inherit_parents(cr, model): |
845 | | - if inh.via: |
846 | | - parent = parent_model.replace(".", "_") |
847 | | - rename_xmlid( |
848 | | - cr, |
849 | | - "{}_{}".format(old, parent), |
850 | | - "{}_{}".format(new, parent), |
851 | | - noupdate=noupdate, |
852 | | - on_collision=on_collision, |
853 | | - ) |
| 844 | + for parent_model, _ in inherits_parents(cr, model): |
| 845 | + parent = parent_model.replace(".", "_") |
| 846 | + rename_xmlid( |
| 847 | + cr, |
| 848 | + "{}_{}".format(old, parent), |
| 849 | + "{}_{}".format(new, parent), |
| 850 | + noupdate=noupdate, |
| 851 | + on_collision=on_collision, |
| 852 | + ) |
854 | 853 | return new_id |
855 | 854 | return None |
856 | 855 |
|
|
0 commit comments