|
- # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
-
- from odoo_module_migrate.base_migration_script import BaseMigrationScript
-
- _TEXT_REPLACES = {
- ".py": {
- r"\.get_xml_id\(": ".get_external_id(",
- r"\.fields_get_keys\(\)": "._fields",
-
- r"\.flush\(\)": ".env.flush_all()",
- r"\.flush\((?P<p1>[^/)]+?)\)": r"flush_model(\g<p1>)",
- r"\.flush\((?P<p1>[^/)]+?)\,(?P<p2>[^/)]+?)\)": r".flush_recordset(\g<p1>,\g<p2>)",
- r"\.refresh\(\)": ".invalidate_model()",
- r"\.invalidate\(\)": ".invalidate_all()",
- r"\.invalidate_cache\((?P<p1>[^/)]+?)\)": r".invalidate_model(\g<p1>)",
- r"self\.invalidate_cache\((?P<p1>[^/)]+?)\)": r"self.env.invalidate_all(\g<p1>)",
- r"\.recompute\(\)": "._recompute_model()",
- r"\.recompute\((?P<p1>[^/)]+?)\)": r"._recompute_all(\g<p1>)",
- r"\.recompute\((?P<p1>[^/)]+?)\,(?P<p2>[^/)]+?)\)":r"._recompute_recordset(\g<p1>,\g<p2>)",
- },
- }
-
-
- class MigrationScript(BaseMigrationScript):
- _TEXT_REPLACES = _TEXT_REPLACES
|