tinyerp / erppeek

A versatile tool for Odoo / OpenERP. *** Forked as Odooly ⟶
https://github.com/tinyerp/odooly
Other
171 stars 99 forks source link

Password is wrong. Doesn't raise an error #30

Closed Pacodastre closed 10 years ago

Pacodastre commented 10 years ago

After creating a new database in OpenERP, I didn't use the same password as i always use. ERPPeek didn't tell me the password was wrong until i was trying to create an object with Client.

Traceback (most recent call last): File "lib/python2.7/site-packages/django/core/handlers/base.py", line 114, in get_response response = wrapped_callback(request, _callback_args, _callback_kwargs) File "decorators.py", line 42, in convert return func(request, _args, _kwargs) File "decorators.py", line 22, in _wrapped_view return view_func(request, _args, _kwargs) File "offers.py", line 348, in offer_creation request.FILES) File "offers.py", line 423, in create_offer_db offer_id = erp.Client.create('product.product', offer_data) File "erppeek.py", line 894, in wrapper return self.execute(obj, method, _params, _kwargs) File "erppeek.py", line 636, in execute res = self._execute(obj, method, *params) TypeError: 'NoneType' object is not callable

After putting a few pdbs in the code, I realised that self._execute was still None because the function called "authenticated" defined in login returned None instead of raising an error ?

florentx commented 10 years ago

Actually, it prints a message when used interactively:

$ erppeek --server http://127.0.0.1:8069 --db openerp_demo
Password for 'admin':
Error: Invalid username or password
openerp_demo >>> 

If used as a library, you can check Client.user to verify if it is connected.

I'll see if I can raise a RuntimeError in such case.

Pacodastre commented 10 years ago

Thanks, will use that for the moment.

florentx commented 10 years ago

it's improved with 1.5.2