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.

28 line
800B

  1. # Copyright (C) 2019 - Today: GRAP (http://www.grap.coop)
  2. # @author: Sylvain LE GAL (https://twitter.com/legalsylvain)
  3. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
  4. from odoo_module_migrate.base_migration_script import BaseMigrationScript
  5. _TEXT_REPLACES = {
  6. ".xml": {
  7. r"<data +noupdate=\"0\" *>": "<data>",
  8. }
  9. }
  10. def set_module_installable(**kwargs):
  11. tools = kwargs['tools']
  12. manifest_path = kwargs['manifest_path']
  13. old_term = r"('|\")installable('|\").*(False)"
  14. new_term = r"\1installable\2: True"
  15. tools._replace_in_file(
  16. manifest_path, {old_term: new_term}, "Set module installable")
  17. class MigrationScript(BaseMigrationScript):
  18. _TEXT_REPLACES = _TEXT_REPLACES
  19. _GLOBAL_FUNCTIONS = [
  20. set_module_installable,
  21. ]
上海开阖软件有限公司 沪ICP备12045867号-1