Skip to content

TypeError: unsupported operand type(s) for |: 'type' and 'type' #135

@jeffery9

Description

@jeffery9

Module

oca/feet/fleet_vehicle_log_fuel

Describe the bug

run migrate scripts. report error.

Traceback (most recent call last):
  File "/Users/jeffery/Library/Python/3.9/bin/odoo-module-migrate", line 8, in <module>
    sys.exit(main())
  File "/Users/jeffery/Library/Python/3.9/lib/python/site-packages/odoo_module_migrate/__main__.py", line 143, in main
    migration = Migration(
  File "/Users/jeffery/Library/Python/3.9/lib/python/site-packages/odoo_module_migrate/migration.py", line 109, in __init__
    self._get_migration_scripts()
  File "/Users/jeffery/Library/Python/3.9/lib/python/site-packages/odoo_module_migrate/migration.py", line 222, in _get_migration_scripts
    self._migration_scripts.extend(self._load_migration_script(full_name))
  File "/Users/jeffery/Library/Python/3.9/lib/python/site-packages/odoo_module_migrate/migration.py", line 173, in _load_migration_script
    module = importlib.import_module(full_name)
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/Users/jeffery/Library/Python/3.9/lib/python/site-packages/odoo_module_migrate/migration_scripts/migrate_160_170.py", line 14, in <module>
    class AbstractVisitor(ast.NodeVisitor):
  File "/Users/jeffery/Library/Python/3.9/lib/python/site-packages/odoo_module_migrate/migration_scripts/migrate_160_170.py", line 35, in AbstractVisitor
    def add_change(self, old_node: ast.AST, new_node: ast.AST | str):
TypeError: unsupported operand type(s) for |: 'type' and 'type'

To Reproduce

Affected versions:
0.40

Steps to reproduce the behavior:

  1. oca fleet 16.0
  2. migrate fleet_vehicle_log_fuel
  3. report error.

Expected behavior
A clear and concise description of what you expected to happen.

Additional context
Add any other context about the problem here. (e.g. OS, Python version, ...)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions