You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
1.0KB

  1. # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
  2. from odoo_module_migrate.base_migration_script import BaseMigrationScript
  3. _TEXT_REPLACES = {
  4. ".py": {
  5. r"\.get_xml_id\(": ".get_external_id(",
  6. r"\.fields_get_keys\(\)": "._fields",
  7. r"\.flush\(\)": ".env.flush_all()",
  8. r"\.flush\((?P<p1>[^/)]+?)\)": r"flush_model(\g<p1>)",
  9. r"\.flush\((?P<p1>[^/)]+?)\,(?P<p2>[^/)]+?)\)": r".flush_recordset(\g<p1>,\g<p2>)",
  10. r"\.refresh\(\)": ".invalidate_model()",
  11. r"\.invalidate\(\)": ".invalidate_all()",
  12. r"\.invalidate_cache\((?P<p1>[^/)]+?)\)": r".invalidate_model(\g<p1>)",
  13. r"self\.invalidate_cache\((?P<p1>[^/)]+?)\)": r"self.env.invalidate_all(\g<p1>)",
  14. r"\.recompute\(\)": "._recompute_model()",
  15. r"\.recompute\((?P<p1>[^/)]+?)\)": r"._recompute_all(\g<p1>)",
  16. r"\.recompute\((?P<p1>[^/)]+?)\,(?P<p2>[^/)]+?)\)":r"._recompute_recordset(\g<p1>,\g<p2>)",
  17. },
  18. }
  19. class MigrationScript(BaseMigrationScript):
  20. _TEXT_REPLACES = _TEXT_REPLACES
上海开阖软件有限公司 沪ICP备12045867号-1