OCA / odoorpc

Python module to pilot your Odoo servers through JSON-RPC.
http://pythonhosted.org/OdooRPC/
GNU Lesser General Public License v3.0
231 stars 123 forks source link

RPCError: 'mail.message' object has no attribute '_dummy' #71

Closed letouriste001 closed 1 year ago

letouriste001 commented 2 years ago

Hello, when i try to get some message with the code :

connection = odoorpc.ODOO(PORTAIL, port=PORT, protocol=PROTOCOL)
connection.login(BASE, USER, MDP)

obj = connection.env['mail.message']
datas = obj.search([('body', '=', 'test')])
for data in obj.browse(datas):
    print(data)

I have this error :

Traceback (most recent call last):
  File "C:\Users\Utilisateur\OneDrive\Bureau\WebdevOdoo\bac_a_sable.py", line 90, in <module>
    for data in obj.browse(datas):
  File "C:\Users\Utilisateur\OneDrive\Bureau\WebdevOdoo\venv\lib\site-packages\odoorpc\models.py", line 267, in browse
    return cls._browse(cls.env, ids)
  File "C:\Users\Utilisateur\OneDrive\Bureau\WebdevOdoo\venv\lib\site-packages\odoorpc\models.py", line 233, in _browse
    records._init_values()
  File "C:\Users\Utilisateur\OneDrive\Bureau\WebdevOdoo\venv\lib\site-packages\odoorpc\models.py", line 347, in _init_values
    rows = self.__class__.read(
  File "C:\Users\Utilisateur\OneDrive\Bureau\WebdevOdoo\venv\lib\site-packages\odoorpc\models.py", line 59, in rpc_method
    result = cls._odoo.execute_kw(cls._name, method, args, kwargs)
  File "C:\Users\Utilisateur\OneDrive\Bureau\WebdevOdoo\venv\lib\site-packages\odoorpc\odoo.py", line 482, in execute_kw
    data = self.json(
  File "C:\Users\Utilisateur\OneDrive\Bureau\WebdevOdoo\venv\lib\site-packages\odoorpc\odoo.py", line 273, in json
    raise error.RPCError(
odoorpc.error.RPCError: 'mail.message' object has no attribute '_dummy'

Process finished with exit code 1

First in 0.8.0. I use python 3.9.0 on windows 10

sebalix commented 1 year ago

Sorry for being late on this, you probably fix your issue by now, but I think the issue is happening on server-side, as soon as a RPCError is raised, high chance you have a traceback on Odoo, so not related to OdooRPC. Closing, but feel free to re-open if you think it's not the case.