[trunk] Hr_applicant : On Webclient,the field Appreciation(priority) when chosen, any button click will throw a traceback

Bug #878432 reported by Serpent Consulting Services
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Invalid
Undecided
Unassigned
Odoo Server (MOVED TO GITHUB)
Invalid
Wishlist
OpenERP's Framework R&D
Odoo Web Client
Won't Fix
Undecided
Unassigned

Bug Description

Select any applicant record, assign any value to the field 'Appreciation', press any button to traverse through next state.

There will be a traceback as follows:
Traceback (most recent call last):
  File "/home/salmaan/workspace/trunk/server/openerp/service/netrpc_server.py", line 62, in run
    result = netsvc.dispatch_rpc(msg[0], msg[1], msg[2:])
  File "/home/salmaan/workspace/trunk/server/openerp/netsvc.py", line 325, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/home/salmaan/workspace/trunk/server/openerp/service/web_services.py", line 580, in dispatch
    res = fn(db, uid, *params)
  File "/home/salmaan/workspace/trunk/server/openerp/osv/osv.py", line 122, in wrapper
    raise except_osv(inst.name, inst.value)
except_osv: (u'ValidateError', u'The value "4" for the field "hr_applicant.priority" is not in the selection')

There should either be a fix from
1. web to send char values to server for selection widget.
 The FancyValidator/Schema should consider the type as well. Right now, it considers only the widget attribute.

OR

2. Server should always compare the string conversion of value, to selection list/tuple.

OR

3. The addon should be corrected in order to allocate only character values to selection list, rather than '1','2',etc.

Note: GTK seems approaching right to the server.

Thanks,
Serpent Consulting Services.

summary: - [trunk] Hr_applicant : the field Appreciation(priority) when chosen, any
- button click will throw a traceback
+ [trunk] Hr_applicant : On Webclient,the field Appreciation(priority)
+ when chosen, any button click will throw a traceback
Revision history for this message
Vishal Parmar(Open ERP) (vpa-openerp) wrote :

Hello,

I have checked your issue with updated trunk but I didn't face the same trace back as you have.

Revision of Trunk :

        Server - 3772
       Gtk-Client - 1983
       Web-client - 1309
       addons - 5425

Would you please try with updated code.

Thanks and waiting for your reply.

Changed in openobject-client-web:
status: New → Incomplete
Changed in openobject-addons:
status: New → Incomplete
Amit Parik (amit-parik)
Changed in openobject-server:
status: New → Incomplete
Revision history for this message
Serpent Consulting Services (serpent-consulting-services) wrote :

Hello Vishal,

I wish to reproduce the error, but I get a different error this time.(I made sure the code is fully updated and I am working on a new DB)

Client Traceback (most recent call last):
    File "/usr/lib/python2.7/xmlrpclib.py", line 1224, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1575, in __request
    verbose=self.__verbose
  File "/usr/lib/python2.7/xmlrpclib.py", line 1264, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1297, in single_request
    return self.parse_response(response)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1473, in parse_response
    return u.close()
  File "/usr/lib/python2.7/xmlrpclib.py", line 793, in close
    raise Fault(**self._stack[0])

Server Traceback (most recent call last):
  File "/home/serpent/workspace/trunk/server/openerp/wsgi.py", line 77, in xmlrpc_return
    result = openerp.netsvc.dispatch_rpc(service, method, params)
  File "/home/serpent/workspace/trunk/server/openerp/netsvc.py", line 325, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/home/serpent/workspace/trunk/server/openerp/service/web_services.py", line 580, in dispatch
    res = fn(db, uid, *params)
  File "/home/serpent/workspace/trunk/server/openerp/osv/osv.py", line 120, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/home/serpent/workspace/trunk/server/openerp/osv/osv.py", line 172, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/home/serpent/workspace/trunk/server/openerp/osv/osv.py", line 163, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/home/serpent/workspace/trunk/server/openerp/osv/orm.py", line 2100, in fields_view_get
    cr, user, context)
  File "/home/serpent/workspace/trunk/server/openerp/osv/orm.py", line 1877, in _get_default_search_view
    tree_view = self.fields_view_get(cr, uid, False, 'tree', context=context)
  File "/home/serpent/workspace/trunk/server/openerp/osv/orm.py", line 2100, in fields_view_get
    cr, user, context)
  File "/home/serpent/workspace/trunk/server/openerp/osv/orm.py", line 1811, in _get_default_tree_view
    _rec_name = self._columns.keys()[0]
IndexError: list index out of range

This is a different error hiding the error I reported.

Thanks,
Serpent Consulting Services.

Revision history for this message
Vishal Parmar(Open ERP) (vpa-openerp) wrote :

Hello,

Thanks for your reply.

I have again tried with fresh db with updated code. I think you have checked with web.

AVAILABLE_PRIORITIES = [
    ('', ''),
    ('5', 'Not Good'),
    ('4', 'On Average'),
    ('3', 'Good'),
    ('2', 'Very Good'),
    ('1', 'Excellent')
]

I have create new applicant with priority Good(3) and process further, press button In Progress it's refers with priority Good(3) , After that If I have set priority Very Good(2) and press button Hire then It is showing me "IndexError: list index out of range" because before Hire it's refers to Priority Good(3) not Very Good(2)
Correct me If I am wrong.

Thanks and waiting for your reply.

Revision history for this message
Serpent Consulting Services (serpent-consulting-services) wrote :

Vishal,

I wonder now that error doesn't appear anymore, but the error of "IndexError: list index out of range" still persists.

Thanks.

Changed in openobject-addons:
status: Incomplete → Invalid
Changed in openobject-server:
status: Incomplete → Confirmed
Revision history for this message
Serpent Consulting Services (serpent-consulting-services) wrote :

Vishal,

As far as the server is concerned, I attached a merge here which takes care of the situation when we might have no columns for a wizard and hence should not cause a failure.

For web, this is by design that it goes to calls the the fields_view_get() for search and tree view as well.

Thanks,
Serpent Consulting Services.

Revision history for this message
Vishal Parmar(Open ERP) (vpa-openerp) wrote :

Hello,

I have again check in trunk and stable with web and it is working fine at my end.
Would you please check attached video and informed us where you face the problem.

Thanks and waiting for your reply.

Revision history for this message
Vishal Parmar(Open ERP) (vpa-openerp) wrote :
Revision history for this message
Vishal Parmar(Open ERP) (vpa-openerp) wrote :

Hello,

Serpent Consulting Services. Thanks a lot for reporting issue and contributing to OpenERP.

I have reproduce it on trunk old web-client(6.0.3), but in new web client(6.1) all are working fine. As of 6.1 a newer

and better web frontend known as the OpenERP Web project[1] will be available.

As per your branch you have suggested a good improvement, So I am considering it as a "Wishlist" for server. If we

give a proper object and column definition then error will never comes.

Thank you!

Changed in openobject-client-web:
status: Incomplete → Won't Fix
Changed in openobject-server:
assignee: nobody → OpenERP's Framework R&D (openerp-dev-framework)
importance: Undecided → Wishlist
Revision history for this message
Serpent Consulting Services (serpent-consulting-services) wrote :

The newer web (6.1 onwards) does not have this issue and thus this bug should be closed.
Thanks.

Changed in openobject-server:
status: Confirmed → Invalid
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.