Closed m3asmi closed 1 year ago
@m3asmi Thank you for the report.
Can you provide a bit more information which can help with the analyze?
At first glance it looks like a problem with one of the _inherit
in your modules. If you can find out the specific module and post the specific code snippet with the _inherit it would be a great help.
Hello,
thanks for your response,
I used $ pip3 install "odoo-analyse[graph]"
to install it now
how can I find the module that contains the problem ?
How do you start the tool?
Currently you can only try to run odoo_analyse -p <path>
to analyse one module at a time. You can also try to use grep -r -C 2 _inherit <path>
. On your module directory. You should look for a line where the value right of the =
isn't a literal (string or list.)
@m3asmi I added a --verbose
flag in version 1.1.2 which shows a bit more information while analysing and should print the last analysed module. I hope it helps to figure out the specific line if you update odoo_analyse.
Hello,
I updated the code using PIP and --verbose
does not exist,
rachid@EliteBook:/opt/odoo/custom/$ odoo_analyse --path ./ --show-dependency
malformed node or string: <_ast.BinOp object at 0x7f95deee2040>
Traceback (most recent call last):
File "/home/rachid/.local/lib/python3.8/site-packages/odoo_analyse/module.py", line 430, in find_modules_iter
module = cls.from_path(path)
File "/home/rachid/.local/lib/python3.8/site-packages/odoo_analyse/module.py", line 383, in from_path
module._parse_python(path, f)
File "/home/rachid/.local/lib/python3.8/site-packages/odoo_analyse/module.py", line 239, in _parse_python
self._parse_python("%s%s/" % (p, f), "__init__.py")
File "/home/rachid/.local/lib/python3.8/site-packages/odoo_analyse/module.py", line 237, in _parse_python
self._parse_python(p, f + ".py")
File "/home/rachid/.local/lib/python3.8/site-packages/odoo_analyse/module.py", line 221, in _parse_python
self._parse_class_def(child, content)
File "/home/rachid/.local/lib/python3.8/site-packages/odoo_analyse/module.py", line 194, in _parse_class_def
model = Model.from_ast(obj, content)
File "/home/rachid/.local/lib/python3.8/site-packages/odoo_analyse/model.py", line 107, in from_ast
model._parse_assign(child, content)
File "/home/rachid/.local/lib/python3.8/site-packages/odoo_analyse/model.py", line 64, in _parse_assign
value = ast.literal_eval(value)
File "/usr/lib/python3.8/ast.py", line 99, in literal_eval
return _convert(node_or_string)
File "/usr/lib/python3.8/ast.py", line 98, in _convert
return _convert_signed_num(node)
File "/usr/lib/python3.8/ast.py", line 75, in _convert_signed_num
return _convert_num(node)
File "/usr/lib/python3.8/ast.py", line 66, in _convert_num
_raise_malformed_node(node)
File "/usr/lib/python3.8/ast.py", line 63, in _raise_malformed_node
raise ValueError(f'malformed node or string: {node!r}')
ValueError: malformed node or string: <_ast.BinOp object at 0x7f95deee2040>
rachid@EliteBook:/opt/odoo/custom/$ odoo_analyse --path ./ --show-dependency --version
usage: odoo_analyse [-h] [-c CONFIG] [-p PATH] [-l LOAD] [-s SAVE] [--path-filter PATH_FILTER] [--models MODELS] [--modules MODULES] [--views VIEWS] [--test-filter] [--state-filter] [--db_host DB_HOST]
[--db_port DB_PORT] [--db_user DB_USER] [--db_password] [--db_name DB_NAME] [--show-dependency] [--show-import] [--show-reference] [--migration MIGRATION] [--model-graph]
[--no-model-inherit] [--no-model-inherits] [--view-graph] [--no-view-inherit] [--no-view-call] [--structure-graph] [--analyse ANALYSE] [--analyse-output {csv,json}] [-i] [--full-graph]
[--renderer RENDERER]
odoo_analyse: error: unrecognized arguments: --verbrose
It doesn't look like that you are using the right version. You can check it with pip3 list
. You could try pip3 install -U "odoo-analyse[graph]"
or uninstall and install afterwards.