xmlrpc interface: inconsistent default arguments

Bug #676517 reported by fc
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
Confirmed
Wishlist
OpenERP's Framework R&D

Bug Description

for overloaded orm methods, default arguments are varying which make some basic xmlrpc calls to fail for some objects and succeed for others.
For instance, "name_search" is declared in orm.py as:
 /
| name_search(self, cr, user, name='', args=None, operator='ilike', context=None, limit=100):
 \
so basically:
 /
| OBJ.xmlrpclib.ServerProxy("http://%s:%u/xmlrpc/object"%(HOST,PORT))
| OBJ.execute(BASE,UID,PASS,NAME,"name_search")
 \
should work for any object name (NAME) in the system, unfortunately, it's not, as some overloaded name_search method don't set all the default values (e.g. 3rd arg name).

Some other calls are also probably affected. This is not a critical issue, but the behavior should be consistent (either _no_ defaults or same defaults everywhere).

Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

Hello,

Could you elaborate on this and perhaps give the name of the classes that you found have a name_search with incorrect parameter defaults? Is that in server or in the addons?

Many thanks!

Changed in openobject-server:
status: New → Incomplete
Revision history for this message
fc (fc-tempo-consulting) wrote :

The problem concerns addons.
For instance, here's the list of objects where 'name' doesn't default to an empty string (thus requiring one more argument):

> grep -R 'def name_search.*name,' *
addons/analytic/analytic.py: def name_search(self, cr, uid, name, args=None, operator='ilike', context=None, limit=100):
addons/auction/auction.py: def name_search(self, cr, user, name, args=None, operator='ilike', context=None):
addons/project_scrum/project_scrum.py: def name_search(self, cr, uid, name, args=None, operator='ilike', context=None, limit=100):
addons/account/account.py: def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=100):
addons/account/account.py: def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=100):
addons/account/account.py: def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=80):
addons/account/account.py: def name_search(self, cr, user, name, args=None, operator='ilike', context={}, limit=80):
addons/account/account.py: def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=80):
addons/account/account.py: def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=80):
addons/account/account.py: def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=80):
addons/account/invoice.py: def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=100):
addons/l10n_be/wizard/l10_be_partner_vat_listing.py: def name_search(self, cr, uid, name, args=None, operator='ilike', context=None, limit=100):
addons/base/res/partner/partner.py: def name_search(self, cr, uid, name, args=None, operator='ilike', context=None, limit=100):
addons/base/res/partner/partner.py: def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=100):
addons/base/res/res_currency.py: def name_search(self, cr, uid, name, args=[], operator='ilike', context={}, limit=100):

Changed in openobject-server:
assignee: nobody → OpenERP's Framework R&D (openerp-dev-framework)
importance: Undecided → Low
status: Incomplete → Confirmed
Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

Targetting for improvement after v6.0 (wishlist+confirmed). Thanks!

Changed in openobject-server:
importance: Low → Wishlist
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.